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:
parent
9c5024dcd2
commit
f0ad36004d
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue