Dear Team
i am quite new in bullet (i come from ODE) and i would like to know how to disable or enable a hinge join without having to destroy it ???
removeConstraint from the dynamic world work but is there other way?
KInd regards
david
disable /enable a join
-
- Posts: 2
- Joined: Thu Jan 03, 2013 3:36 pm
disable /enable a join
Last edited by dgu123 on Thu Jan 03, 2013 3:49 pm, edited 1 time in total.
-
- Posts: 20
- Joined: Mon Sep 24, 2007 5:45 am
Re: disable /enable a join
You can add it and remove it from the physics world using
btDynamicsWorld::addConstraint(btTypedConstraint);
btDynamicsWorld::removeConstraint(btTypedConstraint);
Or (once its added to the simulation) you can enable/disable it using
btTypedConstraint::setEnabled(bool)
btDynamicsWorld::addConstraint(btTypedConstraint);
btDynamicsWorld::removeConstraint(btTypedConstraint);
Or (once its added to the simulation) you can enable/disable it using
btTypedConstraint::setEnabled(bool)
-
- Posts: 2
- Joined: Thu Jan 03, 2013 3:36 pm
Re: disable /enable a join
thank you very much for yur help !!
regards
david
regards
david
-
- Posts: 20
- Joined: Mon Sep 24, 2007 5:45 am
Re: disable /enable a join
One funny about Bullet when switching from another Physics Engine is that if the btRigidBody (that the btConstraint is targeting) is not already in the physics world, when activating the constraint Bullet might crash.
So you have to add your RBs first before adding constraints to the btDynamicsWorld.
Just a heads up.
So you have to add your RBs first before adding constraints to the btDynamicsWorld.
Just a heads up.