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

Update city

This commit is contained in:
Miloslav Číž 2019-06-22 04:38:57 +02:00
parent f0ad36004d
commit 4cce0d9eda
2 changed files with 5305 additions and 5311 deletions

View file

@ -219,7 +219,7 @@ int main()
S3L_initVec4(&carDirection);
scene.camera.transform.translation.y = (3 * S3L_FRACTIONS_PER_UNIT) / 5;
scene.camera.transform.translation.y = S3L_FRACTIONS_PER_UNIT / 2;
scene.camera.transform.rotation.x = -S3L_FRACTIONS_PER_UNIT / 16;
int16_t velocity = 0;
@ -312,11 +312,13 @@ int main()
}
else if (coll == 2)
{
// teleport the car
models[1].transform.translation.x += 5 * S3L_FRACTIONS_PER_UNIT;
models[1].transform.translation.z += 2 * S3L_FRACTIONS_PER_UNIT;
}
else
{
// teleport the car
models[1].transform.translation.x -= 5 * S3L_FRACTIONS_PER_UNIT;
models[1].transform.translation.z -= 2 * S3L_FRACTIONS_PER_UNIT;
}
@ -328,7 +330,7 @@ int main()
velocity = S3L_min(0,velocity + stepFriction * friction);
S3L_Unit cameraDistance =
S3L_interpolate(S3L_FRACTIONS_PER_UNIT / 2,S3L_FRACTIONS_PER_UNIT,S3L_abs(velocity),MAX_VELOCITY);
S3L_interpolate(S3L_FRACTIONS_PER_UNIT / 2,(3 * S3L_FRACTIONS_PER_UNIT) / 4,S3L_abs(velocity),MAX_VELOCITY);
scene.camera.transform.translation.x =
scene.models[1].transform.translation.x - (carDirection.x * cameraDistance) / S3L_FRACTIONS_PER_UNIT;

File diff suppressed because it is too large Load diff