apply(Central)Force/Impulse not always working ...

Post Reply
shogun
Posts: 34
Joined: Tue Mar 04, 2008 3:16 pm

apply(Central)Force/Impulse not always working ...

Post by shogun »

Hallo,

I experienced that the call of applyCentralForce or applyForce or applyCentralImpulse or applyImpulse sometimes doesn't have an effect. This (lacking) behaviour doesn't seem to have a logical reason, so I'm asking here: Anyone ever experienced that too?

This is how I initialise Bullet and the world (it's pretty small):

Code: Select all

	m_collisionConfiguration = new btDefaultCollisionConfiguration();
	m_overlappingPairCache = new btAxisSweep3(btPoint3(-100, -50, -100), btPoint3(100, 100, 100), 10000);
	m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
	m_solver = new btSequentialImpulseConstraintSolver();
	m_solver->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_CACHE_FRIENDLY);

	m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher, m_overlappingPairCache, m_solver, m_collisionConfiguration);
And this is (for example) how I apply a force to an object:

Code: Select all

	m_body->activate(true);
	m_body->applyForce(direction*50000.0f, hitPoint);
Regards,
shogun
User avatar
mirat
Posts: 16
Joined: Thu May 29, 2008 10:47 am

Re: apply(Central)Force/Impulse not always working ...

Post by mirat »

I have the same problem: applyImpulse doesn't do anything after some moment of time when object's velocity is near the zero. Before that object responds correctly, but then it freezes and starts to "tremble". Very strange :-/

[added]
Also, object can be switched to normal state by impacting with other object.

I use ogrebullet binding and its standard initialization.
User avatar
mirat
Posts: 16
Joined: Thu May 29, 2008 10:47 am

Re: apply(Central)Force/Impulse not always working ...

Post by mirat »

"When nothing helps, read the manual" :)

My problem was in that RigidBody was deactivated.
shogun
Posts: 34
Joined: Tue Mar 04, 2008 3:16 pm

Re: apply(Central)Force/Impulse not always working ...

Post by shogun »

I _do_ activate the object with m_body->activate(true); ...
Frederic-Felix
Posts: 5
Joined: Tue Feb 05, 2008 8:01 am

Re: apply(Central)Force/Impulse not always working ...

Post by Frederic-Felix »

Same problem here...

My body is also active and shows no response to applyForce(...)

Maybe this helps to find the error source:
My body gets a call to applyForce on impact with another body. Maybe the contact causes this error.

Greetings Frederic-Felix
jayakrishnan1236
Posts: 1
Joined: Wed Sep 07, 2016 7:29 am

Re: apply(Central)Force/Impulse not always working ...

Post by jayakrishnan1236 »

Thank you mirat !!! that helped me :)
Post Reply