diff options
author | Treeki <treeki@gmail.com> | 2011-09-17 04:52:44 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-09-17 04:52:44 +0200 |
commit | 52e163c30e6506d940ff2bcadc5ce01dee81f1dc (patch) | |
tree | 392a8ed543f911a981ebc989eb3d8cf430ad7f1f /include/game.h | |
parent | 2e5620782692b2830e6d9e7bf8642f0b69275a16 (diff) | |
download | kamek-52e163c30e6506d940ff2bcadc5ce01dee81f1dc.tar.gz kamek-52e163c30e6506d940ff2bcadc5ce01dee81f1dc.zip |
added mMtx class and a few methods to m3d::mdl_c
Diffstat (limited to '')
-rwxr-xr-x | include/game.h | 45 |
1 files changed, 43 insertions, 2 deletions
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;
|