Add curved corners

This commit is contained in:
Miloslav Ciz 2024-12-12 23:17:06 +01:00
parent 485b09ccbc
commit 93cc5369bd
4 changed files with 79 additions and 5 deletions

View file

@ -205,6 +205,40 @@ TPE_Vec3 _LCR_racingBlockEnvFunc(TPE_Vec3 point, const uint8_t *block)
break;
}
case LCR_BLOCK_CORNER_CONVEX:
case LCR_BLOCK_CORNER_CONCAVE:
{
TPE_Unit sides[6];
sides[0] = -1 * LCR_PHYSICS_UNIT / 2;
sides[1] = LCR_PHYSICS_UNIT / 2;
sides[2] = -1 * LCR_PHYSICS_UNIT / 2;
sides[3] = -1 * LCR_PHYSICS_UNIT / 2;
sides[4] = LCR_PHYSICS_UNIT / 5;
sides[5] = -1 * LCR_PHYSICS_UNIT / 5;
if (block[0] == LCR_BLOCK_CORNER_CONCAVE)
{
sides[4] *= -1;
sides[5] *= -1;
}
_CHECK_NEXT(TPE_envAATriPrism(point,TPE_vec3(0,0,0),sides,LCR_PHYSICS_UNIT / 2
,1));
sides[2] = sides[4];
sides[3] = sides[5];
sides[4] = LCR_PHYSICS_UNIT / 2;
sides[5] = LCR_PHYSICS_UNIT / 2;
_CHECK_NEXT(TPE_envAATriPrism(point,TPE_vec3(0,0,0),sides,LCR_PHYSICS_UNIT / 2
,1));
point = vBest;
break;
}
#undef _CHECK_NEXT
case LCR_BLOCK_RAMP_CORNER:
@ -434,8 +468,6 @@ TPE_Vec3 _LCR_racingEnvironmentFunction(TPE_Vec3 point, TPE_Unit maxDist)
TPE_ENV_END
}
LCR_GameUnit LCR_racingGetCarSpeedUnsigned(void)
{
return LCR_racing.carSpeed >= 0 ? LCR_racing.carSpeed :