Hello i have a problem with physics in cocos2d-x c++. I need to have a
draggable sprite with physics body. If this sprite is moving by self
there is no problem but when i drag the sprite, it not collide well with
other moving objects. I drag the sprite by PhysicsJointSpring. I mean a
small ball is penetrate a platform who falling down. The platforms are
falling by set a velocity on their physics body.
When the bodies dont move the collison work well
set your body setBullet(true) value, box2d has such property and I hope that chipmunk also has it.
This is called Tunelling and happend when body has a high speed, and when is bullet is turned on then box2d makes few more steps then earlier method to avoid huge jumps.
I believe you are using sprite->setPosition(Vec2(posX, posY)); you should never set positions to your sprites(with physics body attached), it will cause all type of problems as you are having one, One work around would be to check if your Sprite has collision with other Sprite(both Physics bodes attached) using physics listeners if they collide then stop positioning your physics body. Use this link to get listeners.
Try following link if you are using internal Physics.