SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
LargeChainParts.cpp
1#include "Game/MapObj/LargeChainParts.hpp"
2
3LargeChainParts::LargeChainParts(const char *pName) : LiveActor(pName) {
4
5}
6
7void LargeChainParts::breakChainParts() {
8 kill();
9}
10
11void LargeChainParts::initChainParts(TVec3f *pPos, TVec3f *pRot, TVec3f *pScale, bool isFixedPoint) {
12 mPosition.set(*pPos);
13 mRotation.set(*pRot);
14 mScale.set(*pScale);
15
16 if (isFixedPoint) {
17 initModelManagerWithAnm("LargeChainFixPoint", nullptr, false);
18 }
19 else {
20 initModelManagerWithAnm("LargeChain", nullptr, false);
21 }
22
23 MR::connectToSceneMapObj(this);
24 initHitSensor(1);
25 MR::addBodyMessageSensorMapObj(this);
26 if (isFixedPoint) {
27 MR::initCollisionParts(this, "LargeChainFixPoint", getSensor("body"), nullptr);
28 }
29 else {
30 MR::initCollisionParts(this, "LargeChain", getSensor("body"), nullptr);
31 }
32
33 initEffectKeeper(0, "LargeChain", false);
34 initSound(2, false);
35 makeActorAppeared();
36}
37
38void LargeChainParts::kill() {
39 MR::emitEffect(this, "Break");
40 MR::startSound(this, "SE_OJ_LARGE_CHAIN_BREAK", -1, -1);
41 LiveActor::kill();
42}
The basis of a drawable actor that can contain states (see: Nerve)
Definition LiveActor.hpp:24
TVec3f mRotation
3D vector of the actor's rotation.
Definition LiveActor.hpp:96
TVec3f mPosition
3D vector of the actor's position.
Definition LiveActor.hpp:95
TVec3f mScale
3D vector of the actor's scale.
Definition LiveActor.hpp:97
HitSensor * getSensor(const char *pSensorName) const
Gets a sensor.