summaryrefslogtreecommitdiff
path: root/include/egg
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-03-16 18:55:59 +0100
committerrobojumper <robojumper@gmail.com>2025-03-16 22:18:01 +0100
commit540abd8cd172a114dd24e7721b5e15c8a442dc49 (patch)
tree2f0e60b2272f84e595f406eade2a834935a95c27 /include/egg
parent82939548fb6eba7cbc9286078119778bb8d535c6 (diff)
Parts of ModelEx
Diffstat (limited to 'include/egg')
-rw-r--r--include/egg/gfx/eggModelEx.h61
1 files changed, 60 insertions, 1 deletions
diff --git a/include/egg/gfx/eggModelEx.h b/include/egg/gfx/eggModelEx.h
index 9fc2283b..5ef3fdb3 100644
--- a/include/egg/gfx/eggModelEx.h
+++ b/include/egg/gfx/eggModelEx.h
@@ -1,6 +1,65 @@
#ifndef EGG_MODEL_EX_H
#define EGG_MODEL_EX_H
-namespace EGG {} // namespace EGG
+#include "common.h"
+#include "egg/egg_types.h"
+#include "nw4r/g3d/g3d_scnobj.h"
+#include "nw4r/g3d/res/g3d_resmdl.h"
+namespace EGG {
+
+class ModelEx {
+public:
+ enum EType {
+ cType_ScnMdlSimple,
+ cType_ScnMdl,
+ cType_ScnMdl1Mat1Shp,
+ cType_ScnProcModel,
+ cType_ScnRfl,
+ cType_None
+ };
+
+ enum EFlag {
+ cFlag_HasOriginalBV = (1 << 0)
+ };
+
+ enum EDrawShape {
+ cDrawShape_None = (1 << 0)
+ };
+
+private:
+ nw4r::g3d::ScnObj *mScnObj; // at 0x0
+ EType mType; // at 0x4
+ u16 mFlag; // at 0x8
+ ModelBoundingInfo *mpBoundingInfo; // at 0xC
+
+ static u32 sDrawFlag;
+ static const char *sByteCodeCalcStr;
+ static const char *sByteCodeMixStr;
+
+public:
+ ModelEx(nw4r::g3d::ScnObj *);
+ void getShapeMinMax(u16, nw4r::math::VEC3 *, nw4r::math::VEC3 *, bool);
+ void calcWorld(nw4r::math::MTX34 *, const nw4r::math::MTX34 *worldMtx) const;
+ nw4r::g3d::ResMdl getResMdl(u16) const;
+ nw4r::g3d::ResShp getResShp(u16) const;
+
+ nw4r::g3d::ScnMdl *getScnMdl() const {
+ return (mType == cType_ScnMdl) ? (nw4r::g3d::ScnMdl *)mScnObj : NULL;
+ }
+
+ nw4r::g3d::ScnMdlSimple *getScnMdlSimple() const {
+ return (mType == cType_ScnMdlSimple || mType == cType_ScnMdl) ? (nw4r::g3d::ScnMdlSimple *)mScnObj : NULL;
+ }
+
+ nw4r::g3d::ScnMdl1Mat1Shp *getScnMdl1Mat1Shp() const {
+ return (mType == cType_ScnMdl1Mat1Shp) ? (nw4r::g3d::ScnMdl1Mat1Shp *)mScnObj : NULL;
+ }
+
+ void getMtxType0(nw4r::math::MTX34 *pMtx) const {
+ nw4r::math::MTX34Copy(pMtx, mScnObj->GetMtxPtr(nw4r::g3d::ScnObj::MTX_LOCAL));
+ }
+};
+
+} // namespace EGG
#endif