Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/RSBE01_02/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ sora/mt/mt_vector.cpp:
sora/mt/mt_vector_old.cpp:
.text start:0x8003E244 end:0x8003E35C

sora/mt/mt_matrix.cpp:
.text start:0x8003E35C end:0x8003F8FC
.data start:0x8042AE08 end:0x8042AE50
.sdata start:0x8059C788 end:0x8059C790
.sdata2 start:0x805A1728 end:0x805A1740

sora/mt/mt_quat.cpp:
.text start:0x8003F8FC end:0x8003FABC
.sdata2 start:0x805A1740 end:0x805A1748

sora/mt/mt_prng.cpp:
.text start:0x8003FABC end:0x8003FD5C
.ctors start:0x80406510 end:0x80406514
Expand Down
50 changes: 26 additions & 24 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2883,32 +2883,32 @@ angle__5Vec3fCFPC5Vec3f = .text:0x8003DF9C; // type:function size:0xC0
slerp__5Vec3fCFPC5Vec3fP5Vec3ff = .text:0x8003E05C; // type:function size:0x1E8
vlRotateFix__FP5Vec3fQ212vlRotateAxis4Enumf = .text:0x8003E244; // type:function size:0x118
setIdentity__6MatrixFv = .text:0x8003E35C; // type:function size:0x2C
fn_8003E388 = .text:0x8003E388; // type:function size:0x34
fn_8003E3BC = .text:0x8003E3BC; // type:function size:0x5C
mulPos__6MatrixFPC5Vec3fP5Vec3f = .text:0x8003E418; // type:function size:0x54
fn_8003E46C = .text:0x8003E46C; // type:function size:0x54
fn_8003E4C0 = .text:0x8003E4C0; // type:function size:0xF4
fn_8003E5B4 = .text:0x8003E5B4; // type:function size:0x128
fn_8003E6DC = .text:0x8003E6DC; // type:function size:0x14C
fn_8003E828 = .text:0x8003E828; // type:function size:0x54
fn_8003E87C = .text:0x8003E87C; // type:function size:0x9C
fn_8003E918 = .text:0x8003E918; // type:function size:0x9C
fn_8003E9B4 = .text:0x8003E9B4; // type:function size:0x9C
fn_8003EA50 = .text:0x8003EA50; // type:function size:0x4C
fn_8003EA9C = .text:0x8003EA9C; // type:function size:0xAC
copy__6MatrixCFP6Matrix = .text:0x8003E388; // type:function size:0x34
mulVec__6MatrixCFPC5Vec3fP5Vec3f = .text:0x8003E3BC; // type:function size:0x5C
mulPos__6MatrixCFPC5Vec3fP5Vec3f = .text:0x8003E418; // type:function size:0x54
mulPos__6MatrixCFPC5Vec3fPf = .text:0x8003E46C; // type:function size:0x54
setQuat__6MatrixFPCQ34nw4r4math4QUAT = .text:0x8003E4C0; // type:function size:0xF4
normalize__6MatrixFv = .text:0x8003E5B4; // type:function size:0x128
getScale__6MatrixCFP5Vec3f = .text:0x8003E6DC; // type:function size:0x14C
scale__6MatrixCFPC5Vec3fP6Matrix = .text:0x8003E828; // type:function size:0x54
setRotX__6MatrixFf = .text:0x8003E87C; // type:function size:0x9C
setRotY__6MatrixFf = .text:0x8003E918; // type:function size:0x9C
setRotZ__6MatrixFf = .text:0x8003E9B4; // type:function size:0x9C
rotXYZ__6MatrixFPC5Vec3f = .text:0x8003EA50; // type:function size:0x4C
rotX__6MatrixFf = .text:0x8003EA9C; // type:function size:0xAC
rotY__6MatrixFf = .text:0x8003EB48; // type:function size:0xAC
fn_8003EBF4 = .text:0x8003EBF4; // type:function size:0xAC
fn_8003ECA0 = .text:0x8003ECA0; // type:function size:0x178
getRotate__6MatrixFP5Vec3f = .text:0x8003EE18; // type:function size:0x224
fn_8003F03C = .text:0x8003F03C; // type:function size:0x38
fn_8003F074 = .text:0x8003F074; // type:function size:0x88
rotZ__6MatrixFf = .text:0x8003EBF4; // type:function size:0xAC
setRotXYZ__6MatrixFfff = .text:0x8003ECA0; // type:function size:0x178
getRotate__6MatrixCFP5Vec3f = .text:0x8003EE18; // type:function size:0x224
setTrans__6MatrixFfff = .text:0x8003F03C; // type:function size:0x38
trans__6MatrixFfff = .text:0x8003F074; // type:function size:0x88
setSRT__6MatrixFRC5Vec3fRC5Vec3fRC5Vec3f = .text:0x8003F0FC; // type:function size:0x1B0
fn_8003F2AC = .text:0x8003F2AC; // type:function size:0x24C
getSRT__6MatrixCFP5Vec3fP5Vec3fP5Vec3f = .text:0x8003F2AC; // type:function size:0x24C
mul__6MatrixCFPC6MatrixP6Matrix = .text:0x8003F4F8; // type:function size:0xA8
inverse__6MatrixCFP6Matrix = .text:0x8003F5A0; // type:function size:0x2F8
fn_8003F898 = .text:0x8003F898; // type:function size:0x64
mtMtx44Transpose__FPCQ34nw4r4math5MTX44PQ34nw4r4math5MTX44 = .text:0x8003F898; // type:function size:0x64
mtQuatRotAxis__FPQ34nw4r4math4QUATPC5Vec3ff = .text:0x8003F8FC; // type:function size:0xAC
fn_8003F9A8 = .text:0x8003F9A8; // type:function size:0x6C
mtQuatMul__FPCQ34nw4r4math4QUATPCQ34nw4r4math4QUATPQ34nw4r4math4QUAT = .text:0x8003F9A8; // type:function size:0x6C
mtQuatRotVec__FPCQ34nw4r4math4QUATPC5Vec3fP5Vec3f = .text:0x8003FA14; // type:function size:0xA8
init__6mtRandFl = .text:0x8003FABC; // type:function size:0x8
generate__6mtRandFv = .text:0x8003FAC4; // type:function size:0x24
Expand Down Expand Up @@ -17850,7 +17850,9 @@ g_LZEncodedAlertFont = .data:0x80423980; // type:object size:0x7450 noreloc
__vt__15gfMonitorThread = .data:0x8042ADD0; // type:object size:0x10
lbl_8042ADE0 = .data:0x8042ADE0; // type:object size:0x10 data:string
lbl_8042ADF0 = .data:0x8042ADF0; // type:object size:0x18
lbl_8042AE08 = .data:0x8042AE08; // type:object size:0x48
lbl_8042AE08 = .data:0x8042AE08; // type:object size:0x15 scope:local data:string
lbl_8042AE20 = .data:0x8042AE20; // type:object size:0x15 scope:local data:string
lbl_8042AE38 = .data:0x8042AE38; // type:object size:0x15 scope:local data:string
__vt__6mtRand = .data:0x8042AE50; // type:object size:0x1C
lbl_8042AE70 = .data:0x8042AE70; // type:object size:0x40
StageModuleIds = .data:0x8042AEB0; // type:object size:0x6E4 scope:local data:4byte
Expand Down Expand Up @@ -28625,7 +28627,7 @@ lbl_8059C770 = .sdata:0x8059C770; // type:object size:0x8 data:4byte
lbl_8059C778 = .sdata:0x8059C778; // type:object size:0x4 data:4byte
lbl_8059C77C = .sdata:0x8059C77C; // type:object size:0x4 data:4byte
__RTTI__15gfMonitorThread = .sdata:0x8059C780; // type:object size:0x8
lbl_8059C788 = .sdata:0x8059C788; // type:object size:0x8
s_unit01 = .sdata:0x8059C788; // type:object size:0x8 scope:local
lbl_8059C790 = .sdata:0x8059C790; // type:object size:0x5 data:string
lbl_8059C798 = .sdata:0x8059C798; // type:object size:0x8
lbl_8059C7A0 = .sdata:0x8059C7A0; // type:object size:0x8
Expand Down Expand Up @@ -31926,7 +31928,7 @@ lbl_805A1728 = .sdata2:0x805A1728; // type:object size:0x4 align:4 data:float
lbl_805A172C = .sdata2:0x805A172C; // type:object size:0x4 align:4 data:float
lbl_805A1730 = .sdata2:0x805A1730; // type:object size:0x4 align:4 data:float
lbl_805A1734 = .sdata2:0x805A1734; // type:object size:0x4 align:4 data:float
lbl_805A1738 = .sdata2:0x805A1738; // type:object size:0x8 align:4 data:float
lbl_805A1738 = .sdata2:0x805A1738; // type:object size:0x4 align:4 data:float
lbl_805A1740 = .sdata2:0x805A1740; // type:object size:0x4 align:4 data:float
lbl_805A1744 = .sdata2:0x805A1744; // type:object size:0x4 align:4 data:float
@107 = .sdata2:0x805A1748; // type:object size:0x8 scope:local align:8 data:double
Expand Down
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ def NW4RObject(completed, name, **options):
Object(Matching, "sora/gf/gf_resource_loader.cpp"),
Object(Matching, "sora/mt/mt_vector.cpp"),
Object(Matching, "sora/mt/mt_vector_old.cpp"),
Object(Matching, "sora/mt/mt_matrix.cpp"),
Object(Matching, "sora/mt/mt_quat.cpp"),
Object(Matching, "sora/mt/mt_prng.cpp", extra_cflags=["-RTTI off"]),
Object(Matching, "sora/mt/mt_trig.cpp"),
Object(Matching, "sora/mt/mt_prng_log.cpp"),
Expand Down
25 changes: 22 additions & 3 deletions include/Brawl/Include/mt/mt_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,34 @@ class Matrix : public nw4r::math::MTX34 {
}

