diff options
| author | robojumper <robojumper@gmail.com> | 2025-05-25 21:53:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-25 21:53:39 +0200 |
| commit | ae4573a236e59f966ea1197bebd8976ccb09e596 (patch) | |
| tree | 4dcb8e55213ac7c1755a4bbcadf517ccf2d480c6 /src/REL | |
| parent | fd7d30d32283d03a412e8c401d04418351cf686a (diff) | |
| parent | 133ac12fcf28a8b475796169e7e7beb0de99bda5 (diff) | |
Merge pull request #175 from robojumper/d_path
d_path 33%
Diffstat (limited to 'src/REL')
| -rw-r--r-- | src/REL/d/a/npc/d_a_npc_saltalk.cpp | 1 | ||||
| -rw-r--r-- | src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp | 22 | ||||
| -rw-r--r-- | src/REL/d/t/d_t_sound_area.cpp | 8 |
3 files changed, 16 insertions, 15 deletions
diff --git a/src/REL/d/a/npc/d_a_npc_saltalk.cpp b/src/REL/d/a/npc/d_a_npc_saltalk.cpp index 3c608b62..540f34aa 100644 --- a/src/REL/d/a/npc/d_a_npc_saltalk.cpp +++ b/src/REL/d/a/npc/d_a_npc_saltalk.cpp @@ -134,7 +134,6 @@ bool dAcNpcSltk_c::checkSomething(mVec3_c pos) const { } else { mVec3_c dist = pos - position; if (dist.squareMagXZ() <= field_0x758 * field_0x758) { - // TODO reload from position.y here f32 fDist = field_0x75C + position.y; f32 fDist2 = position.y; if (fDist <= fDist2) { diff --git a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp index cdd7d2ec..0a5cdb37 100644 --- a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp @@ -295,7 +295,7 @@ void dAcODungeonShip_c::executeState_Transparency() { u16 idx = fn_485_1900(); if (idx != 0xFFFF) { - mPath.setSegment(idx, 1.0f - mPath.getSegmentFraction()); + mPath.setSegment(idx, 1.0f - mPath.getSegmentTime()); field_0x868 = 900; } } @@ -424,11 +424,12 @@ void dAcODungeonShip_c::eventEnd() { } void dAcODungeonShip_c::fn_485_1660() { - f32 arg = 0.0f; - f32 arg2 = 0.0001f; + f32 time = 0.0f; + f32 speed = 0.0f; + f32 unk = 0.0001f; field_0x856 = 1; - if (mPath.initExt(mPathIdx, roomid, 0, 0, 0, arg, arg, arg2)) { - mPath.setSegment(0, arg); + if (mPath.init(mPathIdx, roomid, 0, 0, false, time, speed, unk)) { + mPath.setSegment(0, time); position = mPath.getPosition(); mOldPosition = mPath.getPosition(); } @@ -439,12 +440,12 @@ static u32 rot_4000 = 0x4000; void dAcODungeonShip_c::fn_485_1720() { mPath.setSpeed(forwardSpeed); - mPath.fn_800A9650(); + mPath.execute(); // TODO position = mPath.getPosition(); mVec3_c tmp; - mPath.fn_800A7C80(mPath.getSegmentIndex(), tmp, mPath.getSegmentFraction()); + mPath.getDirection(tmp); rotation.y = cM::atan2s(tmp.x, tmp.z); if (mPath.CheckFlag(0x40000000)) { rotation.y += rot_7fff; @@ -480,10 +481,9 @@ u32 dAcODungeonShip_c::fn_485_1960() { mVec3_c dist = link->position - position; dist.y = 0.0f; dist.normalizeRS(); - s32 a1 = cLib::targetAngleY(mVec3_c::Zero, v); - s32 a2 = cLib::targetAngleY(mVec3_c::Zero, dist); - // okay - return labs(mAng(mAng(a1) - mAng(a2))); + s16 a1 = cLib::targetAngleY(mVec3_c::Zero, v); + s16 a2 = cLib::targetAngleY(mVec3_c::Zero, dist); + return mAng::abs((s32)(a1 - a2)); } f32 dAcODungeonShip_c::fn_485_1A50() { diff --git a/src/REL/d/t/d_t_sound_area.cpp b/src/REL/d/t/d_t_sound_area.cpp index b89886a7..ca60e02f 100644 --- a/src/REL/d/t/d_t_sound_area.cpp +++ b/src/REL/d/t/d_t_sound_area.cpp @@ -25,7 +25,7 @@ int dTgSndAr_c::create() { mtx.YrotM(rotation.y); PSMTXInverse(mtx.m, mtx.m); break; - case 3: mRail.init(params >> 8 & 0xFF, roomid, 0); break; + case 3: mRail.initWithPathIndex(params >> 8 & 0xFF, roomid, 0); break; } fBase_c *base = nullptr; @@ -144,8 +144,10 @@ bool dTgSndAr_c::checkAlg3(const mVec3_c &pos) { cM3dGCps unk; // Line between b and c - mVec3_c b = *mRail.getPntPosForIndex(0); - mVec3_c c = *mRail.getPntPosForIndex(1); + mVec3_c b; + b.copyFrom(mRail.getPoint(0)); + mVec3_c c; + c.copyFrom(mRail.getPoint(1)); unk.Set(b, c, mScale.x * 100.0f); f32 d; |
