I've recently implemented a character controller, using the code from the Bullet charctercontroller demo.
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:
btMatrix3x3 orn = mGhostObject->getWorldTransform().getBasis();
orn *= btMatrix3x3(btQuaternion(btVector3(0,1,0), dt * 1.57f));
If i change the rotation to negative (e.g. by multiplying by -1.57f), the move-circle will change its direction, but also the collisionshape's rotation. So i don't manage to have the collisionshape rotate the same direction as the move-circle. But it should, in order to face the direction of the actual movement.
I can't figure out what i'm doing wrong, respectively how to change it to work right. Any ideas?