Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bullet physics engine, how to freeze an object?

Using Bullet 2.76 I'm trying to freeze an object (rigid body) so that it instantly stops moving, but still responds to collisions.

I tried setting it's activation state to DISABLE_SIMULATION, but then it's virtually nonexistent to other objects. Furthermore, if objects "collide" with it when it's disabled, strange things begin to happen (object's falling through static bodies, etc.)

I suppose, temporarily converting it to a static rigid body could work, but is there an existing "native" way to achieve this on Bullet's side?

Edit: Is there a way to turn off gravity for a specific object?

like image 332
sunside Avatar asked Jun 10 '10 13:06

sunside


1 Answers

The documentation is a bit lacking but one would assume that the method below could be used to disable gravity on a specific body:

void btRigidBody::setGravity(const btVector3 &acceleration)
like image 143
Staffan Avatar answered Oct 19 '22 02:10

Staffan