Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Player slowly drifting backwards when strafing

$
0
0

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 …


Viewing all articles
Browse latest Browse all 17625

Trending Articles