SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
ModelObj.cpp
1#include "Game/LiveActor/ModelObj.hpp"
2#include "Game/Util.hpp"
3
4ModelObj::ModelObj(const char *pName, const char *pModelName, MtxPtr mtxPtr, int a4, int a5, int a6, bool a7) : LiveActor(pName) {
5 mMtx = mtxPtr;
6
7 if (a4 < -1) {
8 a4 = 0x8;
9 }
10
11 if (a5 < -1) {
12 a5 = 0x23;
13 }
14
15 if (a6 < -1) {
16 a6 = 0xB;
17 }
18
19 initModelManagerWithAnm(pModelName, 0, a7);
20 MR::connectToScene(this, a5, a6, a4, -1);
21 initSound(8, 0);
22 initEffectKeeper(8, 0, 0);
23
24 if (mMtx) {
25 mPosition.set(mMtx[0][3], mMtx[1][3], mMtx[2][3]);
26 }
27}
28
30 makeActorAppeared();
31}
32
34 if (mMtx) {
35 mPosition.set(mMtx[0][3], mMtx[1][3], mMtx[2][3]);
36 MR::setBaseTRMtx(this, mMtx);
37 }
38 else {
40 }
41}
42
43void ModelObjNpc::control() {
44 mLODCtrl->update();
45 mJointCtrl->update();
46}
47
48void ModelObjNpc::init(const JMapInfoIter &rIter) {
49 mLODCtrl = MR::createLodCtrlNPC(this, rIter);
50 mJointCtrl = new ActorJointCtrl(this);
51 makeActorAppeared();
52}
53
55 if (mMtx) {
56 mPosition.set(mMtx[0][3], mMtx[1][3], mMtx[2][3]);
57 MR::setBaseTRMtx(this, mMtx);
58 }
59 else {
61 }
62
63 mJointCtrl->setCallBackFunction();
64}
65
66ModelObjNpc::~ModelObjNpc() {
67
68}
69
70ModelObjNpc::ModelObjNpc(const char *a1, const char *a2, MtxPtr mtx) : LiveActor(a1) {
71 mMtx = mtx;
72 mLODCtrl = 0;
73 mJointCtrl = 0;
74
75 if (mtx) {
76 mPosition.set(mMtx[0][3], mMtx[1][3], mMtx[2][3]);
77 }
78
79 initModelManagerWithAnm(a2, 0, 0);
80 MR::connectToSceneNpc(this);
81 MR::initShadowFromCSV(this, "Shadow");
82 initSound(8, false);
83 initEffectKeeper(8, 0, false);
84}
The basis of a drawable actor that can contain states (see: Nerve)
Definition LiveActor.hpp:24
TVec3f mPosition
3D vector of the actor's position.
Definition LiveActor.hpp:95
virtual void calcAndSetBaseMtx()
Calculates and sets the base matrix of the actor.
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition ModelObj.cpp:29
virtual void calcAndSetBaseMtx()
Calculates and sets the base matrix of the actor.
Definition ModelObj.cpp:33
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition ModelObj.cpp:48
virtual void calcAndSetBaseMtx()
Calculates and sets the base matrix of the actor.
Definition ModelObj.cpp:54