SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
MirrorReflectionModel.cpp
1#include "Game/LiveActor/MirrorReflectionModel.hpp"
2#include "Game/NameObj/NameObjExecuteHolder.hpp"
3
4MirrorReflectionModel::MirrorReflectionModel(const LiveActor *pActor, const char *pName, const char *pInternalName, MtxPtr mtx) : LiveActor(pName) {
5 _8C = pActor;
6 _90 = mtx;
7 _94 = 0;
8
9 if (mtx) {
10 TPos3f pos;
11 pos.set(mtx);
12 pos.getTrans(mPosition);
13 }
14 else {
15 mPosition.set(pActor->mPosition);
16 }
17
18 mRotation.set(_8C->mRotation);
19 mScale.set(_8C->mScale);
20 initModelManagerWithAnm(pInternalName, nullptr, false);
21 MR::connectToSceneMirrorMapObjDecoration(this);
22}
23
25 MR::invalidateClipping(this);
26 MR::registerDemoSimpleCastAll(this);
27 makeActorAppeared();
28 _94 = 0;
29}
30
31void MirrorReflectionModel::movement() {
32 if (MR::isDead(_8C) || MR::isClipped(_8C) || MR::isHiddenModel(_8C)) {
33 if (!_94) {
34 _94 = 1;
35
36 if (!MR::isHiddenModel(this)) {
37 MR::disconnectToDrawTemporarily(this);
38 }
39 }
40 }
41 else {
42 if (_94) {
43 _94 = 0;
44 if (!MR::isHiddenModel(this)) {
45 MR::connectToDrawTemporarily(this);
46 }
47 }
48
49 LiveActor::movement();
50 }
51}
52
53void MirrorReflectionModel::calcAnim() {
54 if (!_94) {
55 if (!MR::isDead(this)) {
56 if (MR::isNoCalcAnim(this) || MR::isClipped(this)) {
57 return;
58 }
59
60 LiveActor::calcAnim();
61 }
62 }
63}
64
65void MirrorReflectionModel::calcViewAndEntry() {
66 if (!_94) {
67 LiveActor::calcViewAndEntry();
68 }
69}
70
72 if (!_90) {
74 }
75 else {
76 TPos3f pos;
77 pos.set(_90);
78 pos.getTrans(mPosition);
79 MR::setBaseTRMtx(this, _90);
80 }
81}
82
83MirrorReflectionModel::~MirrorReflectionModel() {
84
85}
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.
virtual void calcAndSetBaseMtx()
Calculates and sets the base matrix of the actor.