Gizmo controller using bullet

shinyclaw
Posts: 1
Joined: Mon Oct 06, 2008 2:54 pm

Gizmo controller using bullet

Post by shinyclaw »

Hi all, I'm trying to create a simple gizmo controller - lets say, only for moving objects around the scene. AFAIK, if I have to move my rigid body manually then it should be marked as kinematic. So, after creating the rigid body I changed the collision flags:

Code: Select all

    Body->setCollisionFlags(Body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
    Body->setActivationState(DISABLE_DEACTIVATION);
Now, when I'm trying to translate it:

Code: Select all

    btTransform BTT = _Translation_X_Body->getCenterOfMassTransform();
    BTT.setOrigin(btVector3(some.x, some.y, some.z));
   _Translation_X_Body->setCenterOfMassTransform(BTT);
the body stays in place and don't move. But if I comment out

Code: Select all

    //Body->setCollisionFlags(Body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
or

Code: Select all

    //Body->setActivationState(DISABLE_DEACTIVATION);
everything works like it should...

Please, let mi know what I'm doing wrong.