SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
MultiSceneActor.cpp
1#include "Game/Scene/MultiSceneActor.hpp"
2#include "Game/LiveActor/Spine.hpp"
3#include "Game/Util/MtxUtil.hpp"
4#include <JSystem/JGeometry/TMatrix.hpp>
5#include <JSystem/J3DGraphAnimator/J3DModel.hpp>
6
7MultiSceneActor::MultiSceneActor(const char *pName, const char *pModelName, bool a3) : NameObj(pName) {
8 mTranslation.x = 0.0f;
9 mTranslation.y = 0.0f;
10 mTranslation.z = 0.0f;
11 mRotation.x = 0.0f;
12 mRotation.y = 0.0f;
13 mRotation.z = 0.0f;
14 mScale.x = 1.0f;
15 mScale.y = 1.0f;
16 mScale.z = 1.0f;
17 _30 = true;
18 mModelMgr = nullptr;
19 mEffectSystem = nullptr;
20 mEffectKeeper = nullptr;
21 mNerve = nullptr;
22 mModelMgr = new ModelManager();
23 mModelMgr->init(pModelName, nullptr, a3);
24}
25
27
28}
29
30void MultiSceneActor::movement() {
31 if (!_30) {
32 mModelMgr->update();
33
34 if (mNerve != nullptr) {
35 mNerve->update();
36 }
37
38 if (!_30) {
39 control();
40 }
41 }
42}
43
44void MultiSceneActor::calcAnim() {
45 if (!_30) {
46 TMtx34f mtx;
47 mtx.identity();
48 MR::makeMtxTR(mtx.toMtxPtr(), mTranslation, mRotation);
49 PSMTXCopy(mtx.toMtxPtr(), mModelMgr->getJ3DModel()->_24);
50 J3DModel* model = mModelMgr->getJ3DModel();
51 model->_18 = mScale.x;
52 model->_1C = mScale.y;
53 model->_20 = mScale.z;
54 mModelMgr->calcAnim();
55 }
56}
57
58void MultiSceneActor::calcViewAndEntry() {
59 if (!_30) {
60 mModelMgr->calcView();
61 mModelMgr->entry();
62 }
63}
64
65void MultiSceneActor::appear() {
66 _30 = false;
67 calcAnim();
68}
69
70void MultiSceneActor::initEffect(EffectSystem* pSystem, int unk, const char *pName) {
71 mEffectSystem = pSystem;
72 mEffectKeeper = new MultiSceneEffectKeeper(mName, mModelMgr, unk, pName);
73 mEffectKeeper->init(this, pSystem);
74}
75
76void MultiSceneActor::setNerve(const Nerve *pNerve) {
77 mNerve->setNerve(pNerve);
78}
79
80bool MultiSceneActor::isNerve(const Nerve *pNerve) const {
81 return mNerve->getCurrentNerve() == pNerve;
82}
83
84void MultiSceneActor::initNerve(const Nerve *pNerve) {
85 mNerve = new Spine(this, pNerve);
86}
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
The most basic form of an object.
Definition NameObj.hpp:11
const char * mName
A string to identify the NameObj.
Definition NameObj.hpp:38
Used for executing states of a LiveActor.
Definition Nerve.hpp:6
Definition Spine.hpp:9