[solved] btHingeConstraint activation state

Bigpet
Posts: 10
Joined: Fri Oct 28, 2011 5:14 am

[solved] btHingeConstraint activation state

Post by Bigpet »

So, I have a little problem with btHingeConstraint. When I use set enableAngularMotor() or enableMotor() then the rigid bodys that the constraint connects move but after a while they get deactivated and only continue their motion after they get activated by either a collision or a call to activate().

here's a little demonstration of the effect. Just watch the beginning and the end to observe the effect:
http://www.youtube.com/watch?v=TiZh9v3BRNM

should I use some other type of constraint or do I just have to suck it up and add an Action that calls activate() on all rigid bodys in contraints that have active motors?
Last edited by Bigpet on Wed Nov 02, 2011 5:09 am, edited 1 time in total.
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: btHingeConstraint activation state

Post by Yann »

You can configure your rigid body to never deactivate by adding a flag like this:

Code: Select all

myRigidBody->setActivationState(DISABLE_DEACTIVATION);
Just do it on bodies when you activate the motors, and undo it when you deactivate the motors like this:

Code: Select all

myRigidBody->setActivationState(ACTIVE_TAG);
Bigpet
Posts: 10
Joined: Fri Oct 28, 2011 5:14 am

Re: btHingeConstraint activation state

Post by Bigpet »

thanks, that worked alright, except that is has to be:

Code: Select all

myRigidBody->forceActivationState(ACTIVE_TAG);
otherwise the value won't change as long as DISABLE_DEACTIVATION is set.
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: btHingeConstraint activation state

Post by Yann »

Bigpet wrote: otherwise the value won't change as long as DISABLE_DEACTIVATION is set.
I thought that was the point ;)
Bigpet
Posts: 10
Joined: Fri Oct 28, 2011 5:14 am

Re: btHingeConstraint activation state

Post by Bigpet »

what I mean was that

Code: Select all

myRigidBody->setActivationState(ACTIVE_TAG);
doesn't undo

Code: Select all

myRigidBody->setActivationState(DISABLE_DEACTIVATION);
but

Code: Select all

myRigidBody->forceActivationState(ACTIVE_TAG);
does