Kinematic Objects

theoneproph3t
Posts: 2
Joined: Fri Feb 02, 2007 3:46 am

Kinematic Objects

Post by theoneproph3t »

I am trying to make the objects created in the Bullet/Irrlicht demo kinematic. When I do so, the objects don't move, and they spawn in a different spot in the world.

Code for the rigid body:

Code: Select all

m_pMotionState = new MyMotionState(trans);
	m_pRigidBody = new btRigidBody(m_Mass,m_pMotionState,m_pCollisionObject->m_pShape,localInertia,linearDamping,angularDamping,friction,restitution);
	m_pRigidBody->setCollisionFlags( m_pRigidBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
	m_pRigidBody->setActivationState(DISABLE_DEACTIVATION);
	pDynamicsWorld->addRigidBody(m_pRigidBody);
Any ideas?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Kinematic Objects

Post by Erwin Coumans »

Not sure what is happening, but please check out the CcdPhysicsDemo. Enable the #define USE_KINEMATIC_GROUND, and check if that works. From there compare your setup in Irrlicht.

Hope this helps,
Erwin

theoneproph3t wrote:I am trying to make the objects created in the Bullet/Irrlicht demo kinematic. When I do so, the objects don't move, and they spawn in a different spot in the world.

Code for the rigid body:

Code: Select all

m_pMotionState = new MyMotionState(trans);
	m_pRigidBody = new btRigidBody(m_Mass,m_pMotionState,m_pCollisionObject->m_pShape,localInertia,linearDamping,angularDamping,friction,restitution);
	m_pRigidBody->setCollisionFlags( m_pRigidBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
	m_pRigidBody->setActivationState(DISABLE_DEACTIVATION);
	pDynamicsWorld->addRigidBody(m_pRigidBody);
Any ideas?