summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-09-17 04:52:44 +0200
committerTreeki <treeki@gmail.com>2011-09-17 04:52:44 +0200
commit52e163c30e6506d940ff2bcadc5ce01dee81f1dc (patch)
tree392a8ed543f911a981ebc989eb3d8cf430ad7f1f
parent2e5620782692b2830e6d9e7bf8642f0b69275a16 (diff)
downloadkamek-52e163c30e6506d940ff2bcadc5ce01dee81f1dc.tar.gz
kamek-52e163c30e6506d940ff2bcadc5ce01dee81f1dc.zip
added mMtx class and a few methods to m3d::mdl_c
Diffstat (limited to '')
-rw-r--r--include/g3dhax.h3
-rwxr-xr-xinclude/game.h45
-rw-r--r--kamek_ntsc.x5
-rw-r--r--kamek_ntsc2.x5
-rw-r--r--kamek_pal.x5
-rw-r--r--kamek_pal2.x5
6 files changed, 66 insertions, 2 deletions
diff --git a/include/g3dhax.h b/include/g3dhax.h
index ac5ba80..d816a24 100644
--- a/include/g3dhax.h
+++ b/include/g3dhax.h
@@ -202,6 +202,9 @@ namespace m3d {
void sub_80064BF0();
void setDrawMatrix(const Mtx matrix);
+ void setScale(float x, float y, float z);
+ void setScale(Vec *scale);
+ void calcWorld(bool unk);
char data[0x3C];
};
diff --git a/include/game.h b/include/game.h
index 7382c34..93d8ae1 100755
--- a/include/game.h
+++ b/include/game.h
@@ -77,7 +77,6 @@ bool IsWideScreen();
#define GAMEMGR_GET_AFC(gmgr) (*((bool*)(((u32)(gmgr))+0xAFC)))
-
#define COND_COIN1 1
#define COND_COIN2 2
#define COND_COIN3 4
@@ -331,6 +330,48 @@ public:
};
+
+class mMtx {
+ Mtx data;
+
+ public:
+ mMtx(float _00, float _01, float _02, float _03,
+ float _10, float _11, float _12, float _13,
+ float _20, float _21, float _22, float _23);
+
+ float* operator[](int row) { return data[row]; }
+
+ operator MtxPtr() const { return (MtxPtr)this; }
+
+ /* Create New Ones */
+ void identity();
+
+ void translation(float x, float y, float z) { MTXTrans(data, x, y, z); }
+ void scale(float x, float y, float z) { MTXScale(data, x, y, z); }
+
+ void rotationX(s16 *amount);
+ void rotationY(s16 *amount);
+ void rotationZ(s16 *amount);
+
+ /* Applied Manipulations */
+ void applyTranslation(float x, float y, float z) { MTXTransApply(data, data, x, y, z); }
+ void applyScale(float x, float y, float z) { MTXScaleApply(data, data, x, y, z); }
+
+ void applyRotationX(s16 *amount);
+ void applyRotationY(s16 *amount);
+ void applyRotationZ(s16 *amount);
+
+ void applyRotationYXZ(s16 *x, s16 *y, s16 *z);
+ void applyRotationZYX(s16 *x, s16 *y, s16 *z);
+
+ /* Get Stuff */
+ void getTranslation(Vec *target);
+
+ void getUnknown(S16Vec *target);
+};
+
+
+
namespace nw4r {
namespace ut {
@@ -1271,7 +1312,7 @@ public:
class dActor_c : public dBase_c {
public:
LinkListEntry link_actor;
- Mtx matrix;
+ mMtx matrix;
Vec pos;
Vec last_pos;
Vec pos_delta;
diff --git a/kamek_ntsc.x b/kamek_ntsc.x
index 4a7a35d..5f7042a 100644
--- a/kamek_ntsc.x
+++ b/kamek_ntsc.x
@@ -511,6 +511,9 @@ SECTIONS {
oneSetupType__Q23m3d5mdl_cFv = 0x80064C10;
sub_80064BF0__Q23m3d5mdl_cFv = 0x80064BF0;
setDrawMatrix__Q23m3d5mdl_cFPA4_Cf = 0x8016A170;
+ setScale__Q23m3d5mdl_cFfff = 0x8016A130;
+ setScale__Q23m3d5mdl_cFP7Point3d = 0x8016A150;
+ calcWorld__Q23m3d5mdl_cFb = 0x8016A1A0;
SetupTextures_Player__FPQ23m3d5mdl_ci = 0x800B3E50;
SetupTextures_Map__FPQ23m3d5mdl_ci = 0x800B3F50;
@@ -846,6 +849,8 @@ SECTIONS {
VIGetNextField = 0x801BDEE0;
+ applyRotationYXZ__4mMtxFPsPsPs = 0x8016EF50;
+
PSMTXIdentity = 0x801C04D0;
PSMTXCopy = 0x801C0500;
PSMTXConcat = 0x801C0540;
diff --git a/kamek_ntsc2.x b/kamek_ntsc2.x
index d59089a..95523f8 100644
--- a/kamek_ntsc2.x
+++ b/kamek_ntsc2.x
@@ -511,6 +511,9 @@ SECTIONS {
oneSetupType__Q23m3d5mdl_cFv = 0x80064C10;
sub_80064BF0__Q23m3d5mdl_cFv = 0x80064BF0;
setDrawMatrix__Q23m3d5mdl_cFPA4_Cf = 0x8016A170;
+ setScale__Q23m3d5mdl_cFfff = 0x8016A130;
+ setScale__Q23m3d5mdl_cFP7Point3d = 0x8016A150;
+ calcWorld__Q23m3d5mdl_cFb = 0x8016A1A0;
SetupTextures_Player__FPQ23m3d5mdl_ci = 0x800B3E50;
SetupTextures_Map__FPQ23m3d5mdl_ci = 0x800B3F50;
@@ -846,6 +849,8 @@ SECTIONS {
VIGetNextField = 0x801BDEE0;
+ applyRotationYXZ__4mMtxFPsPsPs = 0x8016EF50;
+
PSMTXIdentity = 0x801C04D0;
PSMTXCopy = 0x801C0500;
PSMTXConcat = 0x801C0540;
diff --git a/kamek_pal.x b/kamek_pal.x
index b910118..c9d0095 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -511,6 +511,9 @@ SECTIONS {
oneSetupType__Q23m3d5mdl_cFv = 0x80064C10;
sub_80064BF0__Q23m3d5mdl_cFv = 0x80064BF0;
setDrawMatrix__Q23m3d5mdl_cFPA4_Cf = 0x8016A2B0;
+ setScale__Q23m3d5mdl_cFfff = 0x8016A270;
+ setScale__Q23m3d5mdl_cFP7Point3d = 0x8016A290;
+ calcWorld__Q23m3d5mdl_cFb = 0x8016A2E0;
SetupTextures_Player__FPQ23m3d5mdl_ci = 0x800B3E50;
SetupTextures_Map__FPQ23m3d5mdl_ci = 0x800B3F50;
@@ -846,6 +849,8 @@ SECTIONS {
VIGetNextField = 0x801BE020;
+ applyRotationYXZ__4mMtxFPsPsPs = 0x8016F090;
+
PSMTXIdentity = 0x801C0610;
PSMTXCopy = 0x801C0640;
PSMTXConcat = 0x801C0680;
diff --git a/kamek_pal2.x b/kamek_pal2.x
index 87ce78f..a499f36 100644
--- a/kamek_pal2.x
+++ b/kamek_pal2.x
@@ -511,6 +511,9 @@ SECTIONS {
oneSetupType__Q23m3d5mdl_cFv = 0xDEADBEEF;
sub_80064BF0__Q23m3d5mdl_cFv = 0xDEADBEEF;
setDrawMatrix__Q23m3d5mdl_cFPA4_Cf = 0xDEADBEEF;
+ setScale__Q23m3d5mdl_cFfff = 0xDEADBEEF;
+ setScale__Q23m3d5mdl_cFP7Point3d = 0xDEADBEEF;
+ calcWorld__Q23m3d5mdl_cFb = 0xDEADBEEF;
SetupTextures_Player__FPQ23m3d5mdl_ci = 0xDEADBEEF;
SetupTextures_Map__FPQ23m3d5mdl_ci = 0xDEADBEEF;
@@ -846,6 +849,8 @@ SECTIONS {
VIGetNextField = 0xDEADBEEF;
+ applyRotationYXZ__4mMtxFPsPsPs = 0xDEADBEEF;
+
PSMTXIdentity = 0xDEADBEEF;
PSMTXCopy = 0xDEADBEEF;
PSMTXConcat = 0xDEADBEEF;