MultiThreadedDemo: make the ground a kinematic object that can shake

This commit is contained in:
Lunkhound
2016-12-19 20:58:36 -08:00
parent e71560a2ee
commit a10244e1ab
2 changed files with 67 additions and 6 deletions

View File

@@ -406,6 +406,17 @@ struct CommonRigidBodyMTBase : public CommonExampleInterface
return body;
}
btRigidBody* createKinematicBody(const btTransform& startTransform, btCollisionShape* shape)
{
btAssert( ( !shape || shape->getShapeType() != INVALID_SHAPE_PROXYTYPE ) );
btRigidBody* body = new btRigidBody( 0.0f, NULL, shape );
body->setWorldTransform( startTransform );
body->setCollisionFlags( body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT );
body->setUserIndex( -1 );
m_dynamicsWorld->addRigidBody( body );
return body;
}
virtual void renderScene()