I am trying to model a rotating planet. I don't want it to interact with any other game objects, but i would like its rotation to be in sync with everything else. Right now I have a btRigidBody, set as a sphere with a mass and radius of 1. I set its angular velocity before the simulation starts and then I don't touch it. I take its transform and use that for my planet, which is scaled appropriately.
If I make the sphere actual size, things get weird, but I can understand that. What I don't understand is that if I set the angular velocity to anything less than 1, (0,.5,0) for instance, the sphere will rotate for a few degrees and then lock up.
The rotation that I am looking for is on the order of 1e-5 rad/second, so .5 isn't cutting it.
This doesn't seem like it should be a problem. Am I doing something wrong? Does anyone have any suggestions on how I could get this to work?
Thanks!
Small Angular Velocities
-
- Posts: 169
- Joined: Sun Jan 14, 2007 7:56 pm
- Location: Norway
Re: Small Angular Velocities
The rigid body goes to sleep because the angular velocity is lower than the default limit which is 1.0.
You can either lower this limit, see btRigidBody::setSleepingThresholds(btScalar linear,btScalar angular), try setting angular to something less than your angular velocity.
Or, disable deactivation for this object completely, use body->setActivationState(DISABLE_DEACTIVATION). This is probably what you want in this case.
Cheers,
Ola
You can either lower this limit, see btRigidBody::setSleepingThresholds(btScalar linear,btScalar angular), try setting angular to something less than your angular velocity.
Or, disable deactivation for this object completely, use body->setActivationState(DISABLE_DEACTIVATION). This is probably what you want in this case.
Cheers,
Ola
-
- Posts: 2
- Joined: Fri Oct 16, 2009 12:46 am
Re: Small Angular Velocities
That was it, thank you.
Is there any good resource that I could look to for answers to questions like this? I looked around, but I haven't found much aside from this forum.
Is there any good resource that I could look to for answers to questions like this? I looked around, but I haven't found much aside from this forum.