void setIdentity();
void setSRT(const Vec3f& p1, const Vec3f& p2, const Vec3f& p3);
void copy(Matrix* outMatrix) const;
void mulVec(const Vec3f* vec, Vec3f* outVec) const;
void mulPos(const Vec3f* pos, Vec3f* outVec) const;
void mulPos(const Vec3f* pos, float* outVec) const;
void setQuat(const nw4r::math::QUAT* quat);
void normalize();
void getScale(Vec3f* outScale) const;
void scale(const Vec3f* scale, Matrix* outMatrix) const;
void setRotX(float angle);
void setRotY(float angle);
void setRotZ(float angle);
void rotXYZ(const Vec3f* rot);
void rotX(float angle);
void rotY(float angle);
void rotZ(float angle);
void setRotXYZ(float x, float y, float z);
void getRotate(Vec3f* outRot) const;
void setTrans(float x, float y, float z);
void trans(float x, float y, float z);
void setSRT(const Vec3f& scale, const Vec3f& rot, const Vec3f& trans);
void getSRT(Vec3f* outScale, Vec3f* outRot, Vec3f* outTrans) const;
inline void rotY(float angle, Matrix* outMatrix) {
*outMatrix = *this;
outMatrix->rotY(angle);

}
void mul(const Matrix* mulMatrix, Matrix* outMatrix) const;
void mulPos(const Vec3f* pos, Vec3f* outVec);
void inverse(Matrix* outMatrix) const;
void getRotate(Vec3f* outRot);

