1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +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]) if (state[SDL_SCANCODE_LEFT])
{ {
models[1].transform.rotation.y += stepRotation; 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]) else if (state[SDL_SCANCODE_RIGHT])
{ {
models[1].transform.rotation.y -= stepRotation; 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 else
models[1].transform.rotation.z = (models[1].transform.rotation.z * 3) / 4; models[1].transform.rotation.z = (models[1].transform.rotation.z * 3) / 4;