Merge pull request #175 from robojumper/d_path

d_path 33%
This commit is contained in:
robojumper
2025-05-25 21:53:39 +02:00
committed by GitHub
16 changed files with 909 additions and 150 deletions
-1
View File
@@ -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) {
+11 -11
View File
@@ -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() {
+5 -3
View File
@@ -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;