1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-20 20:29:58 +01:00

Fix car rotations

This commit is contained in:
Miloslav Číž 2019-06-22 04:15:10 +02:00
parent 9c5024dcd2
commit f0ad36004d

View file

@ -272,12 +272,14 @@ int main()
if (state[SDL_SCANCODE_LEFT])
{
models[1].transform.rotation.y += stepRotation;
models[1].transform.rotation.z = S3L_min(velocity / 64, models[1].transform.rotation.z + 1);
models[1].transform.rotation.z =
S3L_min(S3L_abs(velocity) / 64, models[1].transform.rotation.z + 1);
}
else if (state[SDL_SCANCODE_RIGHT])
{
models[1].transform.rotation.y -= stepRotation;
models[1].transform.rotation.z = S3L_max(-velocity / 64, models[1].transform.rotation.z - 1);
models[1].transform.rotation.z =
S3L_max(-S3L_abs(velocity) / 64, models[1].transform.rotation.z - 1);
}
else
models[1].transform.rotation.z = (models[1].transform.rotation.z * 3) / 4;