I'm having a few issues with objects in zero gravity. They seem to be slowing down for whatever reason and I can't seem to find a reason why.
I have some Rigid Bodies flying around a map. They are constrained to operate in only 2 dimensions and rotate about their Z axis (setLinearFactor(btVector3(1,1,0));setAngularFactor(btVector3(0,0,1)))
I have also turned off damping (setDamping(0,0)) and jacked up restitution (setRestitution(1))
If I set them to have zero linear velocity, but an angular velocity i.e:
RigidBody->setLinearVelocity(btVector3(0,0,0));
RigidBody->setAngularVelocity(btVector3(0,0,1));
Eventually the body will come to a complete stop.
Here's an example output:
Code: Select all
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.799493
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.799493
<omitted but you get the idea>
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.799493
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.799493
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.000000 <------
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.000000
LVelocity: x0.000000 y0.000000 z0.000000 - AVelocity: x0.000000 y0.000000 z0.000000
The other thing I'm having an issue with is that I have a few walls that are immovable (mass set to 0) and they seem to rob them of any momentum they had after time. I have set the restitution to 1 but that doesn't seem to make the objects bounce off with the same amount of energy they started with.
Any ideas?