So I need to get an angle to wrap around. I also need to have 4 directions so that my game updates the graphics displayed in a logical way. I have an angle of movement that is supposed to go from 0 to 90 and stop. I also notice when I try to do this in code I get a flash of some other frame.
I am working with some code that did work before I tried this.
This is the relevant code:
if (mosig == mleft || mosig == mright) {
movement += deltaTime * 45;
if (movement >= 90) {
mosig = stopped;
if (mosig == mleft) {
direction = (direction + 3) % 4;
}
else {
direction = (direction + 1) % 4;
}
movement = 0;
}
if (mosig == mleft) {
iyaw -= movement;
}
else {
iyaw += movement;
}
}
iyaw = fmod(iyaw, 360);
fpsCamera.mYaw = glm::radians(iyaw);
fpsCamera.updateCameraVectors();