1#include "Game/MapObj/WatchTowerRotateStep.hpp"
2#include "Game/Util.hpp"
5NrvWatchTowerRotateStep::WatchTowerRotateStepNrvWait NrvWatchTowerRotateStep::WatchTowerRotateStepNrvWait::sInstance;
6NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMoveStart NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMoveStart::sInstance;
7NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMove NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMove::sInstance;
9WatchTowerRotateStep::WatchTowerRotateStep(
const char *pName) :
LiveActor(pName) {
17 MR::initDefaultPos(
this, rIter);
18 initModelManagerWithAnm(
"WatchTowerRotateStep",
nullptr,
false);
19 MR::connectToSceneMapObj(
this);
22 MR::addBodyMessageSensorMapObj(
this);
23 MR::initCollisionParts(
this,
"WatchTowerRotateStep",
getSensor(
nullptr),
nullptr);
24 initEffectKeeper(0,
nullptr,
false);
26 MR::setClippingTypeSphereContainsModelBoundingBox(
this, 1500.0f);
28 bool demoCast = MR::tryRegisterDemoCast(
this, rIter);
31 MR::registerDemoActionNerve(
this, &NrvWatchTowerRotateStep::WatchTowerRotateStepNrvWait::sInstance,
nullptr);
34 MR::calcUpVec(&mRotDeg,
this);
38 initNerve(&NrvWatchTowerRotateStep::WatchTowerRotateStepNrvWait::sInstance);
41 initNerve(&NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMove::sInstance);
51 MR::calcFrontVec(&frontVec,
this);
52 MR::makeMtxFrontUpPos(&baseMtx, frontVec, mRotDeg,
mPosition);
53 MR::setBaseTRMtx(
this, baseMtx);
56void WatchTowerRotateStep::initLift(
const JMapInfoIter &rIter) {
59 for (s32 i = 0; i < 4; i++) {
60 MtxPtr mtx = MR::getJointMtx(
this, i + 1);
61 mLifts[i] =
new PartsModel(
this,
"物見の塔リフト",
"WatchTowerRotateStepLift", mtx, -1,
false);
62 mLifts[i]->mCalcOwnMtx =
false;
64 MR::initCollisionParts(mLifts[i],
"WatchTowerRotateStepLift",
getSensor(
nullptr),
nullptr);
65 TVec3f local68 = CALL_INLINE_FUNC(TVec3f, 600.0f, 200.0f, 400.0f);
66 MR::initShadowVolumeBox(mLifts[i], local68, mLifts[i]->
getBaseMtx());
67 MR::setShadowVolumeStartDropOffset(mLifts[i],
"WatchTowerRotateStepLift", 300.0f);
68 MR::setShadowDropLength(mLifts[i],
"WatchTowerRotateStepLift", 370.0f);
70 if (MR::isDemoCast(
this,
nullptr)) {
71 MR::tryRegisterDemoCast(mLifts[i], rIter);
80void WatchTowerRotateStep::exeMoveStart() {
83 if (MR::isFirstStep(
this)) {
84 MR::startSystemSE(
"SE_SY_READ_RIDDLE_S", -1, -1);
85 MR::startSound(
this,
"SE_OJ_WATCH_TOWER_START", -1, -1);
88 MR::startLevelSound(
this,
"SE_OJ_LV_WATCH_TOWER_ROTATE", -1, -1, -1);
89 f32 easeIn = MR::getEaseInValue((s32)getNerveStep(), 0.0f, 0.3f, 180.0f);
90 MR::calcFrontVec(&upVec,
this);
91 MR::rotateVecDegree(&mRotDeg, upVec, easeIn);
94 if (MR::isStep(
this, 180)) {
95 setNerve(&NrvWatchTowerRotateStep::WatchTowerRotateStepNrvMove::sInstance);
99namespace NrvWatchTowerRotateStep {
100 void WatchTowerRotateStepNrvMove::execute(
Spine *pSpine)
const {
104 MR::calcFrontVec(&frontVec, pActor);
105 MR::rotateVecDegree(&pActor->mRotDeg, frontVec, 0.3f);
106 pActor->attachLift();
107 MR::startLevelSound(pActor,
"SE_OJ_LV_WATCH_TOWER_ROTATE", -1, -1, -1);
110 void WatchTowerRotateStepNrvMoveStart::execute(
Spine *pSpine)
const {
114 void WatchTowerRotateStepNrvWait::execute(
Spine *pSpine)
const {}
The basis of a drawable actor that can contain states (see: Nerve)
TVec3f mPosition
3D vector of the actor's position.
virtual MtxPtr getBaseMtx() const
Gets the base matrix of the model used for the actor.
HitSensor * getSensor(const char *pSensorName) const
Gets a sensor.
void initWithoutIter()
Initializes a NameObj without a JMapInfoIter instance.
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.