As with most, I am very new to Bullet Physics (actually just downloaded it and integrated this past Thursday) and have been working on getting it to work as desired.
My issue comes with the strafing of my Character Controller.
I can get my controller to properly rotate however when I want to strafe that's where things get funky.
When I rotate my character I use the following code:
Code: Select all
btQuaternion rot = m_pCharacter->getGhostObject()->getWorldTransform().getRotation();
rot *= btQuaternion(btVector3(0,1,0), btScalar(0.001f * y)); // (y is just a positive 1 or negative 1 to dictate which direction to rotate)
m_pCharacter->getGhostObject()->getWorldTransform().setRotation(rot);
after I rotate I use the following code:
Code: Select all
float rotY = m_pCharacter->getGhostObject()->getWorldTransform().getRotation().getAngle();
If I go clockwise starting at 0.000, this time y = -1 rotY goes from 0.0 -> up to 2.19 and then jumps to 4.18 ... and then continues down from 4.18 until 0.0 is hit.
For some odd reason it seems like there is an issue with the values 4.19 -> 5.99 and I have no idea why.
My strafe code works properly until this 'patch' is hit.
If anyone has any ideas I welcome them even if just thoughts of what might be going wrong!

Thank you.