Mods physics and maps again

This commit is contained in:
Miloslav Ciz 2025-04-29 20:18:55 +02:00
parent d6f483038d
commit cbf4e7e8f5
3 changed files with 33 additions and 32 deletions

View file

@ -1285,18 +1285,24 @@ uint32_t LCR_racingStep(unsigned int input)
{
LCR_LOG2("air brake");
for (int i = 0; i < LCR_CAR_JOINTS - 1; ++i)
for (int j = 0; j < 3; ++j)
LCR_racing.carBody.joints[i].velocity[j] =
LCR_racing.carBody.joints[LCR_CAR_JOINTS - 1].velocity[j];
LCR_racing.carBody.jointCount--; // exclude roof (may be unsqueezing)
TPE_Vec3 linVel = TPE_bodyGetLinearVelocity(&LCR_racing.carBody);
LCR_racing.carBody.jointCount++;
for (int i = 0; i < LCR_CAR_JOINTS - 1; ++i) // exclude roof again
{
LCR_racing.carBody.joints[i].velocity[0] = linVel.x;
LCR_racing.carBody.joints[i].velocity[1] = linVel.y;
LCR_racing.carBody.joints[i].velocity[2] = linVel.z;
}
// gradual slowing down mid-air:
LCR_racing.carBody.joints[4].velocity[0] =
15 * (LCR_racing.carBody.joints[4].velocity[0] / 16);
15 * (LCR_racing.carBody.joints[LCR_CAR_JOINTS - 1].velocity[0] / 16);
LCR_racing.carBody.joints[4].velocity[2] =
15 * (LCR_racing.carBody.joints[4].velocity[2] / 16);
15 * (LCR_racing.carBody.joints[LCR_CAR_JOINTS - 1].velocity[2] / 16);
}
if (input & (LCR_RACING_INPUT_FORW | LCR_RACING_INPUT_BACK))