Physic automatic are turn off after time...

Post Reply
nadro
Posts: 17
Joined: Tue Jul 03, 2007 10:37 am

Physic automatic are turn off after time...

Post by nadro »

I'm new in Bullet Physic Engine and I have very big problem. My collisions and physic force are disabled after time:( All god work, but if I stoped my node on 1-2 seconds I don't have collision with another objects and I can't add for node "applyForce" why?
Last edited by nadro on Wed Jul 16, 2008 12:14 pm, edited 1 time in total.
Netzapper
Posts: 3
Joined: Sat Jul 07, 2007 9:55 pm

Post by Netzapper »

If one item is in contact with another, and remains motionless for some period of time (I think it's configurable), the item will be set as inactive--meaning that they aren't simulated.

To solve the effect you're seeing, you need to call yourRigidBody->activate(). This will add the rigid body back into the simulation for the next step. I simply call btRigidBody::activate() on the target after I apply forces from the game logic.

"""
void ExoActor::applyGlobalForce(Ogre::Vector3 position, Ogre::Vector3 force){
if (rigidBody == NULL){
return;
}

rigidBody->applyImpulse(ogreToBullet(force), ogreToBullet(position) - rigidBody->getCenterOfMassPosition());
rigidBody->activate(false);
}
"""
nadro
Posts: 17
Joined: Tue Jul 03, 2007 10:37 am

Post by nadro »

Thanks :) Other trick is: body3->setActivationState(DISABLE_DEACTIVATION);
Post Reply