Odd joint scaling behavior on Cocos2d-x 3.3 final

Hey guys,

I’m facing this issue that when I scale a layer containing physics bodies attached to joints the joint’s constraints won’t scale accordingly.

For example, take a look at the video and see how the pin joints used on the cat’s tail maintains their pin points while the rest of the model scales.

Video of the mentioned behavior

Is there any way to force it to scale properly or is this behaviour by design?

Thanks much!

  • Fabiano

There is code to support this. When you set the scale on a node that has physics, it makes a call to updatePhysicsBodyTransform to update the physics body.

If you scale a node above your nodes with physics, such as a layer or container node which doesn’t have any physics, then it won’t update the physics bodies.

Try explicitly calling the method updatePhysicsBodyTransform on the node you are scaling and see if that works. It could also be that joints are not included in this update, in which case you should file a bug.

I submitted a bug for this…

Cool. Thanks!

Please, can you write an example ?