diff --git a/include/Actor/LiveActor/LiveActor.h b/include/Actor/LiveActor/LiveActor.h index 528fb8ea..8f6a86a8 100644 --- a/include/Actor/LiveActor/LiveActor.h +++ b/include/Actor/LiveActor/LiveActor.h @@ -8,6 +8,7 @@ #include "Actor/LiveActor/LiveActorFlag.h" #include "Actor/NameObj/NameObj.h" #include "Actor/Nerve/Spine.h" +#include "Actor/Rail/RailRider.h" #include "Actor/Sensor/HitSensor.h" #include "Actor/Sensor/HitSensorKeeper.h" #include "Actor/Shadow/ShadowController.h" @@ -59,7 +60,9 @@ public: void initNerve(const Nerve *); void initHitSensor(s32); void initBinder(f32, f32, u32); - + void initRailRider(const JMapInfoIter &); + void initEffectKeeper(s32, const char *, bool); + void initSound(s32, bool); void initShadowControllerList(u32); void initStageSwitch(const JMapInfoIter &); void initActorStarPointerTarget(f32, const JGeometry::TVec3 *, Mtx *, JGeometry::TVec3); @@ -77,7 +80,7 @@ public: Spine* mSpine; // _50 HitSensorKeeper* mSensorKeeper; //_54 Binder* mBinder; // _58 - u32* _5C; // RailRider* + RailRider* mRailRider; // _5C EffectKeeper* mEffectKeeper; // _60 u32* _64; // AudSoundObject* LiveActorFlag mFlags; // _68 diff --git a/include/Actor/Rail/RailRider.h b/include/Actor/Rail/RailRider.h new file mode 100644 index 00000000..baf8a8fb --- /dev/null +++ b/include/Actor/Rail/RailRider.h @@ -0,0 +1,36 @@ +#ifndef RAILRIDER_H +#define RAILRIDER_H + +#include "JGeometry/TVec3.h" +#include "JMap/JMapInfoIter.h" +#include "Map/Rail/BezierRail.h" + +class RailRider +{ +public: + RailRider(const JMapInfoIter &); + RailRider(s32, s32); + + void move(); + void moveToNearestPos(const JGeometry::TVec3 &); + void moveToNearestPoint(const JGeometry::TVec3 &); + void moveToNextPoint(); + void reverse(); + + bool isReachedGoal() const; + bool isReachedEdge() const; + void setCoord(f32); + void setSpeed(f32); + + BezierRail* mBezierRail; // _0 + f32 _4; + f32 mSpeed; // _8 + u32 _C; + JGeometry::TVec3 _10; + JGeometry::TVec3 _1C; + JGeometry::TVec3 _28; + JGeometry::TVec3 _34; + s32 _40; +}; + +#endif // RAILRIDER_H \ No newline at end of file diff --git a/include/MR/actor/LiveActorUtil.h b/include/MR/actor/LiveActorUtil.h index f31ed995..063f56b4 100644 --- a/include/MR/actor/LiveActorUtil.h +++ b/include/MR/actor/LiveActorUtil.h @@ -2,6 +2,7 @@ #define LIVEACTORUTIL_H #include "types.h" +#include "System/Resource/ResourceHolder.h" class LiveActor; @@ -29,6 +30,8 @@ namespace MR void updateLightCtrl(LiveActor *); void setBaseTRMtx(LiveActor *, Mtx); + + ResourceHolder* getModelResourceHolder(const LiveActor *); }; #endif // LIVEACTORUTIL_H \ No newline at end of file diff --git a/include/Map/Rail/BezierRail.h b/include/Map/Rail/BezierRail.h new file mode 100644 index 00000000..1934df40 --- /dev/null +++ b/include/Map/Rail/BezierRail.h @@ -0,0 +1,14 @@ +#ifndef BEZIERRAIL_H +#define BEZIERRAIL_H + +#include "JMap/JMapInfo.h" +#include "JMap/JMapInfoIter.h" +#include "Map/Rail/RailPart.h" + +class BezierRail +{ +public: + BezierRail(const JMapInfoIter &, const JMapInfo *); +}; + +#endif // BEZIERRAIL_H \ No newline at end of file diff --git a/include/Map/Rail/RailPart.h b/include/Map/Rail/RailPart.h new file mode 100644 index 00000000..bd4b26e0 --- /dev/null +++ b/include/Map/Rail/RailPart.h @@ -0,0 +1,15 @@ +#ifndef RAILPART_H +#define RAILPART_H + +#include "types.h" + +class RailPart +{ +public: + RailPart(); + + u32 _0; + u32 _4; +}; + +#endif // RAILPART_H \ No newline at end of file diff --git a/source/Actor/LiveActor/LiveActor.cpp b/source/Actor/LiveActor/LiveActor.cpp index c8042348..9509b1c9 100644 --- a/source/Actor/LiveActor/LiveActor.cpp +++ b/source/Actor/LiveActor/LiveActor.cpp @@ -40,7 +40,7 @@ LiveActor::LiveActor(const char *name) : NameObj(name) this->mSpine = 0; this->mSensorKeeper = 0; this->mBinder = 0; - this->_5C = 0; + this->mRailRider = 0; this->mEffectKeeper = 0; this->_64 = 0; @@ -449,6 +449,33 @@ void LiveActor::initBinder(f32 a1, f32 a2, u32 a3) } } +void LiveActor::initRailRider(const JMapInfoIter &iter) +{ + this->mRailRider = new RailRider(iter); +} + +void LiveActor::initEffectKeeper(s32 effectCount, const char *resName, bool enableSort) +{ + const char* objName = this->mName; + ResourceHolder* holder = MR::getModelResourceHolder(this); + EffectKeeper* effectKeeper = new EffectKeeper(objName, holder, effectCount, resName); + this->mEffectKeeper = effectKeeper; + + if (enableSort) + { + effectKeeper->enableSort(); + } + + this->mEffectKeeper->init(this); + + if (this->mBinder != 0) + { + this->mEffectKeeper->setBinder(this->mBinder); + } +} + +// LiveActor::initSound() + void LiveActor::initShadowControllerList(u32 listNum) { this->mShadowController = new ShadowControllerList(this, listNum);