mirror of
https://github.com/n64decomp/mk64
synced 2026-08-17 12:59:29 -04:00
Function renaming for math_utils and math_utils_2 (#440)
* Renaming functions in math_utils
This commit is contained in:
+62
-62
@@ -113,9 +113,9 @@ void cleanup_red_and_green_shells(struct ShellActor *shell) {
|
||||
|
||||
// Sets introductory values for a new actor (ex. Banana).
|
||||
void actor_init(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f startingVelocity, s16 actorType) {
|
||||
vec3f_copy(actor->pos, startingPos);
|
||||
vec3f_copy_return(actor->pos, startingPos);
|
||||
vec3s_copy(actor->rot, startingRot);
|
||||
vec3f_copy(actor->velocity, startingVelocity);
|
||||
vec3f_copy_return(actor->velocity, startingVelocity);
|
||||
actor->type = actorType;
|
||||
actor->flags = -0x8000;
|
||||
actor->unk_04 = 0;
|
||||
@@ -414,7 +414,7 @@ void func_8029794C(Vec3f arg0, Vec3s arg1, f32 arg2) {
|
||||
arg0[1] += 2.0f;
|
||||
|
||||
func_802B5F74(sp20, arg0, arg1);
|
||||
func_802B5F00(sp20, arg2);
|
||||
mtxf_scale(sp20, arg2);
|
||||
if (render_set_position(sp20, 0) != 0) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007B20);
|
||||
@@ -1427,10 +1427,10 @@ void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, UNUSED Mat4 arg2,
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E730);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_E058);
|
||||
|
||||
func_802B59DC(spE0, boat->wheelRot);
|
||||
mtxf_rotate_x(spE0, boat->wheelRot);
|
||||
vec3f_set(sp120, 0, 16.0f, -255.0f);
|
||||
mtxf_translate(spA0, sp120);
|
||||
func_802B71CC(sp60, spE0, spA0);
|
||||
mtxf_multiplication(sp60, spE0, spA0);
|
||||
if (render_set_position(sp60, 3) != 0) {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, &d_course_dks_jungle_parkway_dl_FC28);
|
||||
@@ -1526,7 +1526,7 @@ void func_8029B4E0(Camera *arg0, struct Actor *arg1) {
|
||||
|
||||
|
||||
func_802B5F74(spC8, arg1->pos, arg1->rot);
|
||||
func_802B5F00(spC8, 0.1f);
|
||||
mtxf_scale(spC8, 0.1f);
|
||||
if (render_set_position(spC8, 0) != 0) {
|
||||
|
||||
if (gActiveScreenMode == SCREEN_MODE_1P) {
|
||||
@@ -1615,10 +1615,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 32.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1626,10 +1626,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 32.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1637,10 +1637,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 16.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1648,10 +1648,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, 16.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1659,10 +1659,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, 17.0f, 12.0f, -12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1670,10 +1670,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, -17.0f, 12.0f, -12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1681,10 +1681,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
vec3f_set(sp160, 17.0f, 12.0f, -34.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1692,10 +1692,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D70);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x2D8));
|
||||
vec3f_set(sp160, -17.0f, 12.0f, -34.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
maxObjectsReached = render_set_position(spA0, 3) == 0;
|
||||
if (maxObjectsReached) { return; }
|
||||
@@ -1734,40 +1734,40 @@ void func_8029BFB0(Camera *camera, struct TrainCar *actor) {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x444));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
@@ -1809,80 +1809,80 @@ void func_8029C3CC(Camera *camera, struct TrainCar *actor) {
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 28.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, actor->wheelRot);
|
||||
mtxf_rotate_x(sp120, actor->wheelRot);
|
||||
vec3f_set(sp160, -17.0, 6.0f, 28.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, 12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x222));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, 12.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x5B0));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -8.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, 17.0f, 6.0f, -24.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22DB8);
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
|
||||
func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
mtxf_rotate_x(sp120, (s16) (actor->wheelRot + 0x16C));
|
||||
vec3f_set(sp160, -17.0f, 6.0f, -24.0f);
|
||||
mtxf_translate(spE0, sp160);
|
||||
func_802B71CC(spA0, sp120, spE0);
|
||||
mtxf_multiplication(spA0, sp120, spE0);
|
||||
|
||||
if (render_set_position(spA0, 3) == 0) { return; }
|
||||
|
||||
@@ -3601,14 +3601,14 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someRot[1] = fakeItemBox->rot[1];
|
||||
someRot[2] = 0;
|
||||
func_802B5F74(someMatrix2, fakeItemBox->pos, someRot);
|
||||
func_802B5F00(someMatrix2, fakeItemBox->sizeScaling);
|
||||
mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
|
||||
if (fakeItemBox->state != 2) {
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, common_model_fake_itembox);
|
||||
func_802B5F74(someMatrix2, fakeItemBox->pos, fakeItemBox->rot);
|
||||
func_802B5F00(someMatrix2, fakeItemBox->sizeScaling);
|
||||
mtxf_scale(someMatrix2, fakeItemBox->sizeScaling);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3638,7 +3638,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
} else {
|
||||
someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
|
||||
}
|
||||
func_802B5F00(someMatrix2, someMultiplier);
|
||||
mtxf_scale(someMatrix2, someMultiplier);
|
||||
if (fakeItemBox->someTimer & 1) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
@@ -3648,7 +3648,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = 0.0f;
|
||||
someVec[1] = temp_f2;
|
||||
someVec[2] = thing;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3658,7 +3658,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = temp_f2_2;
|
||||
someVec[1] = 2.3f * thing;
|
||||
someVec[2] = temp_f12;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3667,7 +3667,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = temp_f2_2;
|
||||
someVec[1] = 1.2f * thing;
|
||||
someVec[2] = temp_f0_2;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3680,7 +3680,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = 0.0f;
|
||||
someVec[1] = 1.8f * thing;
|
||||
someVec[2] = -1.0f * thing;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3689,7 +3689,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = temp_f0_3;
|
||||
someVec[1] = 0.6f * thing;
|
||||
someVec[2] = temp_f0_2;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3697,7 +3697,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
someVec[0] = temp_f0_3;
|
||||
someVec[1] = temp_f2;
|
||||
someVec[2] = temp_f12;
|
||||
func_802B5450(someMatrix2, someMatrix3, someVec);
|
||||
add_translate_mat4_vec3f(someMatrix2, someMatrix3, someVec);
|
||||
|
||||
if (!render_set_position(someMatrix3, 0)) { return; }
|
||||
|
||||
@@ -3786,7 +3786,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
} else {
|
||||
someMultiplier = 1.0f - ((thing - 10.0f) * 0.1f);
|
||||
}
|
||||
func_802B5F00(someMatrix1, someMultiplier);
|
||||
mtxf_scale(someMatrix1, someMultiplier);
|
||||
if (item_box->someTimer & 1) {
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||
} else {
|
||||
@@ -3796,7 +3796,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = 0.0f;
|
||||
someVec1[1] = temp_f2;
|
||||
someVec1[2] = thing;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3806,7 +3806,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = temp_f2_2;
|
||||
someVec1[1] = 2.3f * thing;
|
||||
someVec1[2] = temp_f12;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3815,7 +3815,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = temp_f2_2;
|
||||
someVec1[1] = 1.2f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3828,7 +3828,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = 0.0f;
|
||||
someVec1[1] = 1.8f * thing;
|
||||
someVec1[2] = -1.0f * thing;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3837,7 +3837,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = 0.6f * thing;
|
||||
someVec1[2] = temp_f0_2;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
@@ -3845,7 +3845,7 @@ void func_802A1EA0(Camera *camera, struct ItemBox *item_box) {
|
||||
someVec1[0] = temp_f0_3;
|
||||
someVec1[1] = temp_f2;
|
||||
someVec1[2] = temp_f12;
|
||||
func_802B5450(someMatrix1, someMatrix2, someVec1);
|
||||
add_translate_mat4_vec3f(someMatrix1, someMatrix2, someVec1);
|
||||
|
||||
if (!render_set_position(someMatrix2, 0)) { return; }
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ void func_802B0210(Collision *arg0, Collision *arg1) {
|
||||
arg1->unk3C[1] = arg0->unk3C[1];
|
||||
arg1->unk3C[2] = arg0->unk3C[2];
|
||||
|
||||
vec3f_copy(arg1->unk48, arg0->unk48);
|
||||
vec3f_copy(arg1->unk54, arg0->unk54);
|
||||
vec3f_copy(arg1->unk60, arg0->unk60);
|
||||
vec3f_copy_return(arg1->unk48, arg0->unk48);
|
||||
vec3f_copy_return(arg1->unk54, arg0->unk54);
|
||||
vec3f_copy_return(arg1->unk60, arg0->unk60);
|
||||
}
|
||||
|
||||
void func_802B02B4(struct ShellActor *shell, s32 shellType) {
|
||||
@@ -557,7 +557,7 @@ s32 func_802B19EC(TripleShellParent *parent, Player *player, s16 shellType, u16
|
||||
startingPos[0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = player->boundingBoxSize - 4.0f;
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -603,7 +603,7 @@ s32 func_802B1C9C(Player *player) {
|
||||
startingPos[0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = player->boundingBoxSize - 4.0f;
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -636,7 +636,7 @@ s32 func_802B1E48(Player *player) {
|
||||
startingPos[0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = player->boundingBoxSize - 4.0f;
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -856,7 +856,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
|
||||
startingPos[0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = -(player->boundingBoxSize + 4.0f);
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -933,7 +933,7 @@ s32 func_802B2C40(Player *player) {
|
||||
startingPos[0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = -(player->boundingBoxSize + 4.0f);
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -972,7 +972,7 @@ s32 func_802B2D70(Player *player) {
|
||||
startingPos[0, 0] = 0.0f;
|
||||
startingPos[1] = -player->boundingBoxSize;
|
||||
startingPos[2] = -(player->boundingBoxSize + 4.0f);
|
||||
func_802B63B8(startingPos, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
|
||||
startingPos[0] += player->pos[0];
|
||||
startingPos[1] += player->pos[1];
|
||||
startingPos[2] += player->pos[2];
|
||||
@@ -1136,7 +1136,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad2 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
@@ -1216,7 +1216,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 6.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 6.0f;
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
@@ -1257,7 +1257,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
somePos2[0] = shell->pos[0];
|
||||
somePos2[1] = shell->pos[1];
|
||||
somePos2[2] = shell->pos[2];
|
||||
@@ -1515,7 +1515,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = player->boundingBoxSize;
|
||||
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
pad7 = player->pos[1] - somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
@@ -1594,7 +1594,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
shell->pos[0] = player->pos[0] + somePosVel[0];
|
||||
shell->pos[1] = player->pos[1] + somePosVel[1];
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
@@ -1699,7 +1699,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
|
||||
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
|
||||
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
|
||||
func_802B63B8(somePosVel, player->unk_174);
|
||||
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
|
||||
origPos[0] = shell->pos[0];
|
||||
origPos[1] = shell->pos[1];
|
||||
origPos[2] = shell->pos[2];
|
||||
|
||||
+190
-146
@@ -7,6 +7,7 @@
|
||||
#include "framebuffers.h"
|
||||
#include <PR/rcp.h>
|
||||
#include <trig_tables.h>
|
||||
#include "math.h"
|
||||
|
||||
#pragma intrinsic (sqrtf,fabs)
|
||||
|
||||
@@ -22,9 +23,9 @@ UNUSED s32 func_802B4F60(UNUSED s32 arg0, Vec3f arg1, UNUSED s32 arg2, UNUSED f3
|
||||
f32 sp2C;
|
||||
UNUSED f32 a;
|
||||
Vec3f sp1C;
|
||||
vec3f_copy(sp1C, arg1);
|
||||
vec3f_copy_return(sp1C, arg1);
|
||||
sp2C = sp30[3][3] + (((sp1C[0] * sp30[0][3]) + (sp1C[1] * sp30[1][3])) + (sp30[2][3] * sp1C[2]));
|
||||
func_802B6434(sp1C, sp30);
|
||||
mtxf_translate_vec3f_mat4(sp1C, sp30);
|
||||
if (sp2C >= 0.0f)
|
||||
{
|
||||
return 0;
|
||||
@@ -63,14 +64,14 @@ s32 render_set_position(Mat4 arg0, s32 arg1) {
|
||||
}
|
||||
|
||||
f32 func_802B51E8(Vec3f arg0, Vec3f arg1) {
|
||||
f32 temp_f12;
|
||||
f32 temp_f14;
|
||||
f32 temp_f2;
|
||||
f32 sub_y;
|
||||
f32 sub_z;
|
||||
f32 sub_x;
|
||||
|
||||
temp_f2 = arg1[0] - arg0[0];
|
||||
temp_f12 = arg1[1] - arg0[1];
|
||||
temp_f14 = arg1[2] - arg0[2];
|
||||
return (temp_f2 * temp_f2) + (temp_f12 * temp_f12) + temp_f14 + temp_f14;
|
||||
sub_x = arg1[0] - arg0[0];
|
||||
sub_y = arg1[1] - arg0[1];
|
||||
sub_z = arg1[2] - arg0[2];
|
||||
return (sub_x * sub_x) + (sub_y * sub_y) + sub_z + sub_z;
|
||||
}
|
||||
|
||||
u32 get_angle_between_points(Vec3f arg0, Vec3f arg1) {
|
||||
@@ -82,6 +83,7 @@ u32 get_angle_between_points(Vec3f arg0, Vec3f arg1) {
|
||||
return atan2s(temp_v1, temp_v2);
|
||||
}
|
||||
|
||||
// get_angle_between_points
|
||||
u32 func_802B5258(Vec3f arg0, Vec3s arg1) {
|
||||
f32 temp_v1;
|
||||
f32 temp_v2;
|
||||
@@ -115,7 +117,7 @@ void vec3s_set(Vec3s arg0, s16 arg1, s16 arg2, s16 arg3) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void *vec3f_copy(Vec3f dest, Vec3f src) {
|
||||
void *vec3f_copy_return(Vec3f dest, Vec3f src) {
|
||||
dest[0] = src[0];
|
||||
dest[1] = src[1];
|
||||
dest[2] = src[2];
|
||||
@@ -128,31 +130,33 @@ void vec3s_copy(Vec3s dest, Vec3s src) {
|
||||
dest[2] = src[2];
|
||||
}
|
||||
|
||||
UNUSED void *sm64_vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) {
|
||||
UNUSED void *vec3f_set_return(Vec3f dest, f32 x, f32 y, f32 z) {
|
||||
dest[0] = x;
|
||||
dest[1] = y;
|
||||
dest[2] = z;
|
||||
return &dest;
|
||||
}
|
||||
|
||||
void func_802B5350(Mat4 arg0, Mat4 arg1) {
|
||||
// Copy mat1 to mat2
|
||||
void mtxf_copy(Mat4 mat1, Mat4 mat2) {
|
||||
s32 row;
|
||||
s32 column;
|
||||
|
||||
for (row = 0; row < 4; row++) {
|
||||
for (column = 0; column < 4; column++) {
|
||||
arg1[row][column] = arg0[row][column];
|
||||
mat2[row][column] = mat1[row][column];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mtxf_copy
|
||||
void func_802B5398(s32 *dest, s32 *src, s32 arg2) {
|
||||
while (arg2-- > 0) {
|
||||
void mtxf_copy_n_element(s32 *dest, s32 *src, s32 n) {
|
||||
while (n-- > 0) {
|
||||
*dest++ = *src++;
|
||||
}
|
||||
}
|
||||
|
||||
// Transform a matrix to a matrix identity
|
||||
void mtxf_identity(Mat4 mtx) {
|
||||
register s32 i;
|
||||
register s32 k;
|
||||
@@ -164,31 +168,41 @@ void mtxf_identity(Mat4 mtx) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B5450(Mat4 arg0, Mat4 arg1, Vec3f arg2) {
|
||||
arg1[3][0] = arg0[3][0] + arg2[0];
|
||||
arg1[3][1] = arg0[3][1] + arg2[1];
|
||||
arg1[3][2] = arg0[3][2] + arg2[2];
|
||||
arg1[3][3] = arg0[3][3];
|
||||
arg1[0][0] = arg0[0][0];
|
||||
arg1[0][1] = arg0[0][1];
|
||||
arg1[0][2] = arg0[0][2];
|
||||
arg1[0][3] = arg0[0][3];
|
||||
arg1[1][0] = arg0[1][0];
|
||||
arg1[1][1] = arg0[1][1];
|
||||
arg1[1][2] = arg0[1][2];
|
||||
arg1[1][3] = arg0[1][3];
|
||||
arg1[2][0] = arg0[2][0];
|
||||
arg1[2][1] = arg0[2][1];
|
||||
arg1[2][2] = arg0[2][2];
|
||||
arg1[2][3] = arg0[2][3];
|
||||
// Add a translation vector to a matrix, mat is the matrix to add, dest is the destination matrix, pos is the translation vector
|
||||
void add_translate_mat4_vec3f(Mat4 mat, Mat4 dest, Vec3f pos) {
|
||||
dest[3][0] = mat[3][0] + pos[0];
|
||||
dest[3][1] = mat[3][1] + pos[1];
|
||||
dest[3][2] = mat[3][2] + pos[2];
|
||||
dest[3][3] = mat[3][3];
|
||||
dest[0][0] = mat[0][0];
|
||||
dest[0][1] = mat[0][1];
|
||||
dest[0][2] = mat[0][2];
|
||||
dest[0][3] = mat[0][3];
|
||||
dest[1][0] = mat[1][0];
|
||||
dest[1][1] = mat[1][1];
|
||||
dest[1][2] = mat[1][2];
|
||||
dest[1][3] = mat[1][3];
|
||||
dest[2][0] = mat[2][0];
|
||||
dest[2][1] = mat[2][1];
|
||||
dest[2][2] = mat[2][2];
|
||||
dest[2][3] = mat[2][3];
|
||||
|
||||
/*
|
||||
* mat(0,0) mat(0,1) mat(0,2) mat(0,3)
|
||||
* mat(1,0) mat(1,1) mat(1,2) mat(1,3)
|
||||
* mat(2,0) mat(2,1) mat(2,2) mat(2,3)
|
||||
* mat(3,0)+pos(0) mat(3,1)+pos(1) mat(3,2)+pos(2) mat(3,3)
|
||||
*/
|
||||
}
|
||||
|
||||
UNUSED void func_802B54EC(Mat4 arg0, Mat4 arg1, Vec3f arg2) {
|
||||
arg1[3][0] = arg0[3][0] + arg2[0];
|
||||
arg1[3][1] = arg0[3][1] + arg2[1];
|
||||
arg1[3][2] = arg0[3][2] + arg2[2];
|
||||
// Light version of add_translate_mat4_vec3f
|
||||
UNUSED void add_translate_mat4_vec3f_lite(Mat4 mat, Mat4 dest, Vec3f pos) {
|
||||
dest[3][0] = mat[3][0] + pos[0];
|
||||
dest[3][1] = mat[3][1] + pos[1];
|
||||
dest[3][2] = mat[3][2] + pos[2];
|
||||
}
|
||||
|
||||
// create a translation matrix
|
||||
void mtxf_translate(Mat4 dest, Vec3f b) {
|
||||
mtxf_identity(dest);
|
||||
dest[3][0] = b[0];
|
||||
@@ -296,37 +310,61 @@ void func_802B5794(Mat4 mtx, Vec3f from, Vec3f to) {
|
||||
mtx[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
void func_802B59DC(Mat4 arg0, s16 arg1) {
|
||||
f32 sp28 = sins(arg1);
|
||||
f32 temp_f0 = coss(arg1);
|
||||
// create a rotation matrix around the x axis
|
||||
void mtxf_rotate_x(Mat4 mat, s16 angle) {
|
||||
f32 sin_theta = sins(angle);
|
||||
f32 cos_theta = coss(angle);
|
||||
|
||||
mtxf_identity(arg0);
|
||||
arg0[1][1] = temp_f0;
|
||||
arg0[1][2] = sp28;
|
||||
arg0[2][1] = -sp28;
|
||||
arg0[2][2] = temp_f0;
|
||||
mtxf_identity(mat);
|
||||
mat[1][1] = cos_theta;
|
||||
mat[1][2] = sin_theta;
|
||||
mat[2][1] = -sin_theta;
|
||||
mat[2][2] = cos_theta;
|
||||
|
||||
/*
|
||||
* 1, 0, 0, 0,
|
||||
* 0, cos_theta, sin_theta, 0,
|
||||
* 0, -sin_theta, cos_theta, 0,
|
||||
* 0, 0, 0, 1
|
||||
*/
|
||||
}
|
||||
|
||||
void func_802B5A44(Mat4 arg0, s16 arg1) {
|
||||
f32 temp_f0 = sins(arg1);
|
||||
f32 sp28 = coss(arg1);
|
||||
// create a rotation matrix around the y axis
|
||||
void mtxf_rotate_y(Mat4 mat, s16 angle) {
|
||||
f32 sin_theta = sins(angle);
|
||||
f32 cos_theta = coss(angle);
|
||||
|
||||
mtxf_identity(arg0);
|
||||
arg0[0][0] = sp28;
|
||||
arg0[0][2] = -temp_f0;
|
||||
arg0[2][0] = temp_f0;
|
||||
arg0[2][2] = sp28;
|
||||
mtxf_identity(mat);
|
||||
mat[0][0] = cos_theta;
|
||||
mat[0][2] = -sin_theta;
|
||||
mat[2][0] = sin_theta;
|
||||
mat[2][2] = cos_theta;
|
||||
|
||||
/*
|
||||
* cos_theta, 0, -sin_theta, 0,
|
||||
* 0, 1, 0, 0,
|
||||
* sin_theta, 0, cos_theta, 0,
|
||||
* 0, 0, 0, 1
|
||||
*/
|
||||
}
|
||||
|
||||
void func_802B5AAC(Mat4 arg0, s16 arg1) {
|
||||
f32 temp_f0 = sins(arg1);
|
||||
f32 sp28 = coss(arg1);
|
||||
// create a rotation matrix around the z axis
|
||||
void mtxf_s16_rotate_z(Mat4 mat, s16 angle) {
|
||||
f32 sin_theta = sins(angle);
|
||||
f32 cos_theta = coss(angle);
|
||||
|
||||
mtxf_identity(arg0);
|
||||
arg0[0][0] = sp28;
|
||||
arg0[0][1] = temp_f0;
|
||||
arg0[1][0] = -temp_f0;
|
||||
arg0[1][1] = sp28;
|
||||
mtxf_identity(mat);
|
||||
mat[0][0] = cos_theta;
|
||||
mat[0][1] = sin_theta;
|
||||
mat[1][0] = -sin_theta;
|
||||
mat[1][1] = cos_theta;
|
||||
|
||||
/*
|
||||
* cos_theta, sin_theta, 0, 0,
|
||||
* -sin_theta, cos_theta, 0, 0,
|
||||
* 0, 0, 1, 0,
|
||||
* 0, 0, 0, 1
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
@@ -426,18 +464,20 @@ void func_802B5D64(uintptr_t arg0, s16 arg1, s16 arg2, s32 arg3) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B5F00(Mat4 arg0, f32 arg1) {
|
||||
arg0[0][0] *= arg1;
|
||||
arg0[1][0] *= arg1;
|
||||
arg0[2][0] *= arg1;
|
||||
arg0[0][1] *= arg1;
|
||||
arg0[1][1] *= arg1;
|
||||
arg0[2][1] *= arg1;
|
||||
arg0[0][2] *= arg1;
|
||||
arg0[1][2] *= arg1;
|
||||
arg0[2][2] *= arg1;
|
||||
// multiply a matrix with a number
|
||||
void mtxf_scale(Mat4 mat, f32 coef) {
|
||||
mat[0][0] *= coef;
|
||||
mat[1][0] *= coef;
|
||||
mat[2][0] *= coef;
|
||||
mat[0][1] *= coef;
|
||||
mat[1][1] *= coef;
|
||||
mat[2][1] *= coef;
|
||||
mat[0][2] *= coef;
|
||||
mat[1][2] *= coef;
|
||||
mat[2][2] *= coef;
|
||||
}
|
||||
|
||||
// look like create a translation and rotation matrix with arg1 position and arg2 rotation
|
||||
void func_802B5F74(Mat4 arg0, Vec3f arg1, Vec3s arg2) {
|
||||
f32 sine1;
|
||||
f32 cosine1;
|
||||
@@ -534,6 +574,7 @@ UNUSED void func_802B6214(Mat4 arg0, Vec3s arg1, Vec3s arg2) {
|
||||
arg0[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
// look like to normalise vector
|
||||
UNUSED void func_802B6374(Vec3f arg0) {
|
||||
f32 temp_f0;
|
||||
temp_f0 = sqrtf((arg0[0] * arg0[0]) + (arg0[1] * arg0[1]) + (arg0[2] * arg0[2]));
|
||||
@@ -542,34 +583,35 @@ UNUSED void func_802B6374(Vec3f arg0) {
|
||||
arg0[2] /= temp_f0;
|
||||
}
|
||||
|
||||
void func_802B63B8(Vec3f arg0, Mat3 arg1) {
|
||||
f32 temp_f12;
|
||||
f32 temp_f16;
|
||||
f32 temp_f14;
|
||||
// translate the vector with a matrix
|
||||
void mtxf_translate_vec3f_mat3(Vec3f pos, Mat3 mat) {
|
||||
f32 new_x;
|
||||
f32 new_y;
|
||||
f32 new_z;
|
||||
|
||||
temp_f12 = (arg1[0][0] * arg0[0]) + (arg1[0][1] * arg0[1]) + (arg1[0][2] * arg0[2]);
|
||||
temp_f16 = (arg1[1][0] * arg0[0]) + (arg1[1][1] * arg0[1]) + (arg1[1][2] * arg0[2]);
|
||||
temp_f14 = (arg1[2][0] * arg0[0]) + (arg1[2][1] * arg0[1]) + (arg1[2][2] * arg0[2]);
|
||||
new_x = (mat[0][0] * pos[0]) + (mat[0][1] * pos[1]) + (mat[0][2] * pos[2]);
|
||||
new_y = (mat[1][0] * pos[0]) + (mat[1][1] * pos[1]) + (mat[1][2] * pos[2]);
|
||||
new_z = (mat[2][0] * pos[0]) + (mat[2][1] * pos[1]) + (mat[2][2] * pos[2]);
|
||||
|
||||
arg0[0] = temp_f12;
|
||||
arg0[1] = temp_f16;
|
||||
arg0[2] = temp_f14;
|
||||
pos[0] = new_x;
|
||||
pos[1] = new_y;
|
||||
pos[2] = new_z;
|
||||
}
|
||||
|
||||
void func_802B6434(Vec3f arg0, Mat4 arg1) {
|
||||
// translate the vector with a matrix (with a matrix 4x4)
|
||||
void mtxf_translate_vec3f_mat4(Vec3f pos, Mat4 mat) {
|
||||
f32 new_x;
|
||||
f32 new_y;
|
||||
f32 new_z;
|
||||
|
||||
f32 temp_f2;
|
||||
f32 temp_f16;
|
||||
f32 temp_f6;
|
||||
|
||||
temp_f2 = ((arg1[0][0] * arg0[0]) + (arg1[0][1] * arg0[1]) + (arg1[0][2] * arg0[2]));
|
||||
temp_f16 = ((arg1[1][0] * arg0[0]) + (arg1[1][1] * arg0[1]) + (arg1[1][2] * arg0[2]));
|
||||
temp_f6 = (arg1[2][0] * arg0[0]) + (arg1[2][1] * arg0[1]) + (arg1[2][2] * arg0[2]);
|
||||
new_x = (mat[0][0] * pos[0]) + (mat[0][1] * pos[1]) + (mat[0][2] * pos[2]);
|
||||
new_y = (mat[1][0] * pos[0]) + (mat[1][1] * pos[1]) + (mat[1][2] * pos[2]);
|
||||
new_z = (mat[2][0] * pos[0]) + (mat[2][1] * pos[1]) + (mat[2][2] * pos[2]);
|
||||
|
||||
|
||||
arg0[0] = temp_f2;
|
||||
arg0[1] = temp_f16;
|
||||
arg0[2] = temp_f6;
|
||||
pos[0] = new_x;
|
||||
pos[1] = new_y;
|
||||
pos[2] = new_z;
|
||||
}
|
||||
|
||||
UNUSED void func_802B64B0(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3) {
|
||||
@@ -589,8 +631,8 @@ void func_802B64C4(Vec3f arg0, s16 arg1) {
|
||||
arg0[2] = sp2C * temp1 + (temp_f0 * temp3);
|
||||
}
|
||||
|
||||
void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
Mat3 mtx2;
|
||||
void func_802B6540(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
Mat3 mtx_rot_y;
|
||||
Mat3 matrix;
|
||||
s32 i, j;
|
||||
f32 a;
|
||||
@@ -603,19 +645,19 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
|
||||
sinValue = sins(arg4);
|
||||
cossValue = coss(arg4);
|
||||
mtx2[0][0] = cossValue;
|
||||
mtx2[2][1] = 0;
|
||||
mtx2[1][2] = 0;
|
||||
mtx_rot_y[0][0] = cossValue;
|
||||
mtx_rot_y[2][1] = 0;
|
||||
mtx_rot_y[1][2] = 0;
|
||||
|
||||
mtx2[1][1] = 1;
|
||||
mtx2[2][0] = sinValue;
|
||||
mtx2[0][2] = -sinValue;
|
||||
mtx_rot_y[1][1] = 1;
|
||||
mtx_rot_y[2][0] = sinValue;
|
||||
mtx_rot_y[0][2] = -sinValue;
|
||||
|
||||
mtx2[2][2] = cossValue;
|
||||
mtx2[1][0] = 0;
|
||||
mtx2[0][1] = 0;
|
||||
mtx_rot_y[2][2] = cossValue;
|
||||
mtx_rot_y[1][0] = 0;
|
||||
mtx_rot_y[0][1] = 0;
|
||||
|
||||
if (arg2 == 1) {
|
||||
if (arg2 == 1) { // set matrix to identity
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
@@ -623,7 +665,7 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
}
|
||||
}
|
||||
|
||||
} else if (arg2 == -1) {
|
||||
} else if (arg2 == -1) { // set matrix to identity with the second column negative
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
@@ -634,27 +676,28 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
matrix[1][1] = -1;
|
||||
|
||||
} else {
|
||||
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / 3.141592653589793));
|
||||
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / M_PI));
|
||||
b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
c = 0;
|
||||
d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
func_802B6A84(matrix, a, b, c, d);
|
||||
|
||||
}
|
||||
arg0[0][0] = (mtx2[0][0] * matrix[0][0]) + (mtx2[0][1] * matrix[1][0]) + (mtx2[0][2] * matrix[2][0]);
|
||||
arg0[1][0] = (mtx2[1][0] * matrix[0][0]) + (mtx2[1][1] * matrix[1][0]) + (mtx2[1][2] * matrix[2][0]);
|
||||
arg0[2][0] = (mtx2[2][0] * matrix[0][0]) + (mtx2[2][1] * matrix[1][0]) + (mtx2[2][2] * matrix[2][0]);
|
||||
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]);
|
||||
dest[1][0] = (mtx_rot_y[1][0] * matrix[0][0]) + (mtx_rot_y[1][1] * matrix[1][0]) + (mtx_rot_y[1][2] * matrix[2][0]);
|
||||
dest[2][0] = (mtx_rot_y[2][0] * matrix[0][0]) + (mtx_rot_y[2][1] * matrix[1][0]) + (mtx_rot_y[2][2] * matrix[2][0]);
|
||||
|
||||
arg0[0][1] = (mtx2[0][0] * matrix[0][1]) + (mtx2[0][1] * matrix[1][1]) + (mtx2[0][2] * matrix[2][1]);
|
||||
arg0[1][1] = (mtx2[1][0] * matrix[0][1]) + (mtx2[1][1] * matrix[1][1]) + (mtx2[1][2] * matrix[2][1]);
|
||||
arg0[2][1] = (mtx2[2][0] * matrix[0][1]) + (mtx2[2][1] * matrix[1][1]) + (mtx2[2][2] * matrix[2][1]);
|
||||
dest[0][1] = (mtx_rot_y[0][0] * matrix[0][1]) + (mtx_rot_y[0][1] * matrix[1][1]) + (mtx_rot_y[0][2] * matrix[2][1]);
|
||||
dest[1][1] = (mtx_rot_y[1][0] * matrix[0][1]) + (mtx_rot_y[1][1] * matrix[1][1]) + (mtx_rot_y[1][2] * matrix[2][1]);
|
||||
dest[2][1] = (mtx_rot_y[2][0] * matrix[0][1]) + (mtx_rot_y[2][1] * matrix[1][1]) + (mtx_rot_y[2][2] * matrix[2][1]);
|
||||
|
||||
arg0[0][2] = (mtx2[0][0] * matrix[0][2]) + (mtx2[0][1] * matrix[1][2]) + (mtx2[0][2] * matrix[2][2]);
|
||||
arg0[1][2] = (mtx2[1][0] * matrix[0][2]) + (mtx2[1][1] * matrix[1][2]) + (mtx2[1][2] * matrix[2][2]);
|
||||
arg0[2][2] = (mtx2[2][0] * matrix[0][2]) + (mtx2[2][1] * matrix[1][2]) + (mtx2[2][2] * matrix[2][2]);
|
||||
dest[0][2] = (mtx_rot_y[0][0] * matrix[0][2]) + (mtx_rot_y[0][1] * matrix[1][2]) + (mtx_rot_y[0][2] * matrix[2][2]);
|
||||
dest[1][2] = (mtx_rot_y[1][0] * matrix[0][2]) + (mtx_rot_y[1][1] * matrix[1][2]) + (mtx_rot_y[1][2] * matrix[2][2]);
|
||||
dest[2][2] = (mtx_rot_y[2][0] * matrix[0][2]) + (mtx_rot_y[2][1] * matrix[1][2]) + (mtx_rot_y[2][2] * matrix[2][2]);
|
||||
|
||||
}
|
||||
|
||||
// include in func_802B6540
|
||||
UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) {
|
||||
s32 i, j;
|
||||
f32 a;
|
||||
@@ -677,7 +720,7 @@ UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) {
|
||||
}
|
||||
matrix[1][1] = -1.0f;
|
||||
} else {
|
||||
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / 3.141592653589793));
|
||||
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / M_PI));
|
||||
b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
c = 0;
|
||||
d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
@@ -756,6 +799,7 @@ void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) {
|
||||
}
|
||||
}
|
||||
|
||||
// look like create a translation and rotation matrix with arg1 position and arg2 rotation
|
||||
void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) {
|
||||
f32 sine1;
|
||||
f32 cosine1;
|
||||
@@ -788,25 +832,25 @@ void func_802B6D58(Mat4 arg0, Vec3f arg1, Vec3f arg2) {
|
||||
arg0[3][3] = 1.0f;
|
||||
}
|
||||
|
||||
void func_802B71CC(Mat4 arg0, Mat4 arg1, Mat4 arg2) {
|
||||
void mtxf_multiplication(Mat4 dest, Mat4 mat1, Mat4 mat2) {
|
||||
Mat4 product;
|
||||
product[0][0] = (arg1[0][0] * arg2[0][0]) + (arg1[0][1] * arg2[1][0]) + (arg1[0][2] * arg2[2][0]) + (arg1[0][3] * arg2[3][0]);
|
||||
product[0][1] = (arg1[0][0] * arg2[0][1]) + (arg1[0][1] * arg2[1][1]) + (arg1[0][2] * arg2[2][1]) + (arg1[0][3] * arg2[3][1]);
|
||||
product[0][2] = (arg1[0][0] * arg2[0][2]) + (arg1[0][1] * arg2[1][2]) + (arg1[0][2] * arg2[2][2]) + (arg1[0][3] * arg2[3][2]);
|
||||
product[0][3] = (arg1[0][0] * arg2[0][3]) + (arg1[0][1] * arg2[1][3]) + (arg1[0][2] * arg2[2][3]) + (arg1[0][3] * arg2[3][3]);
|
||||
product[1][0] = (arg1[1][0] * arg2[0][0]) + (arg1[1][1] * arg2[1][0]) + (arg1[1][2] * arg2[2][0]) + (arg1[1][3] * arg2[3][0]);
|
||||
product[1][1] = (arg1[1][0] * arg2[0][1]) + (arg1[1][1] * arg2[1][1]) + (arg1[1][2] * arg2[2][1]) + (arg1[1][3] * arg2[3][1]);
|
||||
product[1][2] = (arg1[1][0] * arg2[0][2]) + (arg1[1][1] * arg2[1][2]) + (arg1[1][2] * arg2[2][2]) + (arg1[1][3] * arg2[3][2]);
|
||||
product[1][3] = (arg1[1][0] * arg2[0][3]) + (arg1[1][1] * arg2[1][3]) + (arg1[1][2] * arg2[2][3]) + (arg1[1][3] * arg2[3][3]);
|
||||
product[2][0] = (arg1[2][0] * arg2[0][0]) + (arg1[2][1] * arg2[1][0]) + (arg1[2][2] * arg2[2][0]) + (arg1[2][3] * arg2[3][0]);
|
||||
product[2][1] = (arg1[2][0] * arg2[0][1]) + (arg1[2][1] * arg2[1][1]) + (arg1[2][2] * arg2[2][1]) + (arg1[2][3] * arg2[3][1]);
|
||||
product[2][2] = (arg1[2][0] * arg2[0][2]) + (arg1[2][1] * arg2[1][2]) + (arg1[2][2] * arg2[2][2]) + (arg1[2][3] * arg2[3][2]);
|
||||
product[2][3] = (arg1[2][0] * arg2[0][3]) + (arg1[2][1] * arg2[1][3]) + (arg1[2][2] * arg2[2][3]) + (arg1[2][3] * arg2[3][3]);
|
||||
product[3][0] = (arg1[3][0] * arg2[0][0]) + (arg1[3][1] * arg2[1][0]) + (arg1[3][2] * arg2[2][0]) + (arg1[3][3] * arg2[3][0]);
|
||||
product[3][1] = (arg1[3][0] * arg2[0][1]) + (arg1[3][1] * arg2[1][1]) + (arg1[3][2] * arg2[2][1]) + (arg1[3][3] * arg2[3][1]);
|
||||
product[3][2] = (arg1[3][0] * arg2[0][2]) + (arg1[3][1] * arg2[1][2]) + (arg1[3][2] * arg2[2][2]) + (arg1[3][3] * arg2[3][2]);
|
||||
product[3][3] = (arg1[3][0] * arg2[0][3]) + (arg1[3][1] * arg2[1][3]) + (arg1[3][2] * arg2[2][3]) + (arg1[3][3] * arg2[3][3]);
|
||||
func_802B5398((s32 *)arg0, (s32 *)product, 0x10);
|
||||
product[0][0] = (mat1[0][0] * mat2[0][0]) + (mat1[0][1] * mat2[1][0]) + (mat1[0][2] * mat2[2][0]) + (mat1[0][3] * mat2[3][0]);
|
||||
product[0][1] = (mat1[0][0] * mat2[0][1]) + (mat1[0][1] * mat2[1][1]) + (mat1[0][2] * mat2[2][1]) + (mat1[0][3] * mat2[3][1]);
|
||||
product[0][2] = (mat1[0][0] * mat2[0][2]) + (mat1[0][1] * mat2[1][2]) + (mat1[0][2] * mat2[2][2]) + (mat1[0][3] * mat2[3][2]);
|
||||
product[0][3] = (mat1[0][0] * mat2[0][3]) + (mat1[0][1] * mat2[1][3]) + (mat1[0][2] * mat2[2][3]) + (mat1[0][3] * mat2[3][3]);
|
||||
product[1][0] = (mat1[1][0] * mat2[0][0]) + (mat1[1][1] * mat2[1][0]) + (mat1[1][2] * mat2[2][0]) + (mat1[1][3] * mat2[3][0]);
|
||||
product[1][1] = (mat1[1][0] * mat2[0][1]) + (mat1[1][1] * mat2[1][1]) + (mat1[1][2] * mat2[2][1]) + (mat1[1][3] * mat2[3][1]);
|
||||
product[1][2] = (mat1[1][0] * mat2[0][2]) + (mat1[1][1] * mat2[1][2]) + (mat1[1][2] * mat2[2][2]) + (mat1[1][3] * mat2[3][2]);
|
||||
product[1][3] = (mat1[1][0] * mat2[0][3]) + (mat1[1][1] * mat2[1][3]) + (mat1[1][2] * mat2[2][3]) + (mat1[1][3] * mat2[3][3]);
|
||||
product[2][0] = (mat1[2][0] * mat2[0][0]) + (mat1[2][1] * mat2[1][0]) + (mat1[2][2] * mat2[2][0]) + (mat1[2][3] * mat2[3][0]);
|
||||
product[2][1] = (mat1[2][0] * mat2[0][1]) + (mat1[2][1] * mat2[1][1]) + (mat1[2][2] * mat2[2][1]) + (mat1[2][3] * mat2[3][1]);
|
||||
product[2][2] = (mat1[2][0] * mat2[0][2]) + (mat1[2][1] * mat2[1][2]) + (mat1[2][2] * mat2[2][2]) + (mat1[2][3] * mat2[3][2]);
|
||||
product[2][3] = (mat1[2][0] * mat2[0][3]) + (mat1[2][1] * mat2[1][3]) + (mat1[2][2] * mat2[2][3]) + (mat1[2][3] * mat2[3][3]);
|
||||
product[3][0] = (mat1[3][0] * mat2[0][0]) + (mat1[3][1] * mat2[1][0]) + (mat1[3][2] * mat2[2][0]) + (mat1[3][3] * mat2[3][0]);
|
||||
product[3][1] = (mat1[3][0] * mat2[0][1]) + (mat1[3][1] * mat2[1][1]) + (mat1[3][2] * mat2[2][1]) + (mat1[3][3] * mat2[3][1]);
|
||||
product[3][2] = (mat1[3][0] * mat2[0][2]) + (mat1[3][1] * mat2[1][2]) + (mat1[3][2] * mat2[2][2]) + (mat1[3][3] * mat2[3][2]);
|
||||
product[3][3] = (mat1[3][0] * mat2[0][3]) + (mat1[3][1] * mat2[1][3]) + (mat1[3][2] * mat2[2][3]) + (mat1[3][3] * mat2[3][3]);
|
||||
mtxf_copy_n_element((s32 *)dest, (s32 *)product, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -946,7 +990,7 @@ UNUSED f32 func_802B79F0(f32 arg0, f32 arg1) {
|
||||
}
|
||||
|
||||
UNUSED u16 func_802B7B50(f32 arg0, f32 arg1) {
|
||||
return ((func_802B79B8(arg0, arg1) * 32768.0f) / 3.141592653589793);
|
||||
return ((func_802B79B8(arg0, arg1) * 32768.0f) / M_PI);
|
||||
}
|
||||
|
||||
UNUSED void func_802B7C18(f32 arg0) {
|
||||
@@ -970,7 +1014,7 @@ f32 func_802B7CE8(f32 arg0) {
|
||||
}
|
||||
|
||||
UNUSED s16 func_802B7D28(f32 arg0) {
|
||||
return func_802B79B8(sqrtf(1.0 - (f64)(arg0 * arg0)), arg0) * 32768.0f / 3.141592653589793;
|
||||
return func_802B79B8(sqrtf(1.0 - (f64)(arg0 * arg0)), arg0) * 32768.0f / M_PI;
|
||||
}
|
||||
|
||||
u16 random_u16(void) {
|
||||
@@ -1009,18 +1053,18 @@ s16 func_802B7F34(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
|
||||
return atan2s(arg2 - arg0, arg3 - arg1);
|
||||
}
|
||||
|
||||
void func_802B7F7C(Vec3f arg0, Vec3f arg1, Vec3s arg2) {
|
||||
f32 temp_f14 = arg0[0];
|
||||
f32 sp28 = arg0[1];
|
||||
f32 temp_f12 = arg0[2];
|
||||
void func_802B7F7C(Vec3f arg0, Vec3f arg1, Vec3s dest) {
|
||||
f32 x1 = arg0[0];
|
||||
f32 y1 = arg0[1];
|
||||
f32 z1 = arg0[2];
|
||||
|
||||
f32 temp_f2 = arg1[0];
|
||||
f32 sp1C = arg1[1];
|
||||
f32 temp_f0 = arg1[2];
|
||||
f32 x2 = arg1[0];
|
||||
f32 y2 = arg1[1];
|
||||
f32 z2 = arg1[2];
|
||||
|
||||
arg2[1] = func_802B7F34(temp_f12, temp_f14, temp_f0, temp_f2);
|
||||
arg2[0] = func_802B7F34(sp28, temp_f12, sp1C, temp_f0);
|
||||
arg2[2] = func_802B7F34(temp_f14, sp28, temp_f2, sp1C);
|
||||
dest[1] = func_802B7F34(z1, x1, z2, x2);
|
||||
dest[0] = func_802B7F34(y1, z1, y2, z2);
|
||||
dest[2] = func_802B7F34(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
f32 sins(u16 arg0) {
|
||||
@@ -1113,7 +1157,7 @@ f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY
|
||||
}
|
||||
|
||||
// No idea if arg1 is actually a Mat4 or not, but since this function is unused
|
||||
// its impossible to know with certainty either way
|
||||
// its impossible to know with certainty either way, very close of func_802B5D64
|
||||
UNUSED void func_802B8414(uintptr_t arg0, Mat4 arg1, s16 arg2, s16 arg3, s32 arg4) {
|
||||
UNUSED s32 pad[3];
|
||||
Vec3f sp40;
|
||||
|
||||
+13
-12
@@ -22,31 +22,32 @@ u32 get_angle_between_points(Vec3f, Vec3f);
|
||||
u32 func_802B5258(Vec3f, Vec3s);
|
||||
void vec3f_set(Vec3f, f32, f32, f32);
|
||||
void vec3s_set(Vec3s, s16, s16, s16);
|
||||
void *vec3f_copy(Vec3f, Vec3f);
|
||||
void *vec3f_copy_return(Vec3f, Vec3f);
|
||||
void vec3s_copy(Vec3s, Vec3s);
|
||||
void func_802B5350(Mat4, Mat4);
|
||||
void func_802B5398(s32*, s32*, s32);
|
||||
void *vec3f_set_return(Vec3f, f32, f32, f32);
|
||||
void mtxf_copy(Mat4, Mat4);
|
||||
void mtxf_copy_n_element(s32*, s32*, s32);
|
||||
void mtxf_identity(Mat4);
|
||||
void func_802B5450(Mat4, Mat4, Vec3f);
|
||||
void add_translate_mat4_vec3f(Mat4, Mat4, Vec3f);
|
||||
void add_translate_mat4_vec3f_lite(Mat4, Mat4, Vec3f);
|
||||
void mtxf_translate(Mat4, Vec3f);
|
||||
void func_802B5564(Mat4, u16*, f32, f32, f32, f32, f32);
|
||||
void func_802B5794(Mat4, Vec3f, Vec3f);
|
||||
void func_802B59DC(Mat4, s16);
|
||||
void func_802B5A44(Mat4, s16);
|
||||
void func_802B5AAC(Mat4, s16);
|
||||
void mtxf_rotate_x(Mat4, s16);
|
||||
void mtxf_rotate_y(Mat4, s16);
|
||||
void mtxf_s16_rotate_z(Mat4, s16);
|
||||
void func_802B5CAC(s16, s16, Vec3f);
|
||||
void func_802B5D30(s16, s16, s32);
|
||||
void func_802B5D64(uintptr_t, s16, s16, s32);
|
||||
void func_802B5F00(Mat4, f32);
|
||||
void mtxf_scale(Mat4, f32);
|
||||
void func_802B5F74(Mat4, Vec3f, Vec3s);
|
||||
void func_802B63B8(Vec3f, Mat3);
|
||||
void func_802B6434(Vec3f, Mat4);
|
||||
void mtxf_translate_vec3f_mat3(Vec3f, Mat3);
|
||||
void mtxf_translate_vec3f_mat4(Vec3f, Mat4);
|
||||
void func_802B64C4(Vec3f, s16);
|
||||
void func_802B6540(Mat3, f32, f32, f32, s16);
|
||||
void func_802B6A84(Mat3, s16, f32, f32, f32);
|
||||
void func_802B6BC0(Mat4, s16, f32, f32, f32);
|
||||
void func_802B6D58(Mat4, Vec3f, Vec3f);
|
||||
void func_802B71CC(Mat4, Mat4, Mat4);
|
||||
void mtxf_multiplication(Mat4, Mat4, Mat4);
|
||||
void mtxf_to_mtx(Mtx*, Mat4);
|
||||
u16 atan2_lookup(f32, f32);
|
||||
u16 atan2s(f32, f32);
|
||||
|
||||
@@ -465,11 +465,11 @@ void func_802A4A0C(Vtx *vtx, struct UnkStruct_800DC5EC *arg1, UNUSED s32 arg2, U
|
||||
sp5C[2] = 30000.0f;
|
||||
func_802B5564(matrix1, &sp128, camera->unk_B4, D_80150148, D_80150150, D_8015014C, 1.0f);
|
||||
func_802B5794(matrix2, camera->pos, camera->lookAt);
|
||||
func_802B71CC(matrix3, matrix1, matrix2);
|
||||
mtxf_multiplication(matrix3, matrix1, matrix2);
|
||||
|
||||
sp58 = ((matrix3[0][3] * sp5C[0]) + (matrix3[1][3] * sp5C[1]) + (matrix3[2][3] * sp5C[2])) + matrix3[3][3];
|
||||
|
||||
func_802B6434(sp5C, matrix3);
|
||||
mtxf_translate_vec3f_mat4(sp5C, matrix3);
|
||||
|
||||
temp_f0 = (1.0 / sp58);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user