Yet there's a somewhat strange problem:
The character has a speed and a rotation. When hitting the forward key it moves forward, when hitting the left key, it rotates left. When hitting both, forward and left, it will move a circle, i'll call it move-circle, finally arriving at the same position where it started.
It will do this move-circle in a counter-clockwise direction, when i hit the left key while moving forward. But the collisionshape rotates clockwise. And vice-versa, if i hit forward and right, the move-circle will be clockwise, as intended, but the collisionshape will rotate counter-clockwise. So basically the ghostobject and the collisionshape rotate in two different directions instead the same. This only applies to rotation, the position is correct.
The rotation is done with only this three lines of code, so actually only rotates the ghostobject:
Code: Select all
btMatrix3x3 orn = mGhostObject->getWorldTransform().getBasis();
orn *= btMatrix3x3(btQuaternion(btVector3(0,1,0), dt * 1.57f));
mGhostObject->getWorldTransform ().setBasis(orn);
I can't figure out what i'm doing wrong, respectively how to change it to work right. Any ideas?
Thanks
whisp