Adjust some stuff

This commit is contained in:
Miloslav Ciz 2024-09-20 15:22:18 +02:00
parent 4b9b6ad8ae
commit b181256e58
8 changed files with 595 additions and 578 deletions

View file

@ -149,8 +149,10 @@ void LCR_racingInit(void)
void LCR_racingGetCarTransform(LCR_GameUnit position[3],
LCR_GameUnit rotation[3], LCR_GameUnit interpolationParam)
{
TPE_Vec3 v;
#if LCR_SETTING_SMOOTH_ANIMATIONS
TPE_Vec3 v = TPE_vec3Plus(
v = TPE_vec3Plus(
LCR_racing.carPositions[1],
_LCR_TPE_vec3DividePlain(
TPE_vec3TimesPlain(
@ -162,8 +164,6 @@ void LCR_racingGetCarTransform(LCR_GameUnit position[3],
position[1] = v.y;
position[2] = v.z;
#else
TPE_Vec3 v;
position[0] = LCR_racing.carPositions[0].x;
position[1] = LCR_racing.carPositions[0].y;
position[2] = LCR_racing.carPositions[0].z;
@ -305,7 +305,7 @@ void LCR_racingStep(unsigned int input)
TPE_Unit steer =
(LCR_racing.wheelSteer * TPE_F) / LCR_GAME_UNIT;
ja = TPE_vec3Normalized(
TPE_vec3Plus(TPE_vec3Times(carForw,steer),carRight));
}
@ -347,20 +347,28 @@ void LCR_racingStep(unsigned int input)
TPE_Vec3 tmpVec = LCR_racing.carPositions[0];
LCR_racing.carPositions[0] =
_LCR_TPE_vec3DividePlain(
TPE_vec3TimesPlain(
LCR_racing.carBody.joints[4].position,LCR_GAME_UNIT),
LCR_PHYSICS_UNIT);
TPE_vec3Plus(
TPE_vec3Plus(
LCR_racing.carBody.joints[0].position,
LCR_racing.carBody.joints[1].position),
TPE_vec3Plus(
LCR_racing.carBody.joints[2].position,
LCR_racing.carBody.joints[3].position)
),LCR_GAME_UNIT),
4 * LCR_PHYSICS_UNIT);
LCR_racing.carPositions[0] =
TPE_vec3KeepWithinBox(
LCR_racing.carPositions[1],
LCR_racing.carPositions[0],
TPE_vec3(
LCR_PHYSICS_UNIT / 50, // TODO: constant
LCR_PHYSICS_UNIT / 50,
LCR_PHYSICS_UNIT / 50
LCR_PHYSICS_UNIT / 64, // TODO: constant
LCR_PHYSICS_UNIT / 64,
LCR_PHYSICS_UNIT / 64
)
);