Document Vehicles (#641)

* start doc collision

* fix merge

* finish rename fonction related to vehicle

* document around waypoint of vehicle

* make some modification

* make some change and rename one

* copy_ to oldPos

* doc smoke ferry and train

* some rename

* fix some renaming

* precise index

* rename a funciton

* simplify waypoint_vehicles

* change some name

* change some name

* rename move_to_point_direction

* fix some conflict

* Update code_80005FD0.c

* Update code_80005FD0.h

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875
2024-08-23 07:56:57 +02:00
committed by GitHub
parent 7025ff0ca1
commit 40f677db52
23 changed files with 550 additions and 541 deletions
+3 -3
View File
@@ -1155,8 +1155,8 @@ void spawn_course_actors(void) {
/**
* @brief Loads actor textures, course specific actor textures.
* Calls to init_course_vehicles and place_course_actors
*
* Calls to spawn_course_vehicles and place_course_actors
*
*/
void init_actors_and_load_textures(void) {
set_segment_base_addr(3, (void *) gNextFreeMemoryAddress);
@@ -1256,7 +1256,7 @@ void init_actors_and_load_textures(void) {
init_red_shell_texture();
destroy_all_actors();
spawn_course_actors();
init_course_vehicles();
spawn_course_vehicles();
}
void play_sound_before_despawn(struct Actor *actor) {
+96 -94
View File
@@ -82,7 +82,7 @@ f32 func_802AAB4C(Player *player) {
}
return D_8015F8E4;
case COURSE_DK_JUNGLE:
temp_v1 = get_section_id(player->collision.meshIndexZX) & 0xFF;
temp_v1 = get_track_section_id(player->collision.meshIndexZX) & 0xFF;
if (temp_v1 == 0xFF) {
if ((get_surface_type(player->collision.meshIndexZX) & 0xFF) == CAVE) {
return -475.0f;
@@ -496,7 +496,7 @@ s8 get_surface_type(u16 index) {
return triangle->surfaceType;
}
s16 get_section_id(u16 index) {
s16 get_track_section_id(u16 index) {
CollisionTriangle *triangle = &gCollisionMesh[index];
return triangle->flags & 0xFF;
}
@@ -748,7 +748,7 @@ UNUSED s32 detect_tyre_collision(KartTyre *tyre) {
// depending on which (if any) if statements were entered on the loop's last cycle
}
s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 index, f32 posX, f32 posY, f32 posZ) {
s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize, f32 newX, f32 newY, f32 newZ, u16 index, f32 oldX, f32 oldY, f32 oldZ) {
CollisionTriangle *triangle = &gCollisionMesh[index];
UNUSED s32 pad;
f32 x4;
@@ -768,19 +768,19 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
f32 area3;
s32 b = 1;
if (triangle->minX > x1) {
if (triangle->minX > newX) {
return 0;
}
if (triangle->minZ > z1) {
if (triangle->minZ > newZ) {
return 0;
}
if (triangle->maxX < x1) {
if (triangle->maxX < newX) {
return 0;
}
if (triangle->maxZ < z1) {
if (triangle->maxZ < newZ) {
return 0;
}
if ((triangle->minY - boundingBoxSize * 3.0f) > y1) {
if ((triangle->minY - boundingBoxSize * 3.0f) > newY) {
return 0;
}
@@ -793,22 +793,22 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
x4 = (f32) triangle->vtx3->v.ob[0];
z4 = (f32) triangle->vtx3->v.ob[2];
area = (z2 - z1) * (x3 - x1) - (x2 - x1) * (z3 - z1);
area = (z2 - newZ) * (x3 - newX) - (x2 - newX) * (z3 - newZ);
if (area == 0) {
area2 = (z3 - z1) * (x4 - x1) - (x3 - x1) * (z4 - z1);
area3 = (z4 - z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
area2 = (z3 - newZ) * (x4 - newX) - (x3 - newX) * (z4 - newZ);
area3 = (z4 - newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
if (area2 * area3 < 0.0f) {
b = 0;
}
} else {
area2 = (z3 - z1) * (x4 - x1) - (x3 - x1) * (z4 - z1);
area2 = (z3 - newZ) * (x4 - newX) - (x3 - newX) * (z4 - newZ);
if (area2 == 0) {
area3 = (z4 - z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
area3 = (z4 - newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
if (area * area3 < 0.0f) {
b = 0;
@@ -817,7 +817,7 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
if ((area * area2) < 0.0f) {
b = 0;
} else {
area3 = (z4- z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
area3 = (z4- newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
if (area3 != 0) {
if (area2 * area3 < 0.0f) {
b = 0;
@@ -830,7 +830,7 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
return 0;
}
surfaceDistance = (triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1) + triangle->distance;
surfaceDistance = (triangle->normalX * newX) + (triangle->normalY * newY) + (triangle->normalZ * newZ) + triangle->distance;
if (surfaceDistance > boundingBoxSize) {
if (collision->surfaceDistance[2] > surfaceDistance) {
@@ -844,25 +844,26 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
return 0;
}
temp = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
temp = (triangle->normalX * oldX) + (triangle->normalY * oldY) + (triangle->normalZ * oldZ) + triangle->distance;
if (temp < 0.0f) {
return 0;
}
collision->unk34 = 1;
collision->meshIndexZX = index;
collision->surfaceDistance[2] = surfaceDistance - boundingBoxSize;
collision->orientationVector[0] = triangle->normalX;
collision->orientationVector[1] = triangle->normalY;
collision->orientationVector[2] = triangle->normalZ;
return 1;
collision->unk34 = 1;
collision->meshIndexZX = index;
collision->surfaceDistance[2] = surfaceDistance - boundingBoxSize;
collision->orientationVector[0] = triangle->normalX;
collision->orientationVector[1] = triangle->normalY;
collision->orientationVector[2] = triangle->normalZ;
return 1;
}
/**
* Wall collision
*/
s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8) {
CollisionTriangle *triangle = &gCollisionMesh[arg5];
s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) {
CollisionTriangle *triangle = &gCollisionMesh[surfaceIndex];
UNUSED s32 pad[6];
f32 x4;
f32 y4;
@@ -879,22 +880,22 @@ s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
f32 area3;
s32 b = true;
if (triangle->minX > x1) {
return 0;
return NO_COLLISION;
}
if (triangle->maxX < x1) {
return 0;
return NO_COLLISION;
}
if (triangle->maxY < y1) {
return 0;
return NO_COLLISION;
}
if (triangle->minY > y1) {
return 0;
return NO_COLLISION;
}
if ((triangle->minZ - boundingBoxSize * 3.0f) > z1) {
return 0;
return NO_COLLISION;
}
if ((triangle->maxZ + boundingBoxSize * 3.0f) < z1) {
return 0;
return NO_COLLISION;
}
x2 = (f32) triangle->vtx1->v.ob[0];
@@ -941,107 +942,108 @@ s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
}
}
}
if (!b) {
return 0;
return NO_COLLISION;
}
distanceToSurface = ((triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1)) + triangle->distance;
if (triangle->flags & 0x200) {
distanceToSurface2 = ((triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8)) + triangle->distance;
distanceToSurface2 = ((triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ)) + triangle->distance;
if ((distanceToSurface > 0.0f) && (distanceToSurface2 > 0.0f)) {
if (distanceToSurface < boundingBoxSize) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
return 1;
return COLLISION;
}
return 0;
return NO_COLLISION;
}
if ((distanceToSurface < 0.0f) && (distanceToSurface2 < 0.0f)) {
distanceToSurface *= -1.0f;
if (distanceToSurface < boundingBoxSize) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
arg->unk48[0] = -triangle->normalX;
arg->unk48[1] = -triangle->normalY;
arg->unk48[2] = -triangle->normalZ;
return 1;
}
return 0;
return NO_COLLISION;
}
if ((distanceToSurface > 0.0f) && (distanceToSurface2 < 0.0f)) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = -(distanceToSurface + boundingBoxSize);
arg->unk48[0] = -triangle->normalX;
arg->unk48[1] = -triangle->normalY;
arg->unk48[2] = -triangle->normalZ;
return 1;
return COLLISION;
}
if ((distanceToSurface < 0.0f) && (distanceToSurface2 > 0.0f)) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface + boundingBoxSize;
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
return 1;
return COLLISION;
}
if (distanceToSurface == 0.0f) {
if (distanceToSurface2 >= 0.0f) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface2 + boundingBoxSize;
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
return 1;
return COLLISION;
}
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = -(distanceToSurface2 + boundingBoxSize);
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
return 1;
return COLLISION;
}
return 0;
return NO_COLLISION;
}
if (distanceToSurface > boundingBoxSize) {
if (distanceToSurface < arg->surfaceDistance[0]) {
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
}
return 0;
return NO_COLLISION;
}
distanceToSurface2 = (triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8) + triangle->distance;
distanceToSurface2 = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
if (distanceToSurface2 < 0.0f) {
return 0;
return NO_COLLISION;
}
arg->unk30 = 1;
arg->meshIndexYX = arg5;
arg->meshIndexYX = surfaceIndex;
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
arg->unk48[0] = triangle->normalX;
arg->unk48[1] = triangle->normalY;
arg->unk48[2] = triangle->normalZ;
return 1;
return COLLISION;
}
/**
* This is actually more like colliding with face X/Y/Z
*/
s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8) {
CollisionTriangle *triangle = &gCollisionMesh[arg5];
s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) {
CollisionTriangle *triangle = &gCollisionMesh[surfaceIndex];
s32 b = 1;
UNUSED s32 pad[7];
f32 y4;
@@ -1059,22 +1061,22 @@ s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
f32 area3;
if (triangle->minZ > z1) {
return 0;
return NO_COLLISION;
}
if (triangle->maxZ < z1) {
return 0;
return NO_COLLISION;
}
if (triangle->maxY < y1) {
return 0;
return NO_COLLISION;
}
if (triangle->minY > y1) {
return 0;
return NO_COLLISION;
}
if ((triangle->minX - boundingBoxSize * 3.0f) > x1) {
return 0;
return NO_COLLISION;
}
if ((triangle->maxX + boundingBoxSize * 3.0f) < x1) {
return 0;
return NO_COLLISION;
}
z2 = (f32) triangle->vtx1->v.ob[2];
@@ -1122,103 +1124,103 @@ s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
}
}
if (b == 0) {
return 0;
return NO_COLLISION;
}
distanceToSurface = ((triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1)) + triangle->distance;
if (triangle->flags & 0x200) {
distanceToSurface2 = ((triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8)) + triangle->distance;
distanceToSurface2 = ((triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ)) + triangle->distance;
//sp48 = temp_f4_2;
if ((distanceToSurface > 0.0f) && (distanceToSurface2 > 0.0f)) {
if (distanceToSurface < boundingBoxSize) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
return 1;
return COLLISION;
}
return 0;
return NO_COLLISION;
}
if ((distanceToSurface < 0.0f) && (distanceToSurface2 < 0.0f)) {
distanceToSurface *= -1.0f;
if (distanceToSurface < boundingBoxSize) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
arg->unk54[0] = -triangle->normalX;
arg->unk54[1] = -triangle->normalY;
arg->unk54[2] = -triangle->normalZ;
return 1;
}
return 0;
return NO_COLLISION;
}
if ((distanceToSurface > 0.0f) && (distanceToSurface2 < 0.0f)) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = -(distanceToSurface + boundingBoxSize);
arg->unk54[0] = -triangle->normalX;
arg->unk54[1] = -triangle->normalY;
arg->unk54[2] = -triangle->normalZ;
return 1;
return COLLISION;
}
if ((distanceToSurface < 0.0f) && (distanceToSurface2 > 0.0f)) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface + boundingBoxSize;
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
return 1;
return COLLISION;
}
if (distanceToSurface == 0.0f) {
if (distanceToSurface2 >= 0.0f) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface2 + boundingBoxSize;
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
return 1;
return COLLISION;
}
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = -(distanceToSurface2 + boundingBoxSize);
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
return 1;
return COLLISION;
}
return 0;
return NO_COLLISION;
}
if (distanceToSurface > boundingBoxSize) {
if (arg->surfaceDistance[1] > distanceToSurface) {
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
}
return 0;
return NO_COLLISION;
}
distanceToSurface2 = (triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8) + triangle->distance;
distanceToSurface2 = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
if (distanceToSurface2 < 0.0f) {
return 0;
return NO_COLLISION;
}
arg->unk32 = 1;
arg->meshIndexZY = arg5;
arg->meshIndexZY = surfaceIndex;
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
arg->unk54[0] = triangle->normalX;
arg->unk54[1] = triangle->normalY;
arg->unk54[2] = triangle->normalZ;
return 1;
return COLLISION;
}
u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2) {
u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 newX, f32 newY, f32 newZ, f32 oldX, f32 oldY, f32 oldZ) {
s32 courseLengthX;
s32 courseLengthZ;
s16 sectionIndexX;
@@ -1244,19 +1246,19 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
// Check if an intersection test has already been performed.
if ((s32) collision->meshIndexZX < (s32) gCollisionMeshCount) {
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexZX, x2, y2, z2) == 1) {
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZX, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_Y_AXIS;
}
}
if ((s32) collision->meshIndexYX < (s32) gCollisionMeshCount) {
if (is_colliding_with_wall2(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexYX, x2, y2, z2) == 1) {
if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexYX, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_Z_AXIS;
}
}
if ((s32) collision->meshIndexZY < (s32) gCollisionMeshCount) {
if (is_colliding_with_wall1(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexZY, x2, y2, z2) == 1) {
if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZY, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_X_AXIS;
}
}
@@ -1271,9 +1273,9 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
sectionX = courseLengthX / GRID_SIZE;
sectionZ = courseLengthZ / GRID_SIZE;
sectionIndexX = (x1 - gCourseMinX) / sectionX;
sectionIndexZ = (z1 - gCourseMinZ) / sectionZ;
sectionIndexX = (newX - gCourseMinX) / sectionX;
sectionIndexZ = (newZ - gCourseMinZ) / sectionZ;
if (sectionIndexX < 0) {
return 0;
}
@@ -1306,7 +1308,7 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
if ((gCollisionMesh[collisionIndex].flags & FACING_Y_AXIS)) {
if ((flags & FACING_Y_AXIS) == 0) {
if (collisionIndex != collision->meshIndexZX) {
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_Y_AXIS;
}
}
@@ -1314,14 +1316,14 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
} else if ((gCollisionMesh[collisionIndex].flags & FACING_X_AXIS) != 0) {
if ((flags & FACING_X_AXIS) == 0) {
if (collisionIndex != collision->meshIndexZY) {
if (is_colliding_with_wall1(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_X_AXIS;
}
}
}
} else if ((flags & FACING_Z_AXIS) == 0) {
if (collisionIndex != collision->meshIndexYX) {
if (is_colliding_with_wall2(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
flags |= FACING_Z_AXIS;
}
}
@@ -2107,7 +2109,7 @@ void subtract_scaled_vector(Vec3f pos1, f32 boundingBoxSize, Vec3f pos2) {
pos2[2] -= pos1[2] * boundingBoxSize;
}
u16 process_collision(Player *player, KartTyre *tyre, f32 tyre2X, f32 tyre2Y, f32 tyre2Z) {
u16 player_terrain_collision(Player *player, KartTyre *tyre, f32 tyre2X, f32 tyre2Y, f32 tyre2Z) {
Collision wtf;
Collision *collision = &wtf;
UNUSED s32 pad;
+2 -2
View File
@@ -13,7 +13,7 @@ s32 check_collision_zx(Collision*, f32, f32, f32, f32, u16);
s32 check_collision_yx(Collision*, f32, f32, f32, f32, u16);
s32 check_collision_zy(Collision*, f32, f32, f32, f32, u16);
s8 get_surface_type(u16);
s16 get_section_id(u16);
s16 get_track_section_id(u16);
s16 func_802ABD7C(u16);
s16 func_802ABDB8(u16);
s16 func_802ABDF4(u16);
@@ -21,7 +21,7 @@ f32 calculate_surface_height(f32, f32, f32, u16);
f32 func_802ABEAC(Collision*, Vec3f);
void shell_collision(Collision *, Vec3f);
void process_shell_collision(Vec3f, f32, Vec3f, f32);
u16 process_collision(Player*, KartTyre*, f32, f32, f32);
u16 player_terrain_collision(Player*, KartTyre*, f32, f32, f32);
void adjust_pos_orthogonally(Vec3f, f32, Vec3f, f32);
s32 detect_tyre_collision(KartTyre*);
u16 actor_terrain_collision(Collision*, f32, f32, f32, f32, f32, f32, f32);
+1 -1
View File
@@ -501,7 +501,7 @@ void start_race(void) {
f32 func_8028EE8C(s32 arg0) {
f32 temp_v0 = gPlayers[arg0].pos[2];
f32 temp_v1 = gPlayers[arg0].copy_rotation_z;
f32 temp_v1 = gPlayers[arg0].oldPos[2];
f32 temp_f14 = D_8015F8D0[2] - temp_v0;
f32 temp_f16 = temp_v1 - D_8015F8D0[2];
return gCourseTimer - ((COURSE_TIMER_ITER_f * temp_f14) / (temp_f14 + temp_f16));
+3 -3
View File
@@ -116,8 +116,8 @@ void render_course_segments(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
arg1->playerDirection = var_a3;
if (D_80152300[camera - camera1] == 1) {
sp1E = get_section_id(camera->collision.meshIndexZX);
temp_v0_3 = get_section_id(player->collision.meshIndexZX);
sp1E = get_track_section_id(camera->collision.meshIndexZX);
temp_v0_3 = get_track_section_id(player->collision.meshIndexZX);
index = sp1E - temp_v0_3;
if ((index < 2) && (index >= -1)) {
if (sp1E == 255) {
@@ -170,7 +170,7 @@ void render_course_segments(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
}
}
} else {
index = get_section_id(camera->collision.meshIndexZX);
index = get_track_section_id(camera->collision.meshIndexZX);
if (camera->collision.surfaceDistance[2] > 30.0f) {
index = arg1->pathCounter;
} else if (index == 255) {