From b815e1dcdbe200b62dc113706cf6203df847fd4e Mon Sep 17 00:00:00 2001 From: Fuzzy2319 Date: Wed, 29 Jan 2025 15:40:40 +0100 Subject: [PATCH 1/5] add:WheelMapParts partial implementation # Conflicts: # data/odyssey_functions.csv --- data/odyssey_functions.csv | 8 ++-- lib/al/Library/MapObj/WheelMapParts.cpp | 59 +++++++++++++++++++++++++ lib/al/Library/MapObj/WheelMapParts.h | 33 ++++++++++++++ lib/al/Library/Movement/WheelMovement.h | 50 +++++++++++++++++++++ 4 files changed, 146 insertions(+), 4 deletions(-) create mode 100644 lib/al/Library/MapObj/WheelMapParts.cpp create mode 100644 lib/al/Library/MapObj/WheelMapParts.h create mode 100644 lib/al/Library/Movement/WheelMovement.h diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 003e70fba..83d1a1ead 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -58578,10 +58578,10 @@ Address,Quality,Size,Name 0x000000710091c138,O,000028,_ZNK2al10FunctorV0MIPNS_21VisibleSwitchMapPartsEMS1_FvvEEclEv 0x000000710091c154,O,000076,_ZNK2al10FunctorV0MIPNS_21VisibleSwitchMapPartsEMS1_FvvEE5cloneEv 0x000000710091c1a0,O,000004,_ZN2al10FunctorV0MIPNS_21VisibleSwitchMapPartsEMS1_FvvEED0Ev -0x000000710091c1a4,U,000152,_ZN2al13WheelMapPartsC2EPKc -0x000000710091c23c,U,000164,_ZN2al13WheelMapPartsC1EPKc -0x000000710091c2e0,U,000224,_ZN2al13WheelMapParts4initERKNS_13ActorInitInfoE -0x000000710091c3c0,U,000196,_ZN2al13WheelMapParts7controlEv +0x000000710091c1a4,O,000152,_ZN2al13WheelMapPartsC2EPKc +0x000000710091c23c,O,000164,_ZN2al13WheelMapPartsC1EPKc +0x000000710091c2e0,O,000224,_ZN2al13WheelMapParts4initERKNS_13ActorInitInfoE +0x000000710091c3c0,O,000196,_ZN2al13WheelMapParts7controlEv 0x000000710091c484,U,000244,_ZN2al13WheelMapParts10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_ 0x000000710091c578,U,000056,_ZN2al13WheelMapParts17appearAndSetStartEv 0x000000710091c5b0,U,000116,_ZN2al13WheelMapParts7exeWaitEv diff --git a/lib/al/Library/MapObj/WheelMapParts.cpp b/lib/al/Library/MapObj/WheelMapParts.cpp new file mode 100644 index 000000000..b601c38bc --- /dev/null +++ b/lib/al/Library/MapObj/WheelMapParts.cpp @@ -0,0 +1,59 @@ +#include "Library/MapObj/WheelMapParts.h" + +#include "Library/Area/SwitchKeepOnAreaGroup.h" +#include "Library/Area/SwitchOnAreaGroup.h" +#include "Library/Effect/EffectSystemInfo.h" +#include "Library/LiveActor/ActorAreaFunction.h" +#include "Library/LiveActor/ActorInitFunction.h" +#include "Library/LiveActor/ActorPoseKeeper.h" +#include "Library/MapObj/ChildStep.h" +#include "Library/Math/VectorUtil.h" +#include "Library/Movement/WheelMovement.h" +#include "Library/Nerve/NerveSetupUtil.h" + +namespace { +using namespace al; + +NERVE_ACTION_IMPL(WheelMapParts, Wait) +NERVE_ACTION_IMPL(WheelMapParts, Move) +NERVE_ACTION_IMPL(WheelMapParts, AssistStop) + +NERVE_ACTIONS_MAKE_STRUCT(WheelMapParts, Wait, Move, AssistStop) +} // namespace + +namespace al { +WheelMapParts::WheelMapParts(const char* name) : LiveActor(name) {} + +void WheelMapParts::init(const ActorInitInfo& info) { + tryInitSubActorKeeperChildStep(this, info); + initNerveAction(this, "Wait", &NrvWheelMapParts.mCollector, 0); + initMapPartsActor(this, info, nullptr); + tryGetQuatPtr(this); + registerAreaHostMtx(this, info); + + mWheelMovement = new WheelMovement(this, info); + + initMaterialCode(this, info); + trySetEffectNamedMtxPtr(this, "Surface", &mSurfaceEffectMtx); + createChildStep(info, this, true); + + mSwitchKeepOnAreaGroup = tryCreateSwitchKeepOnAreaGroup(this, info); + mSwitchOnAreaGroup = tryCreateSwitchOnAreaGroup(this, info); + + trySyncStageSwitchAppear(this); +} + +void WheelMapParts::control() { + sead::Vector3f moveDir = mWheelMovement->getMoveDir(); + if (mWheelMovement->get_50() < 0.0f) + moveDir *= -1; + + makeMtxUpFrontPos(&mSurfaceEffectMtx, sead::Vector3f::ey, moveDir, getTrans(this)); + + if (mSwitchKeepOnAreaGroup != nullptr) + mSwitchKeepOnAreaGroup->update(getTrans(this)); + + if (mSwitchOnAreaGroup != nullptr) + mSwitchOnAreaGroup->update(getTrans(this)); +} +} // namespace al diff --git a/lib/al/Library/MapObj/WheelMapParts.h b/lib/al/Library/MapObj/WheelMapParts.h new file mode 100644 index 000000000..a5cfbd8ba --- /dev/null +++ b/lib/al/Library/MapObj/WheelMapParts.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Library/LiveActor/LiveActor.h" + +namespace al { +class WheelMovement; +class SwitchKeepOnAreaGroup; +class SwitchOnAreaGroup; + +class WheelMapParts : public LiveActor { +public: + WheelMapParts(const char* name); + + void init(const ActorInitInfo& info) override; + void control() override; + bool receiveMsg(const SensorMsg* message, HitSensor* other, HitSensor* self) override; + + void appearAndSetStart(); + + void exeWait(); + void exeMove(); + void exeAssistStop(); + +private: + sead::Matrix34f mSurfaceEffectMtx = sead::Matrix34f::ident; + WheelMovement* mWheelMovement = nullptr; + SwitchKeepOnAreaGroup* mSwitchKeepOnAreaGroup = nullptr; + SwitchOnAreaGroup* mSwitchOnAreaGroup = nullptr; + s32 _150 = 0; +}; + +static_assert(sizeof(WheelMapParts) == 0x158); +} // namespace al diff --git a/lib/al/Library/Movement/WheelMovement.h b/lib/al/Library/Movement/WheelMovement.h new file mode 100644 index 000000000..849d2f2a8 --- /dev/null +++ b/lib/al/Library/Movement/WheelMovement.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include + +#include "Library/Math/Axis.h" +#include "Library/Nerve/NerveExecutor.h" + +namespace al { +class LiveActor; +class ActorInitInfo; +class SensorMsg; +class HitSensor; + +class WheelMovement : public NerveExecutor { +public: + WheelMovement(LiveActor* actor, const ActorInitInfo& info); + + bool receiveMsg(LiveActor* actor, const SensorMsg* message, HitSensor* other, HitSensor* self); + void update(LiveActor* actor); + void updateRotate(); + void updateActorPoseAndTrans(LiveActor* actor); + void reset(); + void reset(LiveActor* actor); + + const sead::Vector3f& getMoveDir() const { return mMoveDir; } + + f32 get_50() const { return _50; } + +private: + sead::Quatf _10 = sead::Quatf::unit; + sead::Quatf _20 = sead::Quatf::unit; + sead::Vector3f mMoveDir = sead::Vector3f::ez; + Axis mRotateAxis = Axis::None; + f32 mMoveEndDegree = 360.0f; + f32 _44 = 0.0f; + f32 _48 = 0.0f; + f32 mRotateAccel = 20.0f; + f32 _50 = 0.0f; + f32 _54 = 0.0f; + f32 mNoRotateWidth = 25.0f; + f32 _5c = 0.0f; + f32 _60 = 0.0f; + bool _64 = false; + bool mIsRailPlusDir = true; + bool _66 = false; +}; + +static_assert(sizeof(WheelMovement) == 0x68); +} // namespace al From a72f621363f23825baa7bb85908424365b383308 Mon Sep 17 00:00:00 2001 From: Fuzzy2319 Date: Fri, 31 Jan 2025 10:06:22 +0100 Subject: [PATCH 2/5] add:WheelMapParts implementation, add:WheelMovement ctor implementation && add:WheelMapParts to the factory --- data/odyssey_functions.csv | 30 ++++---- .../Library/LiveActor/ActorMovementFunction.h | 1 + lib/al/Library/MapObj/WheelMapParts.cpp | 76 +++++++++++++++++++ lib/al/Library/MapObj/WheelMapParts.h | 2 +- lib/al/Library/Movement/WheelMovement.cpp | 44 +++++++++++ lib/al/Library/Movement/WheelMovement.h | 4 + lib/al/Library/Rail/RailUtil.h | 6 +- src/Scene/ProjectActorFactory.cpp | 3 +- 8 files changed, 147 insertions(+), 19 deletions(-) create mode 100644 lib/al/Library/Movement/WheelMovement.cpp diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index 83d1a1ead..765c78a9b 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -30484,7 +30484,7 @@ Address,Quality,Size,Name 0x00000071004bd388,O,000052,_ZN2al19createActorFunctionINS_18SwitchOpenMapPartsEEEPNS_9LiveActorEPKc 0x00000071004bd3bc,O,000052,_ZN2al19createActorFunctionINS_21VisibleSwitchMapPartsEEEPNS_9LiveActorEPKc 0x00000071004bd3f0,U,000052,_ZN2al19createActorFunctionI16WaveSurfMapPartsEEPNS_9LiveActorEPKc -0x00000071004bd424,U,000052,_ZN2al19createActorFunctionINS_13WheelMapPartsEEEPNS_9LiveActorEPKc +0x00000071004bd424,O,000052,_ZN2al19createActorFunctionINS_13WheelMapPartsEEEPNS_9LiveActorEPKc 0x00000071004bd458,U,000052,_ZN2al19createActorFunctionINS_14WobbleMapPartsEEEPNS_9LiveActorEPKc 0x00000071004bd48c,U,000052,_ZN2al19createActorFunctionI16WindBlowMapPartsEEPNS_9LiveActorEPKc 0x00000071004bd4c0,U,000052,_ZN2al19createActorFunctionI5YoshiEEPNS_9LiveActorEPKc @@ -58582,18 +58582,18 @@ Address,Quality,Size,Name 0x000000710091c23c,O,000164,_ZN2al13WheelMapPartsC1EPKc 0x000000710091c2e0,O,000224,_ZN2al13WheelMapParts4initERKNS_13ActorInitInfoE 0x000000710091c3c0,O,000196,_ZN2al13WheelMapParts7controlEv -0x000000710091c484,U,000244,_ZN2al13WheelMapParts10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_ -0x000000710091c578,U,000056,_ZN2al13WheelMapParts17appearAndSetStartEv -0x000000710091c5b0,U,000116,_ZN2al13WheelMapParts7exeWaitEv -0x000000710091c624,U,000200,_ZN2al13WheelMapParts7exeMoveEv -0x000000710091c6ec,U,000036,_ZN2al13WheelMapParts13exeAssistStopEv -0x000000710091c710,U,000116, -0x000000710091c784,U,000012, -0x000000710091c790,U,000008, -0x000000710091c798,U,000012, -0x000000710091c7a4,U,000040, -0x000000710091c7cc,U,000012, -0x000000710091c7d8,U,000116, +0x000000710091c484,O,000244,_ZN2al13WheelMapParts10receiveMsgEPKNS_9SensorMsgEPNS_9HitSensorES5_ +0x000000710091c578,O,000056,_ZN2al13WheelMapParts17appearAndSetStartEv +0x000000710091c5b0,O,000116,_ZN2al13WheelMapParts7exeWaitEv +0x000000710091c624,O,000200,_ZN2al13WheelMapParts7exeMoveEv +0x000000710091c6ec,O,000036,_ZN2al13WheelMapParts13exeAssistStopEv +0x000000710091c710,O,000116,_ZNK12_GLOBAL__N_120WheelMapPartsNrvWait7executeEPN2al11NerveKeeperE +0x000000710091c784,O,000012,_ZNK12_GLOBAL__N_120WheelMapPartsNrvWait13getActionNameEv +0x000000710091c790,O,000008,_ZNK12_GLOBAL__N_120WheelMapPartsNrvMove7executeEPN2al11NerveKeeperE +0x000000710091c798,O,000012,_ZNK12_GLOBAL__N_120WheelMapPartsNrvMove13getActionNameEv +0x000000710091c7a4,O,000040,_ZNK12_GLOBAL__N_126WheelMapPartsNrvAssistStop7executeEPN2al11NerveKeeperE +0x000000710091c7cc,O,000012,_ZNK12_GLOBAL__N_126WheelMapPartsNrvAssistStop13getActionNameEv +0x000000710091c7d8,O,000116,_GLOBAL__sub_I_WheelMapParts.cpp 0x000000710091c84c,U,000276,_ZN2al14WobbleMapPartsC2EPKc 0x000000710091c960,U,000288,_ZN2al14WobbleMapPartsC1EPKc 0x000000710091ca80,U,000252,_ZN2al14WobbleMapParts4initERKNS_13ActorInitInfoE @@ -59968,14 +59968,14 @@ Address,Quality,Size,Name 0x0000007100956bb0,O,000036,_ZN2al13SwingMovementD0Ev 0x0000007100956bd4,O,000080,_ZNK12_GLOBAL__N_120SwingMovementNrvMove7executeEPN2al11NerveKeeperE 0x0000007100956c24,O,000068,_ZNK12_GLOBAL__N_120SwingMovementNrvStop7executeEPN2al11NerveKeeperE -0x0000007100956c68,U,000688,_ZN2al13WheelMovementC1EPNS_9LiveActorERKNS_13ActorInitInfoE +0x0000007100956c68,O,000688,_ZN2al13WheelMovementC1EPNS_9LiveActorERKNS_13ActorInitInfoE 0x0000007100956f18,U,000264,_ZN2al13WheelMovement10receiveMsgEPNS_9LiveActorEPKNS_9SensorMsgEPNS_9HitSensorES7_ 0x0000007100957020,U,000128,_ZN2al13WheelMovement6updateEPNS_9LiveActorE 0x00000071009570a0,U,000552,_ZN2al13WheelMovement12updateRotateEv 0x00000071009572c8,U,000124,_ZN2al13WheelMovement23updateActorPoseAndTransEPNS_9LiveActorE 0x0000007100957344,U,000100,_ZN2al13WheelMovement5resetEv 0x00000071009573a8,U,000192,_ZN2al13WheelMovement5resetEPNS_9LiveActorE -0x0000007100957468,U,000036,_ZN2al13WheelMovementD0Ev +0x0000007100957468,O,000036,_ZN2al13WheelMovementD0Ev 0x000000710095748c,U,000032,_ZN2al17FireSurfaceFinderC2EPKNS_9LiveActorE 0x00000071009574ac,U,000228,_ZN2al17FireSurfaceFinder6updateERKN4sead7Vector3IfEES5_f 0x0000007100957590,U,000052,_ZN2al14NatureDirectorC2Ev diff --git a/lib/al/Library/LiveActor/ActorMovementFunction.h b/lib/al/Library/LiveActor/ActorMovementFunction.h index 2ef91a0ec..bb784db49 100644 --- a/lib/al/Library/LiveActor/ActorMovementFunction.h +++ b/lib/al/Library/LiveActor/ActorMovementFunction.h @@ -186,6 +186,7 @@ void rotateQuatZDirDegree(LiveActor* actor, f32); void rotateQuatZDirDegree(LiveActor* actor, const sead::Quatf&, f32); void rotateQuatLocalDirDegree(LiveActor* actor, s32, f32); void rotateQuatLocalDirDegree(LiveActor* actor, const sead::Quatf&, s32, f32); +void rotateQuatLocalDirDegree(sead::Quatf* out, const sead::Quatf&, s32, f32); void rotateQuatYDirRandomDegree(LiveActor* actor); void rotateQuatYDirRandomDegree(LiveActor* actor, const sead::Quatf&); void turnQuatFrontToDirDegreeH(LiveActor* actor, const sead::Vector3f&, f32); diff --git a/lib/al/Library/MapObj/WheelMapParts.cpp b/lib/al/Library/MapObj/WheelMapParts.cpp index b601c38bc..b156396d1 100644 --- a/lib/al/Library/MapObj/WheelMapParts.cpp +++ b/lib/al/Library/MapObj/WheelMapParts.cpp @@ -3,13 +3,18 @@ #include "Library/Area/SwitchKeepOnAreaGroup.h" #include "Library/Area/SwitchOnAreaGroup.h" #include "Library/Effect/EffectSystemInfo.h" +#include "Library/LiveActor/ActorActionFunction.h" #include "Library/LiveActor/ActorAreaFunction.h" #include "Library/LiveActor/ActorInitFunction.h" +#include "Library/LiveActor/ActorModelFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" +#include "Library/LiveActor/ActorSensorMsgFunction.h" #include "Library/MapObj/ChildStep.h" +#include "Library/Math/MathLengthUtil.h" #include "Library/Math/VectorUtil.h" #include "Library/Movement/WheelMovement.h" #include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Se/SeFunction.h" namespace { using namespace al; @@ -56,4 +61,75 @@ void WheelMapParts::control() { if (mSwitchOnAreaGroup != nullptr) mSwitchOnAreaGroup->update(getTrans(this)); } + +bool WheelMapParts::receiveMsg(const SensorMsg* message, HitSensor* other, HitSensor* self) { + if (isMsgTouchAssist(message)) { + mAssistStopTimer = 45; + if (!isNerve(this, NrvWheelMapParts.AssistStop.data())) + startNerveAction(this, "AssistStop"); + + return true; + } + + if (mWheelMovement->receiveMsg(this, message, other, self)) + return true; + + if (isMsgShowModel(message)) { + showModelIfHide(this); + + return true; + } + + if (isMsgHideModel(message)) { + hideModelIfShow(this); + + return true; + } + + if (isMsgRestart(message)) { + appearAndSetStart(); + + return true; + } + + return false; +} + +void WheelMapParts::appearAndSetStart() { + mAssistStopTimer = 0; + mWheelMovement->reset(this); + + makeActorAlive(); +} + +void WheelMapParts::exeWait() { + mWheelMovement->update(this); + + if (mWheelMovement->get_66()) + startHitReaction(this, "端点接触"); + + if (!isNearZero(mWheelMovement->get_48(), 0.2f)) + startNerveAction(this, "Move"); +} + +void WheelMapParts::exeMove() { + mWheelMovement->update(this); + + if (mWheelMovement->get_66()) + startHitReaction(this, "端点接触"); + + f32 fVar3 = mWheelMovement->get_48(); + if (isNearZero(fVar3, 0.2f)) + startNerveAction(this, "Wait"); + else + tryHoldSeWithParam(this, "Rotate", sead::Mathf::abs(fVar3), "回転速度"); +} + +void WheelMapParts::exeAssistStop() { + mAssistStopTimer--; + if (mAssistStopTimer <= 0) { + mAssistStopTimer = 0; + startNerveAction(this, "Wait"); + } +} } // namespace al diff --git a/lib/al/Library/MapObj/WheelMapParts.h b/lib/al/Library/MapObj/WheelMapParts.h index a5cfbd8ba..4cee0f435 100644 --- a/lib/al/Library/MapObj/WheelMapParts.h +++ b/lib/al/Library/MapObj/WheelMapParts.h @@ -26,7 +26,7 @@ class WheelMapParts : public LiveActor { WheelMovement* mWheelMovement = nullptr; SwitchKeepOnAreaGroup* mSwitchKeepOnAreaGroup = nullptr; SwitchOnAreaGroup* mSwitchOnAreaGroup = nullptr; - s32 _150 = 0; + s32 mAssistStopTimer = 0; }; static_assert(sizeof(WheelMapParts) == 0x158); diff --git a/lib/al/Library/Movement/WheelMovement.cpp b/lib/al/Library/Movement/WheelMovement.cpp new file mode 100644 index 000000000..121cfeaa5 --- /dev/null +++ b/lib/al/Library/Movement/WheelMovement.cpp @@ -0,0 +1,44 @@ +#include "Library/Movement/WheelMovement.h" + +#include "Library/LiveActor/ActorMovementFunction.h" +#include "Library/LiveActor/LiveActor.h" +#include "Library/Math/MathAngleUtil.h" +#include "Library/Math/MathUtil.h" +#include "Library/Placement/PlacementFunction.h" +#include "Library/Rail/RailUtil.h" + +namespace al { +WheelMovement::WheelMovement(LiveActor* actor, const ActorInitInfo& info) + : NerveExecutor("車輪動作計算") { + tryGetArg((s32*)&mRotateAxis, info, "\"車輪動作計算\""); + tryGetArg(&mRotateAccel, info, "RotateAccel"); + tryGetArg(&mMoveEndDegree, info, "MoveEndDegree"); + tryGetArg(&mNoRotateWidth, info, "NoRotateWidth"); + + getQuat(&_20, info); + _10 = _20; + + sead::Vector3f local_80 = sead::Vector3f::ex; + calcQuatLocalAxis(&local_80, _20, (s32)mRotateAxis); + + mMoveDir.setCross(local_80, sead::Vector3f::ey); + if (isNearZero(mMoveDir, 0.001f)) + mMoveDir = sead::Vector3f::ez; + + if (isExistRail(actor)) { + setSyncRailToNearestPos(actor); + _64 = true; + mIsRailPlusDir = isRailPlusDir(actor, mMoveDir); + f32 railProgress = getRailCoord(actor) / getRailTotalLength(actor); + _5c = railProgress; + _60 = railProgress; + + if (mIsRailPlusDir) + _44 = railProgress * mMoveEndDegree; + else + _44 = -(railProgress * mMoveEndDegree); + + rotateQuatLocalDirDegree(&_10, _20, (s32)mRotateAxis, modf(_44 + 360.0f, 360.0f) + 0.0f); + } +} +} // namespace al diff --git a/lib/al/Library/Movement/WheelMovement.h b/lib/al/Library/Movement/WheelMovement.h index 849d2f2a8..fbcedaae2 100644 --- a/lib/al/Library/Movement/WheelMovement.h +++ b/lib/al/Library/Movement/WheelMovement.h @@ -25,8 +25,12 @@ class WheelMovement : public NerveExecutor { const sead::Vector3f& getMoveDir() const { return mMoveDir; } + f32 get_48() const { return _48; } + f32 get_50() const { return _50; } + bool get_66() const { return _66; } + private: sead::Quatf _10 = sead::Quatf::unit; sead::Quatf _20 = sead::Quatf::unit; diff --git a/lib/al/Library/Rail/RailUtil.h b/lib/al/Library/Rail/RailUtil.h index a7951d27f..bcba351dc 100644 --- a/lib/al/Library/Rail/RailUtil.h +++ b/lib/al/Library/Rail/RailUtil.h @@ -20,7 +20,9 @@ bool isExistRail(const IUseRail* railHolder); void setRailClippingInfo(sead::Vector3f*, LiveActor* actor, f32, f32); bool isRailReachedGoal(const IUseRail* railHolder); bool isRailReachedEnd(const IUseRail* railHolder); -PlacementInfo* getRailPointInfo(const IUseRail* rail, s32 index); +PlacementInfo* getRailPointInfo(const IUseRail* railHolder, s32 index); void calcRailPointPos(sead::Vector3f* out, const IUseRail* railHolder, s32 index); -s32 getRailPointNum(const IUseRail* rail); +s32 getRailPointNum(const IUseRail* railHolder); +bool isRailPlusDir(const IUseRail* railHolder, const sead::Vector3f& dir); +f32 getRailTotalLength(const IUseRail* railHolder); } // namespace al diff --git a/src/Scene/ProjectActorFactory.cpp b/src/Scene/ProjectActorFactory.cpp index 55e3f70e3..e7ad10209 100644 --- a/src/Scene/ProjectActorFactory.cpp +++ b/src/Scene/ProjectActorFactory.cpp @@ -23,6 +23,7 @@ #include "Library/MapObj/SwitchDitherMapParts.h" #include "Library/MapObj/SwitchOpenMapParts.h" #include "Library/MapObj/VisibleSwitchMapParts.h" +#include "Library/MapObj/WheelMapParts.h" #include "Library/Obj/AllDeadWatcher.h" #include "Boss/Mofumofu/MofumofuScrap.h" @@ -604,7 +605,7 @@ static al::NameToCreator sProjectActorFactoryEntries[] {"SwitchOpenMapParts", al::createActorFunction}, {"VisibleSwitchMapParts", al::createActorFunction}, {"WaveSurfMapParts", nullptr}, - {"WheelMapParts", nullptr}, + {"WheelMapParts", al::createActorFunction}, {"WobbleMapParts", nullptr}, {"WindBlowMapParts", nullptr}, {"Yoshi", nullptr}, From 92b82d8be15b5ebd45080f8e493e1d33896f9911 Mon Sep 17 00:00:00 2001 From: Fuzzy2319 Date: Fri, 31 Jan 2025 10:15:23 +0100 Subject: [PATCH 3/5] fix:wrong key --- lib/al/Library/Movement/WheelMovement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/al/Library/Movement/WheelMovement.cpp b/lib/al/Library/Movement/WheelMovement.cpp index 121cfeaa5..6377bc9d1 100644 --- a/lib/al/Library/Movement/WheelMovement.cpp +++ b/lib/al/Library/Movement/WheelMovement.cpp @@ -10,7 +10,7 @@ namespace al { WheelMovement::WheelMovement(LiveActor* actor, const ActorInitInfo& info) : NerveExecutor("車輪動作計算") { - tryGetArg((s32*)&mRotateAxis, info, "\"車輪動作計算\""); + tryGetArg((s32*)&mRotateAxis, info, "RotateAxis"); tryGetArg(&mRotateAccel, info, "RotateAccel"); tryGetArg(&mMoveEndDegree, info, "MoveEndDegree"); tryGetArg(&mNoRotateWidth, info, "NoRotateWidth"); From 9541bae095d2448e636f0c2d1a197006b6b0c5fc Mon Sep 17 00:00:00 2001 From: Fuzzy2319 Date: Sat, 1 Feb 2025 16:17:52 +0100 Subject: [PATCH 4/5] fix:requested changes --- lib/al/Library/Movement/WheelMovement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/al/Library/Movement/WheelMovement.cpp b/lib/al/Library/Movement/WheelMovement.cpp index 6377bc9d1..c4965e4da 100644 --- a/lib/al/Library/Movement/WheelMovement.cpp +++ b/lib/al/Library/Movement/WheelMovement.cpp @@ -18,10 +18,10 @@ WheelMovement::WheelMovement(LiveActor* actor, const ActorInitInfo& info) getQuat(&_20, info); _10 = _20; - sead::Vector3f local_80 = sead::Vector3f::ex; - calcQuatLocalAxis(&local_80, _20, (s32)mRotateAxis); + sead::Vector3f localRotateAxis = sead::Vector3f::ex; + calcQuatLocalAxis(&localRotateAxis, _20, (s32)mRotateAxis); - mMoveDir.setCross(local_80, sead::Vector3f::ey); + mMoveDir.setCross(localRotateAxis, sead::Vector3f::ey); if (isNearZero(mMoveDir, 0.001f)) mMoveDir = sead::Vector3f::ez; From f70b14fde3bc0fa558c213f3bd98b31675c0653f Mon Sep 17 00:00:00 2001 From: Fuzzy2319 Date: Sat, 1 Feb 2025 16:25:16 +0100 Subject: [PATCH 5/5] fix:rebase branch --- lib/al/Library/MapObj/WheelMapParts.cpp | 4 ++-- lib/al/Library/Movement/WheelMovement.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/al/Library/MapObj/WheelMapParts.cpp b/lib/al/Library/MapObj/WheelMapParts.cpp index b156396d1..8ddce74dd 100644 --- a/lib/al/Library/MapObj/WheelMapParts.cpp +++ b/lib/al/Library/MapObj/WheelMapParts.cpp @@ -10,8 +10,8 @@ #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" #include "Library/MapObj/ChildStep.h" -#include "Library/Math/MathLengthUtil.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" +#include "Library/Matrix/MatrixUtil.h" #include "Library/Movement/WheelMovement.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Se/SeFunction.h" diff --git a/lib/al/Library/Movement/WheelMovement.cpp b/lib/al/Library/Movement/WheelMovement.cpp index c4965e4da..43b3e3969 100644 --- a/lib/al/Library/Movement/WheelMovement.cpp +++ b/lib/al/Library/Movement/WheelMovement.cpp @@ -1,8 +1,6 @@ #include "Library/Movement/WheelMovement.h" -#include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/LiveActor.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Placement/PlacementFunction.h" #include "Library/Rail/RailUtil.h"