RigidBodyControl cloning bug

When cloning a spatial that has a RigidBodyControl the cloneFields method in the RigidBodyControl will clone the spatial but the new clone user object field will be null.

When the PhysicsCollisionObject collied with another object its user object will be null so the spatial reference that should be in the user object field will not be accessible from the collision listener. I think that there should be a setUserObject(spatial); in the cloneFields method.

I believe this is an example of issue 797.

1 Like

I suggested to set the user object in the RigidBodyControl cloneFields method so that the PhysicsRigidBody will not be affected and therefore KinimaticRagdollControl. This is an expected behaviour since the RigidBodyControl sets the spatial as the user object everywhere else.

1 Like

Thank you for your suggestion. I believe it would work.

1 Like