Simple rotation problem - locking up - SOLVED

sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Simple rotation problem - locking up - SOLVED

Post by sipickles »

Beware, Bullet newbie alert!

I've placed a btRigidBody in a btDiscreteDynamics world as per basic demo.

I am using btRigidBody->applyTorque() to perform simple rotation of the rigid body in two axes, X and Y (Y is vertical).

This works fine, then occasionally the object will suddenly stop rotating and will no longer respond to applyTorque.

Removing the object from the world and recreating it causes it to respond for a while before locking again. It appears to happen when the object is nearly stopped rotating. I tried setting the deactivation time of the rigid body to 0, but this has no effect.

Can any bullet masters suggest a possible cause?

Many Thanks

Simon
Last edited by sipickles on Tue Sep 02, 2008 8:03 am, edited 1 time in total.
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Simple rotation problem - locking up

Post by sparkprime »

deactivation still seems like the most likely cause, you can set the linear and angular sleep thresholds to 0 as well? you can also directly disable deactivation on a per-rigid body basis but i can't remember how.

Alternatively you can activate() it whenever you apply a force/torque.
sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Re: Simple rotation problem - locking up

Post by sipickles »

sparkprime wrote: Alternatively you can activate() it whenever you apply a force/torque.
Thanks, this cured it. It still stops but responds to new commands now.

I'll play with the sleep thresholds too.
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Simple rotation problem - locking up

Post by sparkprime »

I think when you said "I tried setting the deactivation time of the rigid body to 0" you were setting the counter that records how long the rigid body has been below the sleep threshold for. When this value exceeds gDeactivationTime (or something like that) the body sleeps.