Newton 2 - CustomMultiBodyVehicle unique collisions?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Newton 2 - CustomMultiBodyVehicle unique collisions?

Postby Aphex » Sat Aug 30, 2008 5:16 am


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...)
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK

Re: Newton 2 - CustomMultiBodyVehicle unique collisions?

Postby Julio Jerez » Sat Aug 30, 2008 5:49 am

basically what I do is teh I keep and array of pointer to the bodies with the jointitselft.
Then I use a special transformcallback to ge to teh tires
Julio Jerez
Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests