1#include "Game/MapObj/CollapsePlane.hpp"
3CollapsePlane::CollapsePlane(
const char *pName) :
MapObjActor(pName) {
4 mScaleController =
nullptr;
5 mStarPointerBind =
nullptr;
6 mJointController =
nullptr;
14 info.setupHioNode(
"地形オブジェ");
15 info.setupDefaultPos();
16 info.setupConnectToScene();
17 info.setupHitSensor();
19 info.setupProjmapMtx(
false);
20 info.setupNerve(&NrvCollapsePlane::CollapsePlaneNrvWait::sInstance);
21 initialize(rIter, info);
22 initEffectKeeper(1,
nullptr,
false);
27 MR::initStarPointerTarget(
this, (200.0f *
mScale.x), offs);
29 mScaleController->setParamTight();
31 mJointController = MR::createJointDelegatorWithNullChildFunc(
this, &CollapsePlane::calcJointPlane,
"Plane");
32 MR::initCollisionPartsAutoEqualScale(
this,
"Move",
getSensor(
nullptr), MR::getJointMtx(
this,
"Plane"));
33 MR::validateCollisionParts(
this);
34 MR::getJMapInfoArg0NoInit(rIter, &mTimer);
37void CollapsePlane::exeWait() {
38 if (MR::isOnPlayer(
this)) {
40 setNerve(&NrvCollapsePlane::CollapsePlaneNrvCollapse::sInstance);
44void CollapsePlane::exeCollapse() {
46 MR::startSound(
this,
"SE_OJ_COLLAPSE_PLANE_SHRINK", -1, -1);
50 MR::hideMaterial(
this,
"PlaneMat_v");
51 MR::invalidateCollisionParts(
this);
52 MR::emitEffect(
this,
"Vanish");
53 MR::startSound(
this,
"SE_OJ_COLLAPSE_PLANE_VANISH", -1, -1);
55 setNerve(&NrvCollapsePlane::CollapsePlaneNrvEnd::sInstance);
62void CollapsePlane::exeDPDStop() {
63 if (_D0 == -1 && MR::isOnPlayer(
this)) {
67 if (MR::updateActorState(
this, mStarPointerBind)) {
69 setNerve(&NrvCollapsePlane::CollapsePlaneNrvWait::sInstance);
72 setNerve(&NrvCollapsePlane::CollapsePlaneNrvCollapse::sInstance);
81 mJointController->registerCallBack();
84 if (MR::isInitializeStateEnd()) {
86 new_scale.multPS(mScaleController->_C,
mScale);
87 MR::setBaseScale(
this, new_scale);
91void CollapsePlane::control() {
92 mScaleController->updateNerve();
97 f32 new_scale = (1.0f - ((0.69999999f * _D0)) / mTimer);
100 MR::preScaleMtx(mtx.toMtxPtr(), new_scale, 1.0f, new_scale);
108bool CollapsePlane::tryDPDStop() {
109 if (isNerve(&NrvCollapsePlane::CollapsePlaneNrvDPDStop::sInstance)) {
113 if (isNerve(&NrvCollapsePlane::CollapsePlaneNrvEnd::sInstance)) {
117 if (!mStarPointerBind->tryStartPointBind()) {
121 setNerve(&NrvCollapsePlane::CollapsePlaneNrvDPDStop::sInstance);
125namespace NrvCollapsePlane {
126 INIT_NERVE(CollapsePlaneNrvWait);
127 INIT_NERVE(CollapsePlaneNrvCollapse);
128 INIT_NERVE(CollapsePlaneNrvDPDStop);
129 INIT_NERVE(CollapsePlaneNrvEnd);
132CollapsePlane::~CollapsePlane() {
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.
TVec3f mPosition
3D vector of the actor's position.
TVec3f mScale
3D vector of the actor's scale.
HitSensor * getSensor(const char *pSensorName) const
Gets a sensor.
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.