I am calculating my strafing direction with a rotation of (0, 0, 0) with the following steps below. The resulting movement that I get is (-0.999999702, 0.0, -0.000796274282), which is close, however, given that my rotation is (0, 0, 0) I should really be getting (1.0, 0.0, 0.0). I understand why this is happening due to floating point but I don't understand how to prevent the following issue. When I apply my movement to the character, the z value will slowly drift backwards as the z is being decremented. How could I prevent something like this?
Vector3 movement;
movement.x = -sin(transform->GetRotation().x + (90.0f * (3.14f / 180)));
movement.y = 0.0f;
movement.z = -cos(transform->GetRotation().z + (90.0f * (3.14f / 180)));
plyer.Movement += ((movement * character.StrafeSpeed) * dt);