I'm having this weird problem using bullet 2.82 r2704 where getMotionState() always returns NULL.
Code: Select all
transform.setIdentity();
transform.setOrigin(btVector3(position->x, position->y, position->z));
btDefaultMotionState* myMotionState = new btDefaultMotionState(transform);
body->setMotionState(myMotionState);
if (body->getMotionState()) // this return NULL
body->getMotionState()->setWorldTransform(transform); //Code crashes here because getMotionState() is NULL
Any help is appreciated