diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 840ea88c4..32b24029b 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -4971,7 +4971,7 @@ void func_800652D4(Vec3f arg0, Vec3s arg1, f32 arg2) { Mat4 mtx; mtxf_translate_rotate(mtx, arg0, arg1); - mtxf_scale2(mtx, arg2); + mtxf_scale(mtx, arg2); // convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), // G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -6067,7 +6067,7 @@ void render_battle_balloon(Player* player, s8 arg1, s16 arg2, s8 arg3) { sp12C[2] = D_8018D7D0[arg1][arg2] - (D_8018D860[arg1][arg2] * coss(temp_t1)) - ((D_8018D890[arg1][arg2] * 8) * sins(temp_t1)); mtxf_translate_rotate(mtx, sp134, sp12C); - mtxf_scale2(mtx, var_f20); + mtxf_scale(mtx, var_f20); // convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], sp140); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), @@ -6192,7 +6192,7 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { spF4[1] = camera1->rot[1]; spF4[2] = arg2; mtxf_translate_rotate(mtx, spFC, spF4); - mtxf_scale2(mtx, arg1); + mtxf_scale(mtx, arg1); // convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], sp108); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), // G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/math_util_2.c b/src/math_util_2.c index 174d9095e..d9770eddb 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -807,27 +807,29 @@ UNUSED void func_8004252C(Mat4 arg0, u16 arg1, u16 arg2) { arg0[2][2] = sp28 * cos_theta_y; } -void mtxf_set_matrix_transformation(Mat4 transformMatrix, Vec3f translationVector, Vec3su rotationVector, - f32 scalingFactor) { - f32 sinX = sins(rotationVector[0]); - f32 cosX = coss(rotationVector[0]); - f32 sinY = sins(rotationVector[1]); - f32 cosY = coss(rotationVector[1]); - f32 sinZ = sins(rotationVector[2]); - f32 cosZ = coss(rotationVector[2]); +void mtxf_set_matrix_transformation(Mat4 transformMatrix, Vec3f location, Vec3su rotation, + f32 scale) { - transformMatrix[0][0] = ((cosY * cosZ) + (sinX * sinY * sinZ)) * scalingFactor; - transformMatrix[1][0] = ((-cosY * sinZ) + (sinX * sinY * cosZ)) * scalingFactor; - transformMatrix[2][0] = (cosX * sinY) * scalingFactor; - transformMatrix[3][0] = translationVector[0]; - transformMatrix[0][1] = cosX * sinZ * scalingFactor; - transformMatrix[1][1] = cosX * cosZ * scalingFactor; - transformMatrix[2][1] = -sinX * scalingFactor; - transformMatrix[3][1] = translationVector[1]; - transformMatrix[0][2] = ((-sinY * cosZ) + (sinX * cosY * sinZ)) * scalingFactor; - transformMatrix[1][2] = ((sinY * sinZ) + (sinX * cosY * cosZ)) * scalingFactor; - transformMatrix[2][2] = cosX * cosY * scalingFactor; - transformMatrix[3][2] = translationVector[2]; + FrameInterpolation_RecordSetMatrixTransformation(transformMatrix, location, rotation, scale); + f32 sinX = sins(rotation[0]); + f32 cosX = coss(rotation[0]); + f32 sinY = sins(rotation[1]); + f32 cosY = coss(rotation[1]); + f32 sinZ = sins(rotation[2]); + f32 cosZ = coss(rotation[2]); + + transformMatrix[0][0] = ((cosY * cosZ) + (sinX * sinY * sinZ)) * scale; + transformMatrix[1][0] = ((-cosY * sinZ) + (sinX * sinY * cosZ)) * scale; + transformMatrix[2][0] = (cosX * sinY) * scale; + transformMatrix[3][0] = location[0]; + transformMatrix[0][1] = cosX * sinZ * scale; + transformMatrix[1][1] = cosX * cosZ * scale; + transformMatrix[2][1] = -sinX * scale; + transformMatrix[3][1] = location[1]; + transformMatrix[0][2] = ((-sinY * cosZ) + (sinX * cosY * sinZ)) * scale; + transformMatrix[1][2] = ((sinY * sinZ) + (sinX * cosY * cosZ)) * scale; + transformMatrix[2][2] = cosX * cosY * scale; + transformMatrix[3][2] = location[2]; transformMatrix[0][3] = 0.0f; transformMatrix[1][3] = 0.0f; transformMatrix[2][3] = 0.0f; @@ -919,8 +921,7 @@ void set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVect Vec3f sp38; Vec3f sp2C; - FrameInterpolation_Record_set_transform_matrix(dest, orientationVector, positionVector, rotationAngle, scaleFactor); - + FrameInterpolation_RecordSetTransformMatrix(dest, orientationVector, positionVector, rotationAngle, scaleFactor); vec3f_set_xyz(sp44, sins(rotationAngle), 0.0f, coss(rotationAngle)); vec3f_normalize(orientationVector); vec3f_cross_product(sp38, orientationVector, sp44); diff --git a/src/math_util_2.h b/src/math_util_2.h index 604e28c02..5d0837dd9 100644 --- a/src/math_util_2.h +++ b/src/math_util_2.h @@ -77,7 +77,8 @@ void func_80042330_wide(s32, s32, u16, f32); void mtxf_set_matrix_transformation(Mat4, Vec3f, Vec3su, f32); void mtxf_set_matrix_scale_transl(Mat4, Vec3f, Vec3f, f32); void mtxf_set_matrix_gObjectList(s32, Mat4); -void set_transform_matrix(Mat4, Vec3f, Vec3f, u16, f32); +void set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, + f32 scaleFactor); void vec3f_rotate_x_y(Vec3f, Vec3f, Vec3s); void rsp_set_matrix_transformation(Vec3f, Vec3su, f32); void rsp_set_matrix_transformation_inverted_x_y_orientation(Vec3f, Vec3su, f32); diff --git a/src/port/interpolation/FrameInterpolation.cpp b/src/port/interpolation/FrameInterpolation.cpp index 14f391cc6..268d323dc 100644 --- a/src/port/interpolation/FrameInterpolation.cpp +++ b/src/port/interpolation/FrameInterpolation.cpp @@ -70,7 +70,9 @@ enum class Op { MatrixToMtx, MatrixRotateAxis, SkinMatrixMtxFToMtx, - SetTransformMatrix + SetTransformMatrix, + SetMatrixTransformation, + CalculateOrientationMatrix }; typedef pair label; @@ -97,7 +99,12 @@ union Data { struct { Mat4* matrix; Vec3fInterp b; - } matrix_translate, matrix_scale; + } matrix_translate; + + struct { + Mat4* matrix; + f32 scale; + } matrix_scale; struct { Mat4* matrix; @@ -165,12 +172,27 @@ union Data { struct { Mat4* dest; - Vec3f* orientationVector; - Vec3f* positionVector; + Vec3f orientationVector; + Vec3f positionVector; u16 rotationAngle; f32 scaleFactor; } set_transform_matrix_data; + struct { + Mat4* dest; + Vec3f location; + Vec3su rotation; + f32 scale; + } set_matrix_transformation_data; + + struct { + Mat3* dest; + f32 arg1; + f32 arg2; + f32 arg3; + s16 rot; + } set_orientation_matrix_data; + struct { label key; size_t idx; @@ -219,6 +241,7 @@ struct InterpolateCtx { float w; unordered_map mtx_replacements; MtxF tmp_mtxf, tmp_mtxf2; + Mat3 tmp_mat3; Vec3f tmp_vec3f, tmp_vec3f2; Vec3s tmp_vec3s; MtxF actor_mtx; @@ -243,6 +266,12 @@ struct InterpolateCtx { return w * o + step * n; } + void lerp_vec3s(Vec3s* res, Vec3s o, Vec3s n) { + *res[0] = lerp_s16(o[0], n[0]); + *res[1] = lerp_s16(o[1], n[1]); + *res[2] = lerp_s16(o[2], n[2]); + } + void lerp_vec3f(Vec3f* res, Vec3f* o, Vec3f* n) { *res[0] = lerp(*o[0], *n[0]); *res[1] = lerp(*o[1], *n[1]); @@ -388,10 +417,7 @@ struct InterpolateCtx { break; case Op::MatrixScale: - // Matrix_Scale(gInterpolationMatrix, lerp(old_op.matrix_scale.x, new_op.matrix_scale.x), - // lerp(old_op.matrix_scale.y, new_op.matrix_scale.y), - // lerp(old_op.matrix_scale.z, new_op.matrix_scale.z), - // new_op.matrix_scale.mode); + mtxf_scale(*gInterpolationMatrix, lerp(old_op.matrix_scale.scale, new_op.matrix_scale.scale)); break; case Op::MatrixRotate1Coord: { @@ -457,11 +483,11 @@ struct InterpolateCtx { } case Op::SetTransformMatrix: { - lerp_vec3f(&tmp_vec3f, &old_op.set_transform_matrix_data.orientationVector[0], - &new_op.set_transform_matrix_data.orientationVector[0]); + lerp_vec3f(&tmp_vec3f, &old_op.set_transform_matrix_data.orientationVector, + &new_op.set_transform_matrix_data.orientationVector); - lerp_vec3f(&tmp_vec3f2, &old_op.set_transform_matrix_data.positionVector[0], - &new_op.set_transform_matrix_data.positionVector[0]); + lerp_vec3f(&tmp_vec3f2, &old_op.set_transform_matrix_data.positionVector, + &new_op.set_transform_matrix_data.positionVector); u16 rotationAngleTemp = lerp_s16(old_op.set_transform_matrix_data.rotationAngle, new_op.set_transform_matrix_data.rotationAngle); @@ -471,6 +497,27 @@ struct InterpolateCtx { break; } + + case Op::SetMatrixTransformation: { + + lerp_vec3f(&tmp_vec3f, &old_op.set_matrix_transformation_data.location, + &new_op.set_matrix_transformation_data.location); + + lerp_vec3s(&tmp_vec3s, *(Vec3s*)&old_op.set_matrix_transformation_data.rotation, + *(Vec3s*)&new_op.set_matrix_transformation_data.rotation); + + f32 scaleFactorTemp = lerp(old_op.set_matrix_transformation_data.scale, new_op.set_matrix_transformation_data.scale); + + mtxf_set_matrix_transformation(*gInterpolationMatrix, tmp_vec3f, *(Vec3su*)&tmp_vec3s, scaleFactorTemp); + break; + } + + case Op::CalculateOrientationMatrix: { + + + calculate_orientation_matrix(* tmp_mat3); + break; + } } } } @@ -588,10 +635,10 @@ void FrameInterpolation_RecordMatrixTranslate(Mat4* matrix, Vec3f b) { append(Op::MatrixTranslate).matrix_translate = { matrix, *((Vec3fInterp*) &b) }; } -void FrameInterpolation_RecordMatrixScale(Mat4* matrix, f32 x, f32 y, f32 z, u8 mode) { +void FrameInterpolation_RecordMatrixScale(Mat4* matrix, f32 scale) { if (!is_recording) return; - // append(Op::MatrixScale).matrix_scale = { matrix, x, y, z, mode }; + append(Op::MatrixScale).matrix_scale = { matrix, scale }; } void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Mat4* matrix, Vec3f src, Vec3f dest) { @@ -600,11 +647,24 @@ void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Mat4* matrix, Vec3f src // append(Op::MatrixMultVec3fNoTranslate).matrix_vec_no_translate = { matrix, src, dest }; } -void FrameInterpolation_Record_set_transform_matrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, +void FrameInterpolation_RecordSetTransformMatrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, f32 scaleFactor) { if (!is_recording) return; - append(Op::SetTransformMatrix).set_transform_matrix_data = { dest, (Vec3f*)&orientationVector[0], (Vec3f*)&positionVector[0], rotationAngle, scaleFactor}; + append(Op::SetTransformMatrix).set_transform_matrix_data = { dest, {orientationVector[0], orientationVector[1], orientationVector[2]}, { positionVector[0], positionVector[1], positionVector[2] }, rotationAngle, scaleFactor}; +} + + +void FrameInterpolation_RecordSetMatrixTransformation(Mat4* dest, Vec3f location, Vec3su rotation, f32 scale) { + if (!is_recording) + return; + append(Op::SetMatrixTransformation).set_matrix_transformation_data = { dest, {location[0], location[1], location[2]}, { rotation[0], rotation[1], rotation[2] }, scale}; +} + +void FrameInterpolation_RecordCalculateOrientationMatrix(Mat3* dest, f32 x, f32 y, f32 z, s16 rot) { + if (!is_recording) return; + + append(Op::SetMatrixTransformation).set_calculate_orientation_matrix_data = { dest, x, y, z, rot}; } // Make a template for deref diff --git a/src/port/interpolation/FrameInterpolation.h b/src/port/interpolation/FrameInterpolation.h index a70f3e7b0..bd544f621 100644 --- a/src/port/interpolation/FrameInterpolation.h +++ b/src/port/interpolation/FrameInterpolation.h @@ -49,7 +49,7 @@ void FrameInterpolation_RecordMatrixPop(Mat4* matrix); void FrameInterpolation_RecordMatrixTranslate(Mat4* matrix, Vec3f b); -//void FrameInterpolation_RecordMatrixScale(Matrix* matrix, f32 x, f32 y, f32 z, u8 mode); +void FrameInterpolation_RecordMatrixScale(Mat4* matrix, f32 scale); void FrameInterpolation_RecordMatrixRotate1Coord(Mat4* matrix, u32 coord, s16 value); @@ -67,9 +67,13 @@ void FrameInterpolation_RecordSkinMatrixMtxFToMtx(MtxF* src, Mtx* dest); //void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Matrix* matrix, Vec3f src, Vec3f dest); -void FrameInterpolation_Record_set_transform_matrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, +void FrameInterpolation_RecordSetTransformMatrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, f32 scaleFactor); +void FrameInterpolation_RecordSetMatrixTransformation(Mat4* dest, Vec3f location, Vec3su rotation, f32 scale); + +void FrameInterpolation_RecordCalculateOrientationMatrix(Mat3*, f32, f32, f32, s16); + #ifdef __cplusplus } #endif diff --git a/src/racing/math_util.c b/src/racing/math_util.c index 1fb975048..5c099dda7 100644 --- a/src/racing/math_util.c +++ b/src/racing/math_util.c @@ -391,39 +391,6 @@ void mtxf_s16_rotate_z(Mat4 mat, s16 angle) { */ } -void func_802B5B14(Vec3f b, Vec3s rotate) { - Mat4 mtx; - Vec3f copy; - - f32 sx = sins(rotate[0]); - f32 cx = coss(rotate[0]); - - f32 sy = sins(rotate[1]); - f32 cy = coss(rotate[1]); - - f32 sz = sins(rotate[2]); - f32 cz = coss(rotate[2]); - - copy[0] = b[0]; - copy[1] = b[1]; - - mtx[0][0] = cy * cz + sx * sy * sz; - mtx[1][0] = -cy * sz + sx * sy * cz; - mtx[2][0] = cx * sy; - - mtx[0][1] = cx * sz; - mtx[1][1] = cx * cz; - mtx[2][1] = -sx; - - mtx[0][2] = -sy * cz + sx * cy * sz; - mtx[1][2] = sy * sz + sx * cy * cz; - mtx[2][2] = cx * cy; - - b[0] = copy[0] * mtx[0][0] + copy[1] * mtx[0][1] + copy[1] * mtx[0][2]; - b[1] = copy[0] * mtx[1][0] + copy[1] * mtx[1][1] + copy[1] * mtx[1][2]; - b[2] = copy[0] * mtx[2][0] + copy[1] * mtx[2][1] + copy[1] * mtx[2][2]; -} - void func_802B5CAC(s16 arg0, s16 arg1, Vec3f arg2) { f32 sp2C = sins(arg1); f32 sp28 = coss(arg1); @@ -467,6 +434,7 @@ void set_track_light_direction(Lights1* addr, s16 pitch, s16 yaw, s32 numLights) // multiply a matrix with a number void mtxf_scale(Mat4 mat, f32 coef) { + FrameInterpolation_RecordMatrixScale(mat, coef); mat[0][0] *= coef; mat[1][0] *= coef; mat[2][0] *= coef; @@ -631,7 +599,9 @@ void func_802B64C4(Vec3f arg0, s16 arg1) { arg0[2] = sp2C * temp1 + (temp_f0 * temp3); } -void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 rotationAngle) { +// Rotates the object around the Y axis. +// x,y,z is a direction (not a rotator). +void calculate_orientation_matrix(Mat3 dest, f32 x, f32 y, f32 z, s16 rotationAngle) { Mat3 mtx_rot_y; Mat3 matrix; s32 i, j; @@ -642,6 +612,7 @@ void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 r UNUSED s32 pad[3]; f32 sinValue; f32 cossValue; + FrameInterpolation_RecordCalculateOrientationMatrix(dest, x, y, z, rotationAngle); sinValue = sins(rotationAngle); cossValue = coss(rotationAngle); @@ -657,7 +628,7 @@ void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 r mtx_rot_y[1][0] = 0; mtx_rot_y[0][1] = 0; - if (arg2 == 1) { // set matrix to identity + if (y == 1) { // set matrix to identity for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { @@ -665,7 +636,7 @@ void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 r } } - } else if (arg2 == -1) { // set matrix to identity with the second column negative + } else if (y == -1) { // set matrix to identity with the second column negative for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { @@ -676,10 +647,10 @@ void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 r matrix[1][1] = -1; } else { - a = (f32) - (360.0 - ((f64) (calculate_vector_angle_xy(arg2) * 180.0f) / M_PI)); - b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3)); + a = (f32) - (360.0 - ((f64) (calculate_vector_angle_xy(y) * 180.0f) / M_PI)); + b = -z / sqrtf((x * x) + (z * z)); c = 0; - d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3)); + d = x / sqrtf((x * x) + (z * z)); calculate_rotation_matrix(matrix, a, b, c, d); } dest[0][0] = (mtx_rot_y[0][0] * matrix[0][0]) + (mtx_rot_y[0][1] * matrix[1][0]) + (mtx_rot_y[0][2] * matrix[2][0]); @@ -760,7 +731,7 @@ void calculate_rotation_matrix(Mat3 destMatrix, s16 rotationAngle, f32 rotationX destMatrix[0][1] = temp + (rotationZ * sinValue); } -void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) { +UNUSED void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) { f32 sine; f32 cosine; f32 temp_f0; diff --git a/src/racing/math_util.h b/src/racing/math_util.h index ec6c2f3c9..7c230ca87 100644 --- a/src/racing/math_util.h +++ b/src/racing/math_util.h @@ -42,7 +42,6 @@ void func_802B5794(Mat4, Vec3f, Vec3f); void mtxf_rotate_x(Mat4, s16); void mtxf_rotate_y(Mat4, s16); void mtxf_s16_rotate_z(Mat4, s16); -void func_802B5B14(Vec3f b, Vec3s rotate); // unused void func_802B5CAC(s16, s16, Vec3f); void func_802B5D30(s16, s16, s32); void set_track_light_direction(Lights1*, s16, s16, s32); diff --git a/src/render_player.c b/src/render_player.c index 65545ebd7..ff33db379 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -927,18 +927,6 @@ UNUSED void func_80021F50(Mat4 arg0, Vec3f arg1) { arg0[3][2] += arg1[2]; } -void mtxf_scale2(Mat4 arg0, f32 scale) { - arg0[0][0] *= scale; - arg0[1][0] *= scale; - arg0[2][0] *= scale; - arg0[0][1] *= scale; - arg0[1][1] *= scale; - arg0[2][1] *= scale; - arg0[0][2] *= scale; - arg0[1][2] *= scale; - arg0[2][2] *= scale; -} - /** * This function writes a fixed-point value to each Mtx entry. This is not how the Mtx struct works. * The first half of Mtx only holds s16 whole numbers and the second half holds the s16 decimal (fractional) parts. @@ -1523,7 +1511,7 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) { spCC[1] = player->unk_074 + 1.0f; spCC[2] = player->pos[2] + ((spB0 * coss(spC0)) - (spAC * sins(spC0))); mtxf_translate_rotate(mtx, spCC, spC4); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); } // convert_to_fixed_point_matrix(&gGfxPool->mtxShadow[playerId + (screenId * 8)], mtx); @@ -1582,7 +1570,7 @@ void render_player_shadow_credits(Player* player, s8 playerId, s8 arg2) { spCC[1] = gObjectList[indexObjectList1[playerId]].pos[1] + sp94[playerId]; mtxf_translate_rotate(mtx, spCC, spC4); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); // convert_to_fixed_point_matrix(&gGfxPool->mtxShadow[playerId + (arg2 * 8)], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxShadow[playerId + (arg2 * 8)]), @@ -1674,7 +1662,7 @@ void render_kart(Player* player, s8 playerId, s8 screenId, s8 arg3) { #endif } mtxf_translate_rotate(mtx, sp154, sp14C); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); // convert_to_fixed_point_matrix(&gGfxPool->mtxKart[playerId + (screenId * 8)], mtx); // @port: Tag the transform. @@ -1801,7 +1789,7 @@ void render_ghost(Player* player, s8 playerId, s8 screenId, s8 arg3) { } mtxf_translate_rotate(mtx, spDC, spD4); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); // convert_to_fixed_point_matrix(&gGfxPool->mtxKart[playerId + (screenId * 8)], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxKart[playerId + (screenId * 8)]), @@ -1847,7 +1835,7 @@ void func_80025DE8(Player* player, s8 playerId, s8 screenId, s8 arg3) { sp94[2] = player->unk_050[screenId]; mtxf_translate_rotate(mtx, sp9C, sp94); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); // convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), @@ -1897,7 +1885,7 @@ void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 a } mtxf_translate_rotate(mtx, sp9C, sp94); - mtxf_scale2(mtx, gCharacterSize[player->characterId] * player->size); + mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); // convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), diff --git a/src/render_player.h b/src/render_player.h index 212f8810b..e11c7c3eb 100644 --- a/src/render_player.h +++ b/src/render_player.h @@ -29,7 +29,6 @@ void func_80021D40(void); void func_80021DA8(void); void mtxf_translate_rotate(Mat4, Vec3f, Vec3s); void func_80021F50(Mat4, Vec3f); -void mtxf_scale2(Mat4, f32); void failed_fixed_point_matrix_conversion(Mtx*, Mat4); void convert_to_fixed_point_matrix(Mtx*, Mat4); bool adjust_angle(s16*, s16, s16);