From 4b4ab84cc96cb346d1532b7765a7812c01e046ea Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Fri, 3 Jan 2025 00:14:37 +0100 Subject: [PATCH] Library/Math: Add complete `MathUtil.h` --- lib/al/Library/Area/AreaShape.cpp | 3 +- .../Collision/CollisionPartsTriangle.cpp | 3 +- .../Library/Controller/SpinInputAnalyzer.cpp | 2 +- lib/al/Library/LiveActor/ActorPoseKeeper.cpp | 3 +- lib/al/Library/MapObj/BackHideParts.cpp | 2 - lib/al/Library/MapObj/BreakMapPartsBase.cpp | 2 +- lib/al/Library/MapObj/FloaterMapParts.cpp | 2 +- lib/al/Library/MapObj/RollingCubeMapParts.cpp | 2 +- lib/al/Library/MapObj/SurfMapParts.cpp | 2 +- lib/al/Library/Math/MathAngleUtil.h | 51 -- lib/al/Library/Math/MathLengthUtil.h | 55 -- lib/al/Library/Math/MathRandomUtil.cpp | 52 -- lib/al/Library/Math/MathRandomUtil.h | 37 -- lib/al/Library/Math/MathUtil.cpp | 48 ++ lib/al/Library/Math/MathUtil.h | 476 ++++++++++++++++-- lib/al/Library/Math/MtxUtil.h | 17 + lib/al/Library/Math/ParabolicPath.cpp | 1 - lib/al/Library/Math/VectorUtil.h | 31 -- lib/al/Library/Matrix/MatrixPtrHolder.h | 3 - .../Library/Movement/EnemyStateBlowDown.cpp | 2 +- lib/al/Library/Obj/BreakModel.cpp | 2 +- .../Obj/EffectObjFollowCameraLimit.cpp | 2 +- lib/al/Library/Obj/PartsModel.cpp | 1 - lib/al/Library/Rail/RailPart.cpp | 4 +- .../Project/Camera/CameraAngleSwingInfo.cpp | 1 - lib/al/Project/Rail/LinearCurve.cpp | 3 +- src/Boss/Mofumofu/MofumofuWarpHole.cpp | 3 - src/Enemy/EnemyCap.cpp | 3 +- src/Enemy/EnemyStateRunAway.cpp | 4 - src/Enemy/EnemyStateWander.cpp | 2 +- src/Enemy/SenobiLeaf.cpp | 3 +- src/Layout/Compass.cpp | 1 - src/Layout/CounterLife.cpp | 2 +- src/Layout/FilterFly.cpp | 3 +- src/Layout/GaugeAir.cpp | 2 +- src/MapObj/WorldMapParts.cpp | 1 - src/Player/Player.cpp | 1 - src/Player/PlayerActionFunction.cpp | 3 +- src/Player/PlayerActionVelocityControl.cpp | 2 - src/Player/PlayerInput.cpp | 3 - src/Player/PlayerJudgeDirectRolling.cpp | 2 +- src/Player/PlayerJudgeGrabCeil.cpp | 1 - src/Player/PlayerJudgeTalkGround.cpp | 2 +- src/Player/PlayerJudgeWallCatch.cpp | 2 +- tools/check-format.py | 5 + 45 files changed, 521 insertions(+), 331 deletions(-) delete mode 100644 lib/al/Library/Math/MathAngleUtil.h delete mode 100644 lib/al/Library/Math/MathLengthUtil.h delete mode 100644 lib/al/Library/Math/MathRandomUtil.cpp delete mode 100644 lib/al/Library/Math/MathRandomUtil.h mode change 100755 => 100644 lib/al/Library/Math/MathUtil.h create mode 100644 lib/al/Library/Math/MtxUtil.h delete mode 100644 lib/al/Library/Math/VectorUtil.h diff --git a/lib/al/Library/Area/AreaShape.cpp b/lib/al/Library/Area/AreaShape.cpp index 5e17cf7e..b9b32256 100644 --- a/lib/al/Library/Area/AreaShape.cpp +++ b/lib/al/Library/Area/AreaShape.cpp @@ -6,8 +6,7 @@ #include "Library/Area/AreaShapeCylinder.h" #include "Library/Area/AreaShapeInfinite.h" #include "Library/Area/AreaShapeSphere.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Matrix/MatrixUtil.h" namespace al { diff --git a/lib/al/Library/Collision/CollisionPartsTriangle.cpp b/lib/al/Library/Collision/CollisionPartsTriangle.cpp index a2b52f66..dedd9bc3 100644 --- a/lib/al/Library/Collision/CollisionPartsTriangle.cpp +++ b/lib/al/Library/Collision/CollisionPartsTriangle.cpp @@ -2,8 +2,7 @@ #include "Library/Collision/CollisionParts.h" #include "Library/Collision/KCollisionServer.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" namespace al { diff --git a/lib/al/Library/Controller/SpinInputAnalyzer.cpp b/lib/al/Library/Controller/SpinInputAnalyzer.cpp index a81cf852..37927edd 100644 --- a/lib/al/Library/Controller/SpinInputAnalyzer.cpp +++ b/lib/al/Library/Controller/SpinInputAnalyzer.cpp @@ -1,6 +1,6 @@ #include "Library/Controller/SpinInputAnalyzer.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" namespace al { diff --git a/lib/al/Library/LiveActor/ActorPoseKeeper.cpp b/lib/al/Library/LiveActor/ActorPoseKeeper.cpp index fbd97dba..e13c3389 100644 --- a/lib/al/Library/LiveActor/ActorPoseKeeper.cpp +++ b/lib/al/Library/LiveActor/ActorPoseKeeper.cpp @@ -1,7 +1,8 @@ #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/LiveActorUtil.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" +#include "Library/Math/MtxUtil.h" namespace al { diff --git a/lib/al/Library/MapObj/BackHideParts.cpp b/lib/al/Library/MapObj/BackHideParts.cpp index 54ca6a2a..fd4b1068 100644 --- a/lib/al/Library/MapObj/BackHideParts.cpp +++ b/lib/al/Library/MapObj/BackHideParts.cpp @@ -4,8 +4,6 @@ #include "Library/LiveActor/ActorInitFunction.h" #include "Library/LiveActor/ActorModelFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Model/ModelKeeper.h" #include "Library/Placement/PlacementFunction.h" diff --git a/lib/al/Library/MapObj/BreakMapPartsBase.cpp b/lib/al/Library/MapObj/BreakMapPartsBase.cpp index 6a76995f..625c1618 100644 --- a/lib/al/Library/MapObj/BreakMapPartsBase.cpp +++ b/lib/al/Library/MapObj/BreakMapPartsBase.cpp @@ -13,7 +13,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorResourceFunction.h" #include "Library/LiveActor/SubActorKeeper.h" -#include "Library/Math/MathRandomUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Obj/PartsFunction.h" #include "Library/Placement/PlacementFunction.h" diff --git a/lib/al/Library/MapObj/FloaterMapParts.cpp b/lib/al/Library/MapObj/FloaterMapParts.cpp index 8f97a93c..e85768d7 100644 --- a/lib/al/Library/MapObj/FloaterMapParts.cpp +++ b/lib/al/Library/MapObj/FloaterMapParts.cpp @@ -10,7 +10,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Placement/PlacementFunction.h" diff --git a/lib/al/Library/MapObj/RollingCubeMapParts.cpp b/lib/al/Library/MapObj/RollingCubeMapParts.cpp index a5d09312..48e9e357 100644 --- a/lib/al/Library/MapObj/RollingCubeMapParts.cpp +++ b/lib/al/Library/MapObj/RollingCubeMapParts.cpp @@ -8,7 +8,7 @@ #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorResourceFunction.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" -#include "Library/Math/MathAngleUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Obj/PartsModel.h" #include "Library/Placement/PlacementFunction.h" diff --git a/lib/al/Library/MapObj/SurfMapParts.cpp b/lib/al/Library/MapObj/SurfMapParts.cpp index b9fef9a8..2c6c9121 100644 --- a/lib/al/Library/MapObj/SurfMapParts.cpp +++ b/lib/al/Library/MapObj/SurfMapParts.cpp @@ -6,7 +6,7 @@ #include "Library/LiveActor/ActorAreaFunction.h" #include "Library/LiveActor/ActorInitFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Placement/PlacementFunction.h" diff --git a/lib/al/Library/Math/MathAngleUtil.h b/lib/al/Library/Math/MathAngleUtil.h deleted file mode 100644 index 5ae3dd10..00000000 --- a/lib/al/Library/Math/MathAngleUtil.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include -#include - -#include "Library/Math/Axis.h" - -namespace al { -void verticalizeVec(sead::Vector3f* out, const sead::Vector3f& vertical, const sead::Vector3f& vec); - -f32 calcAngleRadian(const sead::Vector3f&, const sead::Vector3f&); -f32 calcAngleDegree(const sead::Vector3f&, const sead::Vector3f&); -f32 calcAngleDegree(const sead::Vector2f&, const sead::Vector2f&); -f32 calcAngleOnPlaneRadian(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); -f32 calcAngleOnPlaneDegree(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); -f32 calcAngleOnPlaneDegreeOrZero(const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&); -s32 calcAngleSignOnPlane(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); - -bool tryCalcAngleDegree(f32*, const sead::Vector3f&, const sead::Vector3f&); -bool tryCalcAngleOnPlaneDegree(f32*, const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&); - -bool isNearZero(const sead::Vector2f& vec, f32 tolerance); -bool isNearZero(const sead::Vector3f& vec, f32 tolerance); -bool isParallelDirection(const sead::Vector3f&, const sead::Vector3f&, f32); -bool isNearAngleRadian(const sead::Vector2f&, const sead::Vector2f&, f32); -bool isNearAngleRadian(const sead::Vector3f&, const sead::Vector3f&, f32); -bool isNearAngleDegree(const sead::Vector2f&, const sead::Vector2f&, f32); -bool isNearAngleDegree(const sead::Vector3f&, const sead::Vector3f&, f32); -bool isNearAngleRadianHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, - f32); -bool isNearAngleDegreeHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, - f32); -bool isInAngleOnPlaneDegreeHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, - f32, f32, f32, f32); - -void normalize(sead::Vector2f*, const sead::Vector2f&); -void normalize(sead::Vector3f*, const sead::Vector3f&); -void normalize(sead::Vector2f*); -void normalize(sead::Vector3f*); -bool tryNormalizeOrZero(sead::Vector3f*, const sead::Vector3f&); -bool tryNormalizeOrZero(sead::Vector3f*); - -void alongVectorNormalH(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&); - -Axis calcNearVecFromAxis3(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&, const sead::Vector3f&); -Axis calcNearVecFromAxis3(sead::Vector3f*, const sead::Vector3f&, const sead::Quatf&); -} // namespace al diff --git a/lib/al/Library/Math/MathLengthUtil.h b/lib/al/Library/Math/MathLengthUtil.h deleted file mode 100644 index bf23bc46..00000000 --- a/lib/al/Library/Math/MathLengthUtil.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace al { -bool isNear(f32 value, f32 target, f32 tolerance); -bool isNear(const sead::Vector2f& value, const sead::Vector2f& target, f32 tolerance); -bool isNear(const sead::Vector3f& value, const sead::Vector3f& target, f32 tolerance); -bool isNear(const sead::Color4f& value, const sead::Color4f& target, f32 tolerance); -bool isNearZero(f32 value, f32 tolerance); -bool isNearZero(const sead::Matrix34f& value, f32 tolerance); -bool isNearZeroOrGreater(f32 value, f32 tolerance); -bool isNearZeroOrLess(f32 value, f32 tolerance); -bool isExistNearZeroVal(const sead::Vector3f&, f32); - -bool isNormalize(const sead::Vector3f&, f32); -bool isNormalize(const sead::Matrix34f&); -bool isParallelDirection(const sead::Vector2f&, const sead::Vector2f&, f32); -bool isParallelDirection(const sead::Vector3f&, const sead::Vector3f&, f32); -bool isReverseDirection(const sead::Vector3f&, const sead::Vector3f&, f32); -bool isNearDirection(const sead::Vector2f&, const sead::Vector2f&, f32); -bool isInRange(s32, s32, s32); -bool isInRange(f32, f32, f32); - -void normalize(sead::Vector2f*); -void normalize(sead::Vector3f*); -void normalize(sead::Matrix33f*); -void normalize(sead::Matrix34f*); -bool tryNormalizeOrZero(sead::Vector2f*); -bool tryNormalizeOrZero(sead::Vector2f*, const sead::Vector2f&); -bool tryNormalizeOrDirZ(sead::Vector3f*); -bool tryNormalizeOrDirZ(sead::Vector3f*, const sead::Vector3f&); -void normalizeComplement(sead::Matrix34f*); - -f32 normalizeAbs(f32, f32, f32); -f32 normalize(f32, f32, f32); -f32 normalize(s32, s32, s32); -bool limitLength(sead::Vector2f*, const sead::Vector2f&, f32); -bool limitLength(sead::Vector3f*, const sead::Vector3f&, f32); -bool limitLength(sead::Vector2f*, f32); -bool limitLength(sead::Vector3f*, f32); - -u32 getMaxAbsElementIndex(const sead::Vector3f&); -void setLength(sead::Vector3f*, f32); -void setProjectionLength(sead::Vector3f*, const sead::Vector3f&, f32); - -f32 sign(f32); -s32 sign(s32); -f32 cubeRoot(f32); - -void clampV3f(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); -void clampV2f(sead::Vector2f*, const sead::Vector2f&, const sead::Vector2f&); -} // namespace al diff --git a/lib/al/Library/Math/MathRandomUtil.cpp b/lib/al/Library/Math/MathRandomUtil.cpp deleted file mode 100644 index f50aade7..00000000 --- a/lib/al/Library/Math/MathRandomUtil.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "Library/Math/MathRandomUtil.h" - -#include - -namespace al { - -f32 getRandom() { - u32 random = (sead::GlobalRandom::instance()->getU32() >> 9) | 0x3F800000; - return (*reinterpret_cast(&random)) - 1; -} - -f32 getRandom(f32 factor) { - return getRandom(0.f, factor); -} - -f32 getRandom(f32 min, f32 max) { - return (getRandom() * (max - min)) + min; -} - -s32 getRandom(s32 factor) { - return getRandom(0, factor); -} - -s32 getRandom(s32 min, s32 max) { - return (s32)getRandom((f32)min, (f32)max); -} - -f32 getRandomDegree() { - return getRandom(360.f); -} - -f32 getRandomRadian() { - return getRandom(6.2832f); -} - -void getRandomVector(sead::Vector3f* vec, f32 factor) { - f32 x = (getRandom() * (factor + factor)) - factor; - f32 y = (getRandom() * (factor + factor)) - factor; - f32 z = (getRandom() * (factor + factor)) - factor; - vec->x = x; - vec->y = y; - vec->z = z; -} - -void getRandomDir(sead::Vector3f* vec) { - getRandomVector(vec, 10.f); - while (vec->dot(*vec) > 0.000001f) - getRandomVector(vec, 10.f); - vec->normalize(); -} - -} // namespace al diff --git a/lib/al/Library/Math/MathRandomUtil.h b/lib/al/Library/Math/MathRandomUtil.h deleted file mode 100644 index e9f865df..00000000 --- a/lib/al/Library/Math/MathRandomUtil.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include - -namespace al { - -f32 getRandom(); -f32 getRandom(f32); -f32 getRandom(f32, f32); -s32 getRandom(s32); -s32 getRandom(s32, s32); -f32 getRandomDegree(); -f32 getRandomRadian(); -void getRandomVector(sead::Vector3f*, f32); -void getRandomDir(sead::Vector3f*); -void getRandomDirH(sead::Vector3f*, const sead::Vector3f&); -void getRandomOnCircle(sead::Vector2f*, f32); -void getRandomInCircle(sead::Vector2f*, f32); -void getRandomInCircle(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); -void getRandomOnSphere(sead::Vector3f*, f32); -void getRandomInSphere(sead::Vector3f*, f32); -void calcRandomDirInCone(sead::Vector3f*, const sead::Vector3f&, f32); -void getRandomInSphereMinMaxRadius(sead::Vector3f*, f32, f32); -void initRandomSeed(u32); -void initRandomSeedByTick(); -void initRandomSeedByString(const char*); -bool isHalfProbability(); -bool isPercentProbability(f32); -void getRandomContext(u32*, u32*, u32*, u32*); -void setRandomContext(u32, u32, u32, u32); -void makeRandomDirXZ(sead::Vector3f*); -void calcBoxMullerRandomGauss(); -void makeBoxMullerRandomGauss(sead::Vector2f*, f32, f32); -void addRandomVector(sead::Vector3f*, const sead::Vector3f&, f32); -void turnRandomVector(sead::Vector3f*, const sead::Vector3f&, f32); - -} // namespace al diff --git a/lib/al/Library/Math/MathUtil.cpp b/lib/al/Library/Math/MathUtil.cpp index 283e07a7..f0bb20c5 100644 --- a/lib/al/Library/Math/MathUtil.cpp +++ b/lib/al/Library/Math/MathUtil.cpp @@ -1,6 +1,7 @@ #include "Library/Math/MathUtil.h" #include +#include namespace al { f32 normalize(f32 var, f32 min, f32 max) { @@ -109,4 +110,51 @@ void calcParabolicFunctionParam(f32* gravity, f32* initialVelY, f32 maxHeight, *gravity = verticalDistance - *initialVelY; } + +f32 getRandom() { + u32 random = (sead::GlobalRandom::instance()->getU32() >> 9) | 0x3F800000; + return (*reinterpret_cast(&random)) - 1; +} + +f32 getRandom(f32 factor) { + return getRandom(0.f, factor); +} + +f32 getRandom(f32 min, f32 max) { + return (getRandom() * (max - min)) + min; +} + +s32 getRandom(s32 factor) { + return getRandom(0, factor); +} + +s32 getRandom(s32 min, s32 max) { + return (s32)getRandom((f32)min, (f32)max); +} + +f32 getRandomDegree() { + return getRandom(360.f); +} + +f32 getRandomRadian() { + return getRandom(6.2832f); +} + +void getRandomVector(sead::Vector3f* vec, f32 factor) { + f32 x = (getRandom() * (factor + factor)) - factor; + f32 y = (getRandom() * (factor + factor)) - factor; + f32 z = (getRandom() * (factor + factor)) - factor; + vec->x = x; + vec->y = y; + vec->z = z; +} + +void getRandomDir(sead::Vector3f* vec) { + getRandomVector(vec, 10.f); + while (vec->dot(*vec) > 0.000001f) + getRandomVector(vec, 10.f); + vec->normalize(); +} + + } // namespace al diff --git a/lib/al/Library/Math/MathUtil.h b/lib/al/Library/Math/MathUtil.h old mode 100755 new mode 100644 index a2164b0f..83d90d3f --- a/lib/al/Library/Math/MathUtil.h +++ b/lib/al/Library/Math/MathUtil.h @@ -1,21 +1,14 @@ #pragma once +#include +#include #include #include -namespace al { -f32 easeIn(f32); -f32 easeOut(f32); -f32 easeInOut(f32); - -f32 squareIn(f32); -f32 squareOut(f32); - -f32 powerIn(f32, f32); -f32 powerOut(f32, f32); +#include "Library/Math/Axis.h" -f32 lerpValue(f32, f32, f32); -f32 lerpValue(f32, f32, f32, f32, f32); +namespace al { +class VisitCellCallBack; template inline T clamp(T value, T min, T max) { @@ -26,57 +19,442 @@ inline T clamp(T value, T min, T max) { return value; } -void verticalizeVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); -void parallelizeVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); - -f32 modf(f32 a, f32 b); -s32 modi(s32 a, s32 b); - -bool normalize(f32 value); +f32 calcAngleRadian(const sead::Vector3f&, const sead::Vector3f&); +f32 calcAngleDegree(const sead::Vector3f&, const sead::Vector3f&); +f32 calcAngleDegree(const sead::Vector2f&, const sead::Vector2f&); +bool isNearZero(const sead::Vector2f& vec, f32 tolerance); +bool tryCalcAngleDegree(f32*, const sead::Vector3f&, const sead::Vector3f&); +bool isNearZero(const sead::Vector3f& vec, f32 tolerance); +f32 calcAngleOnPlaneRadian(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); +void verticalizeVec(sead::Vector3f* out, const sead::Vector3f& vertical, const sead::Vector3f& vec); +f32 calcAngleOnPlaneDegree(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); +f32 calcAngleOnPlaneDegreeOrZero(const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +bool tryCalcAngleOnPlaneDegree(f32*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +bool isParallelDirection(const sead::Vector3f&, const sead::Vector3f&, f32); +s32 calcAngleSignOnPlane(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); +bool isNearAngleRadian(const sead::Vector2f&, const sead::Vector2f&, f32); +void normalize(sead::Vector2f*, const sead::Vector2f&); +bool isNearAngleRadian(const sead::Vector3f&, const sead::Vector3f&, f32); +void normalize(sead::Vector3f*, const sead::Vector3f&); +bool isNearAngleDegree(const sead::Vector2f&, const sead::Vector2f&, f32); +bool isNearAngleDegree(const sead::Vector3f&, const sead::Vector3f&, f32); +bool isNearAngleRadianHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, + f32); +bool tryNormalizeOrZero(sead::Vector3f*, const sead::Vector3f&); +bool tryNormalizeOrZero(sead::Vector3f*); +bool isNearAngleDegreeHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, + f32); +bool isInAngleOnPlaneDegreeHV(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, + f32, f32, f32, f32); +bool isNear(f32 value, f32 target, f32 tolerance); +bool isNear(const sead::Vector2f& value, const sead::Vector2f& target, f32 tolerance); +bool isNear(const sead::Vector3f& value, const sead::Vector3f& target, f32 tolerance); +bool isNear(const sead::Color4f& value, const sead::Color4f& target, f32 tolerance); +bool isNearZero(f32 value, f32 tolerance); +bool isNearZero(const sead::Matrix34f& value, f32 tolerance); +bool isNearZeroOrGreater(f32 value, f32 tolerance); +bool isNearZeroOrLess(f32 value, f32 tolerance); +bool isExistNearZeroVal(const sead::Vector3f&, f32); +bool isNormalize(const sead::Vector3f&, f32); +bool isNormalize(const sead::Matrix34f&); +bool isParallelDirection(const sead::Vector2f&, const sead::Vector2f&, f32); +bool isReverseDirection(const sead::Vector3f&, const sead::Vector3f&, f32); +bool isNearDirection(const sead::Vector2f&, const sead::Vector2f&, f32); +bool isNearDirection(const sead::Vector3f&, const sead::Vector3f&, f32); +bool isInRange(s32, s32, s32); +bool isInRange(f32, f32, f32); +void normalize(sead::Vector2f*); +void normalize(sead::Vector3f*); void normalize(sead::Matrix33f*); void normalize(sead::Matrix34f*); -f32 normalize(f32 value, f32, f32); - -bool isNear(const sead::Matrix34f& value, const sead::Matrix34f& target, f32 tolerance); - -void calcQuatSide(sead::Vector3f* out, const sead::Quatf& quat); -void calcQuatUp(sead::Vector3f* out, const sead::Quatf& quat); -void calcQuatGravity(sead::Vector3f* out, const sead::Quatf& quat); -void calcQuatFront(sead::Vector3f* out, const sead::Quatf& quat); - -void makeMtxRotateTrans(sead::Matrix34f* out, const sead::Vector3f& rotate, - const sead::Vector3f& trans); -void makeMtxFrontUpPos(sead::Matrix34f* out, const sead::Vector3f& front, const sead::Vector3f& up, - const sead::Vector3f& pos); -void makeMtxUpFrontPos(sead::Matrix34f* out, const sead::Vector3f& up, const sead::Vector3f& front, - const sead::Vector3f& pos); - -void separateVectorHV(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, - const sead::Vector3f&); - +bool tryNormalizeOrZero(sead::Vector2f*); +bool tryNormalizeOrZero(sead::Vector2f*, const sead::Vector2f&); +bool tryNormalizeOrDirZ(sead::Vector3f*); +bool tryNormalizeOrDirZ(sead::Vector3f*, const sead::Vector3f&); +void normalizeComplement(sead::Matrix34f*); +s32 getMaxAbsElementIndex(const sead::Vector3f&); +void setLength(sead::Vector3f*, f32); +void setProjectionLength(sead::Vector3f*, const sead::Vector3f&, f32); +bool limitLength(sead::Vector2f*, const sead::Vector2f&, f32); +bool limitLength(sead::Vector3f*, const sead::Vector3f&, f32); +f32 normalizeAbs(f32, f32, f32); +f32 normalize(f32, f32, f32); +f32 normalize(s32, s32, s32); +f32 sign(f32); +s32 sign(s32); +f32 cubeRoot(f32); +void clampV3f(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +void clampV2f(sead::Vector2f*, const sead::Vector2f&, const sead::Vector2f&); +f32 easeIn(f32); +f32 easeOut(f32); +f32 easeInOut(f32); +f32 squareIn(f32); +f32 squareOut(f32); +f32 powerIn(f32, f32); +f32 powerOut(f32, f32); +f32 logarithmIn(f32, f32); +f32 logarithmOut(f32, f32); +f32 exponentIn(f32, f32); +f32 exponentOut(f32, f32); +f32 hermiteRate(f32, f32, f32); +f32 calcFourthOrderRate(f32, f32); +f32 calcTriangleWave01(f32, f32); +f32 calcTriangleWave(f32, f32, f32, f32); +f32 lerpValue(f32, f32, f32); +f32 calcRate01(f32, f32, f32); +f32 easeByType(f32, s32); +f32 lerpValue(f32, f32, f32, f32, f32); +f32 lerpDegree(f32, f32, f32); +f32 lerpRadian(f32, f32, f32); void lerpVec(sead::Vector2f*, const sead::Vector2f&, const sead::Vector2f&, f32); void lerpVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); void lerpVecHV(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, f32); - -void rotateVectorDegree(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); - -f32 calcRate01(f32, f32, f32); - -f32 slerpQuat(sead::Quatf*, const sead::Quatf&, const sead::Quatf&, f32); - -bool checkHitSegmentSphere(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, - sead::Vector3f*, sead::Vector3f*); - +void separateVectorHV(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, + const sead::Vector3f&); +void lerpColor(sead::Color4f*, const sead::Color4f&, const sead::Color4f&, f32); +f32 lerpLogValueEaseIn(f32, f32, f32, f32); +f32 lerpLogValueEaseOut(f32, f32, f32, f32); +void lerpLogVecEaseIn(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, f32); +void lerpLogVecEaseOut(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, f32); +f32 lerpExponentValueEaseIn(f32, f32, f32, f32); +f32 lerpExponentValueEaseOut(f32, f32, f32, f32); +void lerpExponentVecEaseIn(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, f32); +void lerpExponentVecEaseOut(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, + f32); +f32 clampLeapMinAbs(f32, f32, f32, f32); +f32 hermite(f32, f32, f32, f32, f32); +f32 hermite(f32, f32, f32, f32, f32, f32); +void hermiteVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, f32); s32 converge(s32, s32, s32); f32 converge(f32, f32, f32); f32 convergeDegree(f32, f32, f32); f32 convergeRadian(f32, f32, f32); void convergeVec(sead::Vector2f*, const sead::Vector2f&, const sead::Vector2f&, f32); void convergeVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +f32 diffNearAngleDegree(f32, f32); +bool isInRangeAngleDegree(f32, f32, f32); +bool calcEyesAnimAngleInRange(f32*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, f32, f32, f32, f32); +bool isSameSign(f32, f32); +u8 reverseBit8(u8); +u16 reverseBit16(u16); +u32 reverseBit32(u32); +f32 calcVanDerCorput(u32); +void calcHammersleyPoint(sead::Vector2f*, u32, u32); +s32 findMaxFromArray(const s32*, s32); +void separateMinMax(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&); +s32 findMinFromArray(const s32*, s32); +f32 getRandom(); +f32 getRandom(f32); +f32 getRandom(f32, f32); +s32 getRandom(s32); +s32 getRandom(s32, s32); +f32 getRandomDegree(); +f32 getRandomRadian(); +void getRandomVector(sead::Vector3f*, f32); +void getRandomDir(sead::Vector3f*); +void getRandomDirH(sead::Vector3f*, const sead::Vector3f&); +void rotateVectorDegree(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void getRandomOnCircle(sead::Vector2f*, f32); +void getRandomInCircle(sead::Vector2f*, f32); +void getRandomInCircleMinMaxRadius(sead::Vector2f*, f32, f32); +void getRandomInCircle(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void getRandomOnSphere(sead::Vector3f*, f32); +void getRandomInSphere(sead::Vector3f*, f32); +bool calcRandomDirInCone(sead::Vector3f*, const sead::Vector3f&, f32); +void getRandomInSphereMinMaxRadius(sead::Vector3f*, f32, f32); +void initRandomSeed(u32); +void initRandomSeedByTick(); +void initRandomSeedByString(const char*); +bool isHalfProbability(); +bool isPercentProbability(f32); +void getRandomContext(u32*, u32*, u32*, u32*); +void setRandomContext(u32, u32, u32, u32); +void makeRandomDirXZ(sead::Vector3f*); +f32 calcBoxMullerRandomGauss(); +void makeBoxMullerRandomGauss(sead::Vector2f*, f32, f32); +f32 modf(f32 a, f32 b); +s32 modi(s32 a, s32 b); +f32 calcSpeedMax(f32, f32); +f32 calcAccel(f32, f32); +f32 calcFriction(f32, f32); +bool separateScalarAndDirection(f32*, sead::Vector2f*, const sead::Vector2f&); +bool separateScalarAndDirection(f32*, sead::Vector3f*, const sead::Vector3f&); +void limitVectorSeparateHV(sead::Vector3f*, const sead::Vector3f&, f32, f32); +void parallelizeVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +void calcVectorSeparateHV(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, f32); +void limitVectorParallelVertical(sead::Vector3f*, const sead::Vector3f&, f32, f32); +void separateVectorParallelVertical(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, + const sead::Vector3f&); +bool addVectorLimit(sead::Vector3f*, const sead::Vector3f&, f32); +void alongVectorNormalH(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +f32 calcDistanceVecToPlane(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void limitPlanePos(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +bool limitCylinderInPos(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, f32); +bool limitCylinderInDir(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +bool limitCylinderInPos(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +bool limitCylinderInDir(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void roundOffVec(sead::Vector3f*, const sead::Vector3f&); +void roundOffVec(sead::Vector3f*); +void roundOffVec(sead::Vector2f*, const sead::Vector2f&); +void roundOffVec(sead::Vector2f*); +f32 snapToGrid(f32, f32, f32); +void snapVecToGrid(sead::Vector3f*, const sead::Vector3f&, f32, const sead::Vector3f&); +void snapVecToGrid(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void limitVectorOppositeDir(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void scaleVectorDirection(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void scaleVectorExceptDirection(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void snapVecToDirAxisY(sead::Vector3f*, const sead::Vector3f&, s32); +void calcDir(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +void calcDirH(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +void calcDirOnPlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +f32 mapRangeLogarithmic(f32, f32, f32, f32, f32, f32); +void calcDirFromLongitudeLatitude(sead::Vector3f*, f32, f32); +void calcLongitudeLatitudeFromDir(f32*, f32*, const sead::Vector3f&); + +// maybe these should return u32? +s32 getMaxAbsElementIndex(const sead::Vector3i&); +s32 getMaxAbsElementValue(const sead::Vector3f&); +s32 getMaxAbsElementValue(const sead::Vector3i&); +s32 getMinAbsElementIndex(const sead::Vector3f&); +s32 getMinAbsElementIndex(const sead::Vector3i&); +s32 getMinAbsElementValue(const sead::Vector3f&); +s32 getMinAbsElementValue(const sead::Vector3i&); -void separateScalarAndDirection(f32*, sead::Vector3f*, const sead::Vector3f&); +Axis calcNearVecFromAxis2(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +Axis calcNearVecFromAxis3(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +void calcDirVerticalAny(sead::Vector3f*, const sead::Vector3f&); +void calcDirSlide(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +Axis calcNearVecFromAxis3(sead::Vector3f*, const sead::Vector3f&, const sead::Quatf&); +void calcQuatLocalAxisAll(const sead::Quatf&, sead::Vector3f*, sead::Vector3f*, sead::Vector3f*); +void addRandomVector(sead::Vector3f*, const sead::Vector3f&, f32); +void turnRandomVector(sead::Vector3f*, const sead::Vector3f&, f32); +void makeAxisFrontUp(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, + const sead::Vector3f&); +void makeAxisFrontSide(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, + const sead::Vector3f&); +void makeAxisUpFront(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, + const sead::Vector3f&); +void makeAxisUpSide(sead::Vector3f*, sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatFromTwoAxis(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&, s32, s32); +void makeQuatFrontUp(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatFrontSide(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatFrontNoSupport(sead::Quatf*, const sead::Vector3f&); +void makeQuatUpFront(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatUpSide(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatUpNoSupport(sead::Quatf*, const sead::Vector3f&); +void makeQuatSideUp(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatSideFront(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); +void makeQuatSideNoSupport(sead::Quatf*, const sead::Vector3f&); +void makeQuatFromToQuat(sead::Quatf*, const sead::Quatf&, const sead::Quatf&); +void makeQuatRotationRate(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&, f32); +bool makeQuatRotationLimit(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&, f32); +void makeQuatAxisRotation(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, f32); +void makeQuatRotateDegree(sead::Quatf*, const sead::Vector3f&, f32); +void slerpQuat(sead::Quatf*, const sead::Quatf&, const sead::Quatf&, f32); +void calcQuatSide(sead::Vector3f* out, const sead::Quatf& quat); +void calcQuatUp(sead::Vector3f* out, const sead::Quatf& quat); +void calcQuatGravity(sead::Vector3f* out, const sead::Quatf& quat); +void calcQuatFront(sead::Vector3f* out, const sead::Quatf& quat); +f32 calcQuatUpY(const sead::Quatf&); +f32 calcQuatFrontY(const sead::Quatf&); +void calcQuatLocalAxis(sead::Vector3f*, const sead::Quatf&, s32); +void calcQuatLocalSignAxis(sead::Vector3f*, const sead::Quatf&, s32); +void calcQuatRotateDegree(sead::Vector3f*, const sead::Quatf&); +void calcQuatRotateRadian(sead::Vector3f*, const sead::Quatf&); +void calcQuatRotateAxisAndDegree(sead::Vector3f*, f32*, const sead::Quatf&); +void calcQuatRotateAxisAndDegree(sead::Vector3f*, f32*, const sead::Quatf&, const sead::Quatf&); +void rotateQuatRadian(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void makeQuatXDegree(sead::Quatf*, f32); +void makeQuatYDegree(sead::Quatf*, f32); +void makeQuatZDegree(sead::Quatf*, f32); +void rotateQuatXDirDegree(sead::Quatf*, const sead::Quatf&, f32); +void rotateQuatYDirDegree(sead::Quatf*, const sead::Quatf&, f32); +void rotateQuatZDirDegree(sead::Quatf*, const sead::Quatf&, f32); +void rotateQuatLocalDirDegree(sead::Quatf*, const sead::Quatf&, s32, f32); +void rotateQuatMoment(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&); +void rotateQuatMomentDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&); +void rotateQuatRollBall(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, + const sead::Vector3f&, f32); +void calcMomentRollBall(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +bool turnQuat(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, const sead::Vector3f&, f32); +bool turnQuatXDirRadian(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatYDirRadian(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatZDirRadian(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void turnQuatXDirRate(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void turnQuatYDirRate(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void turnQuatZDirRate(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void tiltQuatDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, const sead::Vector3f&, + f32); +void tiltQuatXDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void tiltQuatYDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +void tiltQuatZDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatWithAxisDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, f32); +bool turnQuatXDirWithYDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatXDirWithZDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatYDirWithZDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatYDirWithXDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatZDirWithXDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatZDirWithYDirDegree(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); +bool turnQuatZDirToTargetWithAxis(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&, f32); +bool turnQuatFrontToDirDegreeH(sead::Quatf*, const sead::Vector3f&, f32); +void rotateQuatAndTransDegree(sead::Quatf*, sead::Vector3f*, const sead::Quatf&, + const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, + f32); +bool turnVecToVecDegree(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void turnVecToVecRate(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +bool turnVecToVecCos(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, + const sead::Vector3f&, f32); +bool turnVecToVecCosOnPlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, f32); +bool turnVecToVecCosOnPlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); +void rotateVectorCenterDegree(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, f32); +void rotateVectorDegreeX(sead::Vector3f*, f32); +void rotateVectorDegreeY(sead::Vector3f*, f32); +void rotateVectorDegreeZ(sead::Vector3f*, f32); +void rotateVectorQuat(sead::Vector3f*, const sead::Quatf&); +f32 calcAreaTriangle(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); +void createBoundingBox(const sead::Vector3f*, u32, sead::Vector3f*, sead::Vector3f*); +void updateBoundingBox(sead::Vector3f, sead::Vector3f*, sead::Vector3f*); +f32 calcDistanceToFarthestBoundingBoxVertex(const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void calcSphereMargeSpheres(sead::Vector3f*, f32*, const sead::Vector3f&, f32, + const sead::Vector3f&, f32); +bool calcCrossLinePoint(sead::Vector2f*, const sead::Vector2f&, const sead::Vector2f&, + const sead::Vector2f&, const sead::Vector2f&); +f32 calcSquaredDistanceSegmentToSegment(const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, + sead::Vector3f*, sead::Vector3f*); +f32 calcSquaredDistancePointToSegment(const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +f32 calcDistancePointToSegment(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&); +void calcPerpendicFootToLineInside(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void calcClosestSegmentPoint(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +f32 calcCylinderRadiusDot(const sead::Vector3f&, const sead::Vector3f&, f32); +bool checkHitSemilinePlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +bool checkHitSegmentPlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, bool); +bool checkHitLinePlane(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +bool checkHitSegmentSphere(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, + sead::Vector3f*, sead::Vector3f*); +bool checkHitSegmentSphereNearDepth(const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, f32, sead::Vector3f*, sead::Vector3f*); +bool checkInCylinder(const sead::Vector3f&, const sead::Vector3f&, f32, const sead::Vector3f&, f32); +bool checkHitSegmentCylinder(const sead::Vector3f&, f32, const sead::Vector3f&, f32, + const sead::Vector3f&, const sead::Vector3f&, sead::Vector3f*, + sead::Vector3f*); +bool checkHitHalfLineSphere(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, + f32); +} // namespace al + +namespace Intersect { + +bool calcX(sead::Vector3f*, f32, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +bool calcY(sead::Vector3f*, f32, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); +bool calcZ(sead::Vector3f*, f32, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&); + +} // namespace Intersect + +namespace al { + +bool checkHitSegmentBox(const sead::Vector3f&, const sead::Vector3f&, const sead::BoundBox3f&, + sead::Vector3f*); +bool checkHitPointCone(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, f32, + f32); +bool checkHitSphereCone(const sead::Vector3f&, f32, const sead::Vector3f&, const sead::Vector3f&, + f32, f32); +bool checkHitSphereSpotLight(const sead::Vector3f&, f32, const sead::Vector3f&, + const sead::Vector3f&, f32, f32); +bool calcBoundingSphereSpotLight(sead::Vector3f*, f32*, const sead::Vector3f&, + const sead::Vector3f&, f32, f32); +void calcBoundingSphereBox3f(sead::Vector3f*, f32*, const sead::BoundBox3f&); +void calcArrowAabb(sead::BoundBox3f*, const sead::Vector3f&, const sead::Vector3f&); +bool isNearCollideSphereAabb(const sead::Vector3f&, f32, const sead::BoundBox3f&); +void calcBoxFacePoint(sead::Vector3f*, const sead::BoundBox3f&, s32); +void calcBoxFacePoint(sead::Vector3f*, const sead::BoundBox3f&, s32, const sead::Matrix34f&); +void calcBoxFacePoint(sead::Vector3f*, const sead::BoundBox3f&, s32, const sead::Quatf&, + const sead::Vector3f&); +void calcFittingBoxPoseEqualAxisAll(sead::Quatf*, const sead::Quatf&, const sead::Quatf&); +void calcFittingBoxPoseEqualAxisNone(sead::Quatf*, const sead::Quatf&, const sead::Quatf&); +void calcFittingBoxPoseEqualAxisTwo(sead::Quatf*, const sead::Quatf&, const sead::Quatf&, s32); +void calcFittingBoxPose(sead::Quatf*, const sead::BoundBox3f&, const sead::Quatf&, + const sead::Quatf&); +f32 calcSquaredDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&, const sead::Vector3f&); +f32 calcDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&, const sead::Vector3f&); +f32 calcSquaredDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&, const sead::Vector3f&, + const sead::BoundBox3f&); +f32 calcDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&, const sead::Vector3f&, + const sead::BoundBox3f&); +f32 calcSquaredDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&); +f32 calcDistanceToObb(const sead::Vector3f&, const sead::Matrix34f&); +void calcObbCorners(sead::Vector3f*, const sead::Matrix34f&, const sead::BoundBox3f&); +bool calcTriangleInteriorAngleDegree(f32*, f32*, f32*, f32, f32, f32); +bool calcBetweenTwoLinkMtx(sead::Matrix34f*, sead::Matrix34f*, sead::Matrix34f*, + const sead::Vector3f&, const sead::Vector3f&, f32, f32); +bool calcBetweenTwoLinkPos(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32, f32, + const sead::Vector3f&); +bool calcReflectionVector(sead::Vector3f*, const sead::Vector3f&, f32, f32); +void calcReverseVector(sead::Vector3f*, const sead::Vector3f&, f32); void calcParabolicFunctionParam(f32*, f32*, f32, f32 verticalDistance); +f32 calcConvergeVibrationValue(f32, f32, f32, f32, f32); +bool calcSphericalPolarCoordPY(sead::Vector2f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&); +void calcBezierPoint(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, + const sead::Vector3f&, const sead::Vector3f&, f32); +f32 calcSpringDumperForce(f32, f32, f32, f32); +f32 convertSpringEnergyToSpeed(f32, f32, f32); +const char* axisIndexToString(s32); +void visitCellsOverlapped(const sead::Vector3f&, const sead::Vector3f&, f32, + const VisitCellCallBack&); +f32 calcMultValueToDestination(u32, f32, f32); +f32 getHaltonSequence(u32, u32); +f32 calcFractal(f32, f32, u32, f32, f32, f32, bool); +f32 calcMultiFractal(f32, f32, f32, u32, f32, f32, f32, bool); +f32 calcNormalDistribution(f32, f32, f32); +f32 calcVecViewInput(sead::Vector3f*, const sead::Vector2f&, const sead::Vector3f&, + const sead::Matrix34f*); +f32 calcDirViewInput(sead::Vector3f*, const sead::Vector2f&, const sead::Vector3f&, + const sead::Matrix34f*); +f32 calcVecViewInput2D(sead::Vector3f*, const sead::Vector2f&, const sead::Vector3f&, + const sead::Matrix34f*); +f32 calcDirViewInput2D(sead::Vector3f*, const sead::Vector2f&, const sead::Vector3f&, + const sead::Matrix34f*); +void calcBendPosAndFront(sead::Vector3f*, sead::Vector3f*, sead::Vector3f&, f32, + const sead::Vector3f&, const sead::Vector3f&, f32); +void calcCirclePointPicking(sead::Vector2f*, f32, f32); +void pickUniformPointsOnCircleHammersley(sead::Vector2f*, u32, u32); +void calcDiskPointPicking(sead::Vector2f*, f32, f32); +void pickUniformPointsOnDiskHammersley(sead::Vector2f*, u32, u32); +void pickUniformPointOnDisk(sead::Vector2f*); +void calcSpherePointPicking(sead::Vector3f*, f32, f32); +void pickUniformPointOnSphere(sead::Vector3f*); +void makeBayerMatrix(s32*, s32); +u16 f32ToF16(f32); +f32 f16ToF32(u16); } // namespace al diff --git a/lib/al/Library/Math/MtxUtil.h b/lib/al/Library/Math/MtxUtil.h new file mode 100644 index 00000000..7b22c1f2 --- /dev/null +++ b/lib/al/Library/Math/MtxUtil.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +namespace al { + +void makeMtxRotateTrans(sead::Matrix34f* out, const sead::Vector3f& rotate, + const sead::Vector3f& trans); +void makeMtxFrontUpPos(sead::Matrix34f* out, const sead::Vector3f& front, const sead::Vector3f& up, + const sead::Vector3f& pos); +void makeMtxUpFrontPos(sead::Matrix34f* out, const sead::Vector3f& up, const sead::Vector3f& front, + const sead::Vector3f& pos); +void makeMtxUpFrontPos(sead::Matrix34f* out, const sead::Vector3f& up, const sead::Vector3f& front, + const sead::Vector3f& pos); + +} // namespace al diff --git a/lib/al/Library/Math/ParabolicPath.cpp b/lib/al/Library/Math/ParabolicPath.cpp index bf0e4cf2..79a1b11a 100644 --- a/lib/al/Library/Math/ParabolicPath.cpp +++ b/lib/al/Library/Math/ParabolicPath.cpp @@ -1,6 +1,5 @@ #include "Library/Math/ParabolicPath.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" namespace al { diff --git a/lib/al/Library/Math/VectorUtil.h b/lib/al/Library/Math/VectorUtil.h deleted file mode 100644 index 20ca2653..00000000 --- a/lib/al/Library/Math/VectorUtil.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace al { - -void turnVecToVecDegree(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); -void turnVecToVecRate(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&, f32); -void verticalizeVec(sead::Vector3f*, const sead::Vector3f&, const sead::Vector3f&); - -void rotateQuatRadian(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); -void calcQuatFront(sead::Vector3f*, const sead::Quatf&); -void calcQuatUp(sead::Vector3f*, const sead::Quatf&); -void makeQuatFrontUp(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); -void makeQuatUpFront(sead::Quatf*, const sead::Vector3f&, const sead::Vector3f&); - -void rotateVectorDegreeX(sead::Vector3f*, f32); -void rotateVectorDegreeY(sead::Vector3f*, f32); -void rotateVectorDegreeZ(sead::Vector3f*, f32); - -void makeMtxFrontUpPos(sead::Matrix34f*, const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&); -void makeMtxUpFrontPos(sead::Matrix34f*, const sead::Vector3f&, const sead::Vector3f&, - const sead::Vector3f&); -void makeMtxRotateTrans(sead::Matrix34f*, const sead::Vector3f&, const sead::Vector3f&); - -void turnQuatYDirRate(sead::Quatf*, const sead::Quatf&, const sead::Vector3f&, f32); - -} // namespace al diff --git a/lib/al/Library/Matrix/MatrixPtrHolder.h b/lib/al/Library/Matrix/MatrixPtrHolder.h index 4ed54724..da89955b 100644 --- a/lib/al/Library/Matrix/MatrixPtrHolder.h +++ b/lib/al/Library/Matrix/MatrixPtrHolder.h @@ -3,9 +3,6 @@ #include namespace al { -void makeBayerMatrix(s32*, s32); -u32 f32ToF16(f32); -f32 f16ToF32(u16); class MtxPtrHolder { public: diff --git a/lib/al/Library/Movement/EnemyStateBlowDown.cpp b/lib/al/Library/Movement/EnemyStateBlowDown.cpp index ba8f0fcf..f619fcc4 100644 --- a/lib/al/Library/Movement/EnemyStateBlowDown.cpp +++ b/lib/al/Library/Movement/EnemyStateBlowDown.cpp @@ -7,7 +7,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorSensorFunction.h" -#include "Library/Math/MathAngleUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Movement/EnemyStateBlowDownParam.h" const al::EnemyStateBlowDownParam sEnemyStateBlowDownParam = diff --git a/lib/al/Library/Obj/BreakModel.cpp b/lib/al/Library/Obj/BreakModel.cpp index f5e9b4e0..3bb4ed56 100644 --- a/lib/al/Library/Obj/BreakModel.cpp +++ b/lib/al/Library/Obj/BreakModel.cpp @@ -6,7 +6,7 @@ #include "Library/LiveActor/ActorModelFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorResourceFunction.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Yaml/ByamlIter.h" #include "Library/Yaml/ByamlUtil.h" diff --git a/lib/al/Library/Obj/EffectObjFollowCameraLimit.cpp b/lib/al/Library/Obj/EffectObjFollowCameraLimit.cpp index a5cf09ca..1c9c5a7e 100644 --- a/lib/al/Library/Obj/EffectObjFollowCameraLimit.cpp +++ b/lib/al/Library/Obj/EffectObjFollowCameraLimit.cpp @@ -6,7 +6,7 @@ #include "Library/LiveActor/ActorClippingFunction.h" #include "Library/LiveActor/ActorDrawFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Matrix/MatrixUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Obj/EffectObjFunction.h" diff --git a/lib/al/Library/Obj/PartsModel.cpp b/lib/al/Library/Obj/PartsModel.cpp index a09e0aeb..107a454a 100644 --- a/lib/al/Library/Obj/PartsModel.cpp +++ b/lib/al/Library/Obj/PartsModel.cpp @@ -9,7 +9,6 @@ #include "Library/LiveActor/ActorResourceFunction.h" #include "Library/LiveActor/SubActorFunction.h" #include "Library/LiveActor/SubActorKeeper.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Matrix/MatrixUtil.h" #include "Library/Yaml/ByamlUtil.h" diff --git a/lib/al/Library/Rail/RailPart.cpp b/lib/al/Library/Rail/RailPart.cpp index ea94f5a1..678bb04f 100644 --- a/lib/al/Library/Rail/RailPart.cpp +++ b/lib/al/Library/Rail/RailPart.cpp @@ -1,8 +1,6 @@ #include "Library/Rail/RailPart.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" #include "Project/Rail/BezierCurve.h" #include "Project/Rail/LinearCurve.h" diff --git a/lib/al/Project/Camera/CameraAngleSwingInfo.cpp b/lib/al/Project/Camera/CameraAngleSwingInfo.cpp index 143efcc7..79055056 100644 --- a/lib/al/Project/Camera/CameraAngleSwingInfo.cpp +++ b/lib/al/Project/Camera/CameraAngleSwingInfo.cpp @@ -1,6 +1,5 @@ #include "Project/Camera/CameraAngleSwingInfo.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Yaml/ByamlUtil.h" diff --git a/lib/al/Project/Rail/LinearCurve.cpp b/lib/al/Project/Rail/LinearCurve.cpp index 2cfd4693..59b8f483 100644 --- a/lib/al/Project/Rail/LinearCurve.cpp +++ b/lib/al/Project/Rail/LinearCurve.cpp @@ -1,7 +1,6 @@ #include "Project/Rail/LinearCurve.h" -#include "Library/Math/MathLengthUtil.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" namespace al { diff --git a/src/Boss/Mofumofu/MofumofuWarpHole.cpp b/src/Boss/Mofumofu/MofumofuWarpHole.cpp index ae413800..2a4242a4 100644 --- a/src/Boss/Mofumofu/MofumofuWarpHole.cpp +++ b/src/Boss/Mofumofu/MofumofuWarpHole.cpp @@ -7,10 +7,7 @@ #include "Library/LiveActor/ActorInitInfo.h" #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/LiveActorUtil.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" -#include "Library/Math/VectorUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Enemy/EnemyCap.cpp b/src/Enemy/EnemyCap.cpp index afcf2552..842dfedb 100644 --- a/src/Enemy/EnemyCap.cpp +++ b/src/Enemy/EnemyCap.cpp @@ -13,8 +13,7 @@ #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorResourceFunction.h" #include "Library/LiveActor/SubActorKeeper.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Matrix/MatrixUtil.h" #include "Library/Movement/EnemyStateBlowDown.h" #include "Library/Movement/EnemyStateBlowDownParam.h" diff --git a/src/Enemy/EnemyStateRunAway.cpp b/src/Enemy/EnemyStateRunAway.cpp index ff6e591e..fe74007c 100644 --- a/src/Enemy/EnemyStateRunAway.cpp +++ b/src/Enemy/EnemyStateRunAway.cpp @@ -4,11 +4,7 @@ #include "Library/LiveActor/ActorCollisionFunction.h" #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" -#include "Library/Math/MathRandomUtil.h" #include "Library/Math/MathUtil.h" -#include "Library/Math/VectorUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Enemy/EnemyStateWander.cpp b/src/Enemy/EnemyStateWander.cpp index ab28f861..ed9fa077 100644 --- a/src/Enemy/EnemyStateWander.cpp +++ b/src/Enemy/EnemyStateWander.cpp @@ -4,7 +4,7 @@ #include "Library/LiveActor/ActorCollisionFunction.h" #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathRandomUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Enemy/SenobiLeaf.cpp b/src/Enemy/SenobiLeaf.cpp index c7cfa9dc..c47ae9a7 100644 --- a/src/Enemy/SenobiLeaf.cpp +++ b/src/Enemy/SenobiLeaf.cpp @@ -7,8 +7,7 @@ #include "Library/LiveActor/ActorInitInfo.h" #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/LiveActorUtil.h" -#include "Library/Math/MathRandomUtil.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" SenobiLeaf::SenobiLeaf(const char* actorName) : al::LiveActor(actorName) {} diff --git a/src/Layout/Compass.cpp b/src/Layout/Compass.cpp index 72c90469..2703d347 100644 --- a/src/Layout/Compass.cpp +++ b/src/Layout/Compass.cpp @@ -6,7 +6,6 @@ #include "Library/Layout/LayoutActionFunction.h" #include "Library/Layout/LayoutInitInfo.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Player/PlayerUtil.h" diff --git a/src/Layout/CounterLife.cpp b/src/Layout/CounterLife.cpp index 8be945e3..1c43fb88 100644 --- a/src/Layout/CounterLife.cpp +++ b/src/Layout/CounterLife.cpp @@ -3,7 +3,7 @@ #include "Library/Base/StringUtil.h" #include "Library/Layout/LayoutActionFunction.h" #include "Library/Layout/LayoutInitInfo.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "System/GameDataFunction.h" diff --git a/src/Layout/FilterFly.cpp b/src/Layout/FilterFly.cpp index f4c8894f..cb60dde3 100644 --- a/src/Layout/FilterFly.cpp +++ b/src/Layout/FilterFly.cpp @@ -3,8 +3,7 @@ #include "Library/Layout/LayoutActionFunction.h" #include "Library/Layout/LayoutActorUtil.h" #include "Library/Layout/LayoutInitInfo.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Layout/GaugeAir.cpp b/src/Layout/GaugeAir.cpp index d6fa7d81..78787843 100644 --- a/src/Layout/GaugeAir.cpp +++ b/src/Layout/GaugeAir.cpp @@ -2,7 +2,7 @@ #include "Library/Layout/LayoutActionFunction.h" #include "Library/Layout/LayoutInitInfo.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/MapObj/WorldMapParts.cpp b/src/MapObj/WorldMapParts.cpp index 2ca11bb5..984db369 100644 --- a/src/MapObj/WorldMapParts.cpp +++ b/src/MapObj/WorldMapParts.cpp @@ -3,7 +3,6 @@ #include "Library/LiveActor/ActorInitInfo.h" #include "Library/LiveActor/ActorModelFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" void localFunc_34B9A8(WorldMapParts* mapParts) { diff --git a/src/Player/Player.cpp b/src/Player/Player.cpp index 36647f01..801d1a06 100644 --- a/src/Player/Player.cpp +++ b/src/Player/Player.cpp @@ -12,7 +12,6 @@ #include "Library/LiveActor/ActorPoseKeeper.h" #include "Library/LiveActor/ActorSensorFunction.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Player/PlayerActionFunction.cpp b/src/Player/PlayerActionFunction.cpp index f3fb3763..ce62fd47 100644 --- a/src/Player/PlayerActionFunction.cpp +++ b/src/Player/PlayerActionFunction.cpp @@ -1,7 +1,6 @@ #include "Player/PlayerActionFunction.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" +#include "Library/Math/MathUtil.h" namespace PlayerActionFunction { diff --git a/src/Player/PlayerActionVelocityControl.cpp b/src/Player/PlayerActionVelocityControl.cpp index ccf655d0..004c1847 100644 --- a/src/Player/PlayerActionVelocityControl.cpp +++ b/src/Player/PlayerActionVelocityControl.cpp @@ -2,8 +2,6 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" #include "Player/PlayerActionFunction.h" diff --git a/src/Player/PlayerInput.cpp b/src/Player/PlayerInput.cpp index 955062a0..006067b5 100644 --- a/src/Player/PlayerInput.cpp +++ b/src/Player/PlayerInput.cpp @@ -3,10 +3,7 @@ #include "Library/Controller/InputFunction.h" #include "Library/Controller/JoyPadAccelPoseAnalyzer.h" #include "Library/LiveActor/LiveActor.h" -#include "Library/Math/MathAngleUtil.h" -#include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" -#include "Library/Math/VectorUtil.h" #include "Player/PlayerFunction.h" #include "Player/PlayerInputFunction.h" diff --git a/src/Player/PlayerJudgeDirectRolling.cpp b/src/Player/PlayerJudgeDirectRolling.cpp index b0613c20..c39d3d24 100644 --- a/src/Player/PlayerJudgeDirectRolling.cpp +++ b/src/Player/PlayerJudgeDirectRolling.cpp @@ -2,7 +2,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" +#include "Library/Math/MathUtil.h" #include "Player/IPlayerModelChanger.h" #include "Player/PlayerCarryKeeper.h" diff --git a/src/Player/PlayerJudgeGrabCeil.cpp b/src/Player/PlayerJudgeGrabCeil.cpp index f7e22b8b..85191ea6 100644 --- a/src/Player/PlayerJudgeGrabCeil.cpp +++ b/src/Player/PlayerJudgeGrabCeil.cpp @@ -3,7 +3,6 @@ #include "Library/Collision/CollisionParts.h" #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" #include "Library/Math/MathUtil.h" #include "Player/IPlayerModelChanger.h" diff --git a/src/Player/PlayerJudgeTalkGround.cpp b/src/Player/PlayerJudgeTalkGround.cpp index 7d24d3f5..9652b530 100644 --- a/src/Player/PlayerJudgeTalkGround.cpp +++ b/src/Player/PlayerJudgeTalkGround.cpp @@ -4,7 +4,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/VectorUtil.h" +#include "Library/Math/MathUtil.h" #include "Player/IPlayerModelChanger.h" #include "Player/PlayerCarryKeeper.h" diff --git a/src/Player/PlayerJudgeWallCatch.cpp b/src/Player/PlayerJudgeWallCatch.cpp index e4d73142..aa93b576 100644 --- a/src/Player/PlayerJudgeWallCatch.cpp +++ b/src/Player/PlayerJudgeWallCatch.cpp @@ -2,7 +2,7 @@ #include "Library/Collision/CollisionParts.h" #include "Library/LiveActor/ActorPoseKeeper.h" -#include "Library/Math/MathAngleUtil.h" +#include "Library/Math/MathUtil.h" #include "Player/IPlayerModelChanger.h" #include "Player/PlayerCarryKeeper.h" diff --git a/tools/check-format.py b/tools/check-format.py index 4a764ac9..8c6373df 100755 --- a/tools/check-format.py +++ b/tools/check-format.py @@ -147,12 +147,14 @@ def common_include_order(c, path, is_header): del lines[0] include_lines = [] + non_empty_include_lines = [] end_of_includes = False for line in lines: if line.startswith("#include"): if CHECK(lambda a: not end_of_includes, line, "Includes have to be listed at the very top of the file!", path): return include_lines.append(line) + non_empty_include_lines.append(line) elif line == "" and not end_of_includes: include_lines.append(line) else: @@ -160,6 +162,9 @@ def common_include_order(c, path, is_header): angled_includes, al_includes, game_includes = get_includes() + if len(non_empty_include_lines) != len(set(non_empty_include_lines)): + FAIL("Found duplicate includes!", -1, path) + order = -1 # -1=none (after initial newline) ; 0=angled (sead, agl, nn, eui) ; 1=al ; 2=game ; -2,-3,-4=newline after respective section (angled, al, game) for line in include_lines: if line == "":