问题
I am hitting a ball with a force and there is a wall which is assigned a physics property and is static, but the ball is dynamic, the problem is when enough force is applied to the ball it passes through the wall, it is a type of table wall as in sample simple pool game. I have used ball.isBullet=true but same problem is there. Please suggest how to solve it.. thanks
回答1:
This is a fairly common issue when dealing with small, fast-moving objects. Typically, the best solution is to make the "walls" thicker, if that is possible within your game. Also, you may increase the velocity and position iterations (links below)... just remember that both of these (along with .isBullet=true) may result in a slight performance penalty, so the first approach is the best.
http://docs.coronalabs.com/api/library/physics/setVelocityIterations.html http://docs.coronalabs.com/api/library/physics/setPositionIterations.html
Brent Sorrentino
来源:https://stackoverflow.com/questions/19229076/physics-object-passing-through-wall-object-in-corona-sdk