Page 1 of 1

[SOLVED] Object does not move after a period of time

Posted: Thu Oct 01, 2009 10:29 pm
by Fred_FS
I have a strange problem. If I am moving my object all the time, everything works well.
But if I don't move my object for a short period of time, it seems to be sticking in the other objects and is not movable anymore.
But now I tried to disable gravity and disable the collision response and I still got the same problem.
So do you know, what could be wrong with it?

Here some code:

Code: Select all

// update the physics world
physics_world_->stepSimulation( game_env_.render_time, 10);

Code: Select all

// move the player
		force_.normalise();
		rolling_force_.normalise();

		force_ *= force_strength_ * game_env_.render_time;
		rolling_force_ *= force_strength_ * game_env_.render_time;

		body_->applyCentralForce( BtOgre::Convert::toBullet(force_) );
		body_->applyTorque( BtOgre::Convert::toBullet( rolling_force_ ) ); 

		force_ = Ogre::Vector3::ZERO;
		rolling_force_ = Ogre::Vector3::ZERO;

		need_update_ = false;
I really hope you can help me, because I do not know what could be wrong.

Re: Object does not move after a period of time

Posted: Fri Oct 02, 2009 9:21 am
by nigul
Hello,

maybe you could try to disable deactivation for your objects. Objects are indeed deactivated after a certain amount of time with no interaction (from what I understood from Bullet).

just try this :

body_->setActivationState(DISABLE_DEACTIVATION);

when creating your object.

Re: Object does not move after a period of time

Posted: Sun Oct 04, 2009 9:13 pm
by Fred_FS
Ah thank you! Now it's working.