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?
[solved] btHingeConstraint activation state
-
- Posts: 10
- Joined: Fri Oct 28, 2011 5:14 am
[solved] btHingeConstraint activation state
Last edited by Bigpet on Wed Nov 02, 2011 5:09 am, edited 1 time in total.
-
- Posts: 52
- Joined: Wed Sep 28, 2011 8:36 am
- Location: France
Re: btHingeConstraint activation state
You can configure your rigid body to never deactivate by adding a flag like this:
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(DISABLE_DEACTIVATION);
Code: Select all
myRigidBody->setActivationState(ACTIVE_TAG);
-
- Posts: 10
- Joined: Fri Oct 28, 2011 5:14 am
Re: btHingeConstraint activation state
thanks, that worked alright, except that is has to be:
otherwise the value won't change as long as DISABLE_DEACTIVATION is set.
Code: Select all
myRigidBody->forceActivationState(ACTIVE_TAG);
-
- Posts: 52
- Joined: Wed Sep 28, 2011 8:36 am
- Location: France
Re: btHingeConstraint activation state
I thought that was the pointBigpet wrote: otherwise the value won't change as long as DISABLE_DEACTIVATION is set.

-
- Posts: 10
- Joined: Fri Oct 28, 2011 5:14 am
Re: btHingeConstraint activation state
what I mean was that
doesn't undo
but
does
Code: Select all
myRigidBody->setActivationState(ACTIVE_TAG);
Code: Select all
myRigidBody->setActivationState(DISABLE_DEACTIVATION);
Code: Select all
myRigidBody->forceActivationState(ACTIVE_TAG);