I created an object with these codes
Code: Select all
startTransform.setOrigin(btVector3(-0.2f,0.0f,0.1f));
csAvatar = new btSphereShape(btScalar(AVATAR_RADIUS));
collisionShapes.push_back(csAvatar);
//mass = AVATAR_MASS;
mass = 0;
btDefaultMotionState* msAvatar = new btDefaultMotionState(startTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,msAvatar,csAvatar,localInertia);
bbAvatar = new btRigidBody(rbInfo);
dynamicsWorld->addRigidBody(bbAvatar);
Code: Select all
btTransform trans = bbAvatar->getCenterOfMassTransform();
float a_pos[3] = {trans.getOrigin().getX(), trans.getOrigin().getY(), trans.getOrigin().getZ()};
printf("%4.2f %4.2f %4.2f \n",a_pos[0],a_pos[1],a_pos[2]);
But when i seted mass = 4, i received another position of the object (-0.2,-0.34,0.1)
Can anyone help me out?
Thanks