mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-23 05:29:50 +00:00
attempt the last function
This commit is contained in:
parent
279558f3dc
commit
3b3bc7d518
@ -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);
|
||||
};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user