1#include "Game/Map/Sky.hpp"
2#include "Game/LiveActor/MirrorReflectionModel.hpp"
3#include "Game/Map/SpaceInner.hpp"
5NrvSky::HostTypeWait NrvSky::HostTypeWait::sInstance;
6NrvSky::HostTypeChange NrvSky::HostTypeChange::sInstance;
8Sky::Sky(
const char *pSkyName) :
LiveActor(pSkyName) {
14 MR::initDefaultPos(
this, rIter);
15 const char* objectName = 0;
16 MR::getObjectName(&objectName, rIter);
17 initModel(objectName);
18 MR::connectToSceneSky(
this);
19 MR::useStageSwitchReadA(
this, rIter);
20 MR::useStageSwitchReadB(
this, rIter);
21 MR::useStageSwitchReadAppear(
this, rIter);
23 if (MR::isEqualString(objectName,
"SummerSky")) {
27 if (MR::isValidSwitchB(
this)) {
28 void (
Sky::*d)(
void) = &Sky::disappearSpaceInner;
29 void (
Sky::*a)(
void) = &Sky::appearSpaceInner;
30 MR::listenStageSwitchOnOffB(
this, MR::Functor(
this, d), MR::Functor(
this, a));
35 MR::getJMapInfoArg0NoInit(rIter, &arg);
42 MR::tryStartAllAnim(
this, objectName);
44 if (mReflectionModel) {
45 MR::tryStartAllAnim(mReflectionModel, objectName);
48 MR::invalidateClipping(
this);
49 MR::registerDemoSimpleCastAll(
this);
50 initNerve(&NrvSky::HostTypeWait::sInstance);
52 if (MR::isValidSwitchAppear(
this)) {
53 MR::syncStageSwitchAppear(
this);
62 TVec3f pos = MR::getCamPos();
66 LiveActor::calcAnim();
69void Sky::initModel(
const char *pModelName) {
70 initModelManagerWithAnm(pModelName, 0,
false);
74 if (mSpaceInner && MR::isValidSwitchB(
this)) {
75 if (MR::isDead(mSpaceInner)) {
76 MR::showModelIfHidden(
this);
79 if (mSpaceInner->isAppeared()) {
80 MR::hideModelIfHidden(
this);
83 MR::showModelIfHidden(
this);
89void Sky::appearSpaceInner() {
90 if (mSpaceInner && MR::isValidSwitchB(
this)) {
91 mSpaceInner->appear();
95void Sky::disappearSpaceInner() {
96 if (mSpaceInner && MR::isValidSwitchB(
this)) {
97 mSpaceInner->disappear();
101ProjectionMapSky::ProjectionMapSky(
const char *pSkyName) :
Sky(pSkyName) {
113 mMtxSetter->updateMtxUseBaseMtx();
117void ProjectionMapSky::initModel(
const char *pName) {
118 initModelManagerWithAnm(pName, 0,
true);
119 mMtxSetter = MR::initDLMakerProjmapEffectMtxSetter(
this);
120 MR::newDifferedDLBuffer(
this);
121 mMtxSetter->updateMtxUseBaseMtx();
125 void HostTypeChange::execute(
Spine *pSpine)
const {
126 Sky* sky =
reinterpret_cast<Sky*
>(pSpine->mExecutor);
128 if (MR::isFirstStep(sky)) {
129 MR::startAllAnim(sky, cChangeAnimName);
133 void HostTypeWait::execute(
Spine *pSpine)
const {
134 Sky* sky =
reinterpret_cast<Sky*
>(pSpine->mExecutor);
136 if (MR::isValidSwitchA(sky) && MR::isOnSwitchA(sky)) {
137 sky->setNerve(&NrvSky::HostTypeChange::sInstance);
142ProjectionMapSky::~ProjectionMapSky() {
The basis of a drawable actor that can contain states (see: Nerve)
TVec3f mPosition
3D vector of the actor's position.
virtual void calcAndSetBaseMtx()
Calculates and sets the base matrix of the actor.
virtual MtxPtr getBaseMtx() const
Gets the base matrix of the model used for the actor.
void initWithoutIter()
Initializes a NameObj without a JMapInfoIter instance.
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.