|
In general, moving a body by modifying the positions directly tends to produce some undesired results in the physics. While working on my game, I had encountered problems with sleeping bodies and them not waking up, even when you change their position directly.
It seems like you're moving the static bodies by changing their positions directly to produce a sliding effect while keeping the platforms completely sturdy, uninfluenced by any force. If you want a moving platforms that are not influenced by any other body, use the kinematic setting (b2Body.b2_kinematicBody) instead of static when you're defining the body definition and use SetLinearVelocity() to move the platforms. The kinematic bodies do not collide with static or other kinematic bodies and they are not influenced by gravity forces or any other forces. They do not change velocity until you use SetLinearVelocity() again.
|