Add blocks

This commit is contained in:
Miloslav Ciz 2025-01-29 15:01:11 +01:00
parent 6986028e33
commit be11c582b1
4 changed files with 73 additions and 27 deletions

View file

@ -413,6 +413,7 @@ TPE_Vec3 _LCR_racingBlockEnvFunc(TPE_Vec3 point, const uint8_t *block)
case LCR_BLOCK_LEFT:
case LCR_BLOCK_BOTTOM_LEFT:
case LCR_BLOCK_BOTTOM_LEFT_FRONT:
case LCR_BLOCK_LEFT_FRONT:
case LCR_BLOCK_FULL_ACCEL:
case LCR_BLOCK_FULL_FAN:
{
@ -432,13 +433,15 @@ TPE_Vec3 _LCR_racingBlockEnvFunc(TPE_Vec3 point, const uint8_t *block)
if (block[0] == LCR_BLOCK_LEFT ||
block[0] == LCR_BLOCK_BOTTOM_LEFT ||
block[0] == LCR_BLOCK_BOTTOM_LEFT_FRONT)
block[0] == LCR_BLOCK_BOTTOM_LEFT_FRONT ||
block[0] == LCR_BLOCK_LEFT_FRONT)
{
offset.x -= LCR_PHYSICS_UNIT / 4;
size.x = LCR_PHYSICS_UNIT / 4;
}
if (block[0] == LCR_BLOCK_BOTTOM_LEFT_FRONT)
if (block[0] == LCR_BLOCK_BOTTOM_LEFT_FRONT ||
block[0] == LCR_BLOCK_LEFT_FRONT)
{
offset.z -= LCR_PHYSICS_UNIT / 4;
size.z = LCR_PHYSICS_UNIT / 4;
@ -535,6 +538,28 @@ TPE_Vec3 _LCR_racingBlockEnvFunc(TPE_Vec3 point, const uint8_t *block)
break;
}
case LCR_BLOCK_RAMP_12_UP:
{
TPE_Unit sides[6];
sides[0] = LCR_PHYSICS_UNIT / 2;
sides[1] = LCR_PHYSICS_UNIT / 4;
sides[2] = -1 * LCR_PHYSICS_UNIT / 2;
sides[3] = 0;
sides[4] = LCR_PHYSICS_UNIT / 2;
sides[5] = -1 * LCR_PHYSICS_UNIT / 4;
_CHECK_NEXT(TPE_envAATriPrism(point,TPE_vec3(0,0,0),sides,
LCR_PHYSICS_UNIT,2));
_CHECK_NEXT(TPE_envAABox(
point,TPE_vec3(0,-1 * LCR_PHYSICS_UNIT / 8,0),TPE_vec3(
LCR_PHYSICS_UNIT / 2,LCR_PHYSICS_UNIT / 8,LCR_PHYSICS_UNIT / 2)));
point = vBest;
break;
}
#undef _CHECK_NEXT
case LCR_BLOCK_RAMP_CORNER: