attempt the last function

This commit is contained in:
Joshua Andrew 2024-06-22 16:43:57 -04:00
parent 279558f3dc
commit 3b3bc7d518
2 changed files with 35 additions and 1 deletions

View File

@ -289,6 +289,14 @@ namespace MR {
return 0.0f;
}
inline bool isLessThan(f32 lhs, f32 rhs) {
if (lhs < rhs) {
return true;
}
return false;
}
f32 cos(f32);
f32 sin(f32);
};

View File

@ -580,7 +580,33 @@ bool SkeletalFishGuard::isInScreen() const {
return MR::calcScreenPosition(&screen, mPosition);
}
// SkeletalFishGuard::isPlayerInAttackRange
#ifdef NON_MATCHING
bool SkeletalFishGuard::isPlayerInAttackRange() const {
const TVec3f* posPtr = &mPosition;
TVec3f v7(*MR::getPlayerCenterPos());
JMathInlineVEC::PSVECSubtract(v7.toCVec(), posPtr->toCVec(), v7.toVec());
if (PSVECMag(v7.toCVec()) > 5000.0f) {
return false;
}
if (MR::isNearZero(v7, 0.001f)) {
return false;
}
MR::normalize(&v7);
f32 v5 = (MR::isLessThan(180.0f, 0.0f)) ? -180.0f : 180.0f;
f32 v8 = (45.511112f * v5);
f32 v6 = JMASCos(v8);
f32 dot = v7.dot(_D0);
if (dot < v6) {
return true;
}
return false;
}
#endif
#ifdef NON_MATCHING
// pretty close