Trying to move the vehicle joint to Newton2. I decided to store the tyre index in its collision user id, but it looks like they're ref counted.
I added a call to NewtonCollisionMakeUnique in CustomMultiBodyVehicle.cpp:
- Code: Select all
// release the collision
NewtonReleaseCollision (world, collision);
// MGB: added this
NewtonCollisionMakeUnique(world, collision);
// save the user data
NewtonBodySetUserData (tire, userData);
Do you think this is a good/useful addition, or is there a better way to store/get the tyre id?
(I want to use the body user data to point to the owning body's game-side class, so can't use that...)