inline void getPosition(Vec3f* outPos) {
outPos->m_x = this->m[0][3];
Expand Down Expand Up @@ -59,5 +76,7 @@ class Matrix : public nw4r::math::MTX34 {
};
static_assert(sizeof(Matrix) == 48, "Class is wrong size!");

void mtMtx44Transpose(const nw4r::math::MTX44* mtx, nw4r::math::MTX44* outMtx);
void mtQuatRotAxis(nw4r::math::QUAT* out, const Vec3f* axis, float angle);
void mtQuatMul(const nw4r::math::QUAT* q1, const nw4r::math::QUAT* q2, nw4r::math::QUAT* out);
void mtQuatRotVec(const nw4r::math::QUAT* q, const Vec3f* v, Vec3f* out);
6 changes: 6 additions & 0 deletions include/Brawl/Include/mt/mt_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ class Vec3f {
Vec3f() { }
Vec3f(float x, float y, float z) : m_x(x), m_y(y), m_z(z) { }

void set(float x, float y, float z) {
m_x = x;
m_y = y;
m_z = z;
}

Vec3f& operator=(const Vec3f& orig) {
m_x = orig.m_x;
m_y = orig.m_y;
Expand Down
24 changes: 22 additions & 2 deletions include/RSBE01.lst
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,29 @@ CC008000:WGPIPE
27,1,00000F38:length__5Vec3fFv

// Matrix
8003ee18:getRotate__6MatrixFP5Vec3f
8003eb48:rotY__6MatrixFf
8003e35c:setIdentity__6MatrixFv
8003E388:copy__6MatrixCFP6Matrix
8003E3BC:mulVec__6MatrixCFPC5Vec3fP5Vec3f
8003E418:mulPos__6MatrixCFPC5Vec3fP5Vec3f
8003E46C:mulPos__6MatrixCFPC5Vec3fPf
8003E4C0:setQuat__6MatrixFPCQ34nw4r4math4QUAT
8003E5B4:normalize__6MatrixFv
8003E6DC:getScale__6MatrixCFP5Vec3f
8003E828:scale__6MatrixCFPC5Vec3fP6Matrix
8003E87C:setRotX__6MatrixFf
8003E918:setRotY__6MatrixFf
8003E9B4:setRotZ__6MatrixFf
8003EA50:rotXYZ__6MatrixFPC5Vec3f
8003EA9C:rotX__6MatrixFf
8003eb48:rotY__6MatrixFf
8003EBF4:rotZ__6MatrixFf
8003ECA0:setRotXYZ__6MatrixFfff
8003ee18:getRotate__6MatrixCFP5Vec3f
8003F03C:setTrans__6MatrixFfff
8003F074:trans__6MatrixFfff
8003F2AC:getSRT__6MatrixCFP5Vec3fP5Vec3fP5Vec3f
8003F898:mtMtx44Transpose__FPCQ34nw4r4math5MTX44PQ34nw4r4math5MTX44
8003F9A8:mtQuatMul__FPCQ34nw4r4math4QUATPCQ34nw4r4math4QUATPQ34nw4r4math4QUAT

// mtCommon
8003db08:mtSqrtf__Ff
Expand Down
Loading
Loading