I'm working in a small game using Ogre as a Render Engine, and i integrate OgreBullet.
I have several doubts about how to use it:
At this moment all what i need is, a lot of static objets (but maybe i want to move them oportunally) and all of them don't need to collide between them.
And several kinematic objects (objetcs like the player or enemies controlled by the logic of my game).
I define static objetcs with a shape, and a rigidBody->setStaticShape method.
And i define my kinematic objects like this:
Code: Select all
defaultBody->setShape(playerEntity->getOgreEntity()->getParentSceneNode(), sceneCubeShape, gDynamicBodyRestitution, gDynamicBodyFriction, gDynamicBodyMass, pos);
defaultBody->getBulletRigidBody()->setUserPointer(this);
defaultBody->getBulletRigidBody()->setCollisionFlags( defaultBody->getBulletRigidBody()->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
defaultBody->getBulletRigidBody()->setActivationState(DISABLE_DEACTIVATION);
Using this configuration, when i try to apply a linearVelocity to my player it doesn't move, but if i teleport it (with setPosition), it moves right and collide with the static objects.
Some one can explin me what i'm doing bad, or if there are a better way to do what i need?
Thanks a lot in advance, i'm really a noob with physics and i'm with this a lot of time :S
PD: Sorry about my poor english