i'm writting simple character controller, i'm using ConstraintWorldPoint to move it (i had no better ideas), and movement works great, but i have problem with orientation
I want my character model to stand up-right so in every UpdateController() i have:
_body.Orientation = Matrix.Identity;
it works, but… now i want to write sth like this:
if (Keyboard.GetState().IsKeyDown(Keys.M)) _body.Orientation *= Matrix.CreateRotationY(1.1f);
but ofc it doesn't work cause orientation matrix is set to Identity right after this, so how can i extract RotationZ and rotationX from orientation matrix and set it to 0 instead of overwrite whole matrix?