Jump to content
  • Advertisement
Sign in to follow this  
benconradcurley

rigidbodies activation state

This topic is 3079 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently having a problem with rigid bodies and activation, more specifically they don't appear to deactivate when they come to rest. I am under the assumption that dynamic rigid bodies when they go below a threshold for linear and angular velocities they become inactive in respect to the simulation by default is this correct? If not could someone please enlighten me. Any ways here how I currently setup the physics world. Using Bullet 2.75 * btDefaultCollisionConfiguration * btCollisionDispatcher constructed with the above configuration. * bytDbvtBroadphase * btSequentialImpulseConstraintsSolver for the solver * and they dynamics world is btDiscreteDynamicsWorld. World units are unchanged. I construct rigid bodies like so where shape is collision Object.
	btVector3 localInertia(0.0f, 0.0f, 0.0f);
	if(mass > 0.0f)
	{
			shape->calculateLocalInertia(mass, localInertia);
	}
	//set the initial position of the body from the actor
	ActorMotionState* const myMotionState = FE_NEW ActorMotionState(actor->VGetMat());

	btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, shape, localInertia);

	//setup material properties
	rbInfo.m_restitution = PhysicalProperties::GetMaterial(mat).m_restitution;
	rbInfo.m_friction = PhysicalProperties::GetMaterial(mat).m_friction;
	
	//create rigidbody and add it to the world.
	btRigidBody* const body = new btRigidBody(rbInfo); 
	m_dynamicsWorld->addRigidBody(body);

	body->setActivationState(ISLAND_SLEEPING);
Now I have checked the rigid body for linear and angular sleep thresholds are set (0.8 and 0.1) respectively I also drawn the debug mesh which depending on the colour represents the activation state. Green for island sleep and white if its active tag. The image attached shows the floor (which is a rigid body with 0 mass as green) but the all the other object remain white and no mater how still they are never sleep. Am I missing something? Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!