Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon May 14, 2012 6:16 pm 
Offline

Joined: Tue Jan 31, 2012 12:23 am
Posts: 3
Is it possible to change the mass of a rigid body without removing it from the world first? Searches have indicated that it is, but I'm getting some really strange behaviour such as floating objects or just no movement at all.

I'm currently doing the following:

Code:
btVector3 inertia;
rigidBody->getCollisionShape()->calculateLocalInertia( newmass, inertia );
rigidBody->setMassProps( newmass, inertia );
rigidBody->updateInertiaTensor();


The body in question is actually used in a btRaycastVehicle, though I don't suppose that should make any difference?

Thanks


Top
 Profile  
 
PostPosted: Tue May 15, 2012 12:26 am 
Offline

Joined: Tue Jan 31, 2012 12:23 am
Posts: 3
Hmm, it would seem that even removing / re-adding the body before and after that block of code still doesn't help. The effects aren't particularly drastic but the vehicle is pretty much undrivable, even if I then set mass back to the original value :?


Top
 Profile  
 
PostPosted: Tue May 15, 2012 11:52 pm 
Offline

Joined: Tue May 01, 2012 10:42 am
Posts: 40
It's probably important when you do this. Do you use the tick callback (pre or post)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group