diff --git a/configure.py b/configure.py index 9477086b..2b99d702 100755 --- a/configure.py +++ b/configure.py @@ -215,6 +215,7 @@ else: cflags_dolphin = [ *cflags_base, "-multibyte", + "-fp_contract off", ] # Metrowerks library flags diff --git a/include/Kyoto/Animation/TSegIdMapVariableSize.hpp b/include/Kyoto/Animation/TSegIdMapVariableSize.hpp new file mode 100644 index 00000000..f23a20f2 --- /dev/null +++ b/include/Kyoto/Animation/TSegIdMapVariableSize.hpp @@ -0,0 +1,14 @@ +#ifndef _TSEGIDMAPVARIABLESIZE +#define _TSEGIDMAPVARIABLESIZE + +#include +#include + +template < typename T > +struct TSegIdMapVariableSize { + +private: + rstl::reserved_vector< rstl::pair< signed char, signed char >, 100 > x4_links; +}; + +#endif // _TSEGIDMAPVARIABLESIZE diff --git a/include/MetroidPrime/PathFinding/CPFBitSet.hpp b/include/MetroidPrime/PathFinding/CPFBitSet.hpp new file mode 100644 index 00000000..53320142 --- /dev/null +++ b/include/MetroidPrime/PathFinding/CPFBitSet.hpp @@ -0,0 +1,15 @@ +#ifndef _CPFBITSET +#define _CPFBITSET + +class CPFBitSet { +public: + void Clear(); + void Add(int bit); + bool Test(int bit); + void Rmv(int bit); + +private: + int mBits[16]; +}; + +#endif // _CPFBITSET diff --git a/include/MetroidPrime/PathFinding/CPathFindArea.hpp b/include/MetroidPrime/PathFinding/CPathFindArea.hpp new file mode 100644 index 00000000..089b3f01 --- /dev/null +++ b/include/MetroidPrime/PathFinding/CPathFindArea.hpp @@ -0,0 +1,8 @@ +#ifndef _CPATHFINDAREA +#define _CPATHFINDAREA + +class CPFArea { + +}; + +#endif // _CPATHFINDAREA diff --git a/include/MetroidPrime/PathFinding/CPathFindRegion.hpp b/include/MetroidPrime/PathFinding/CPathFindRegion.hpp new file mode 100644 index 00000000..0712ef91 --- /dev/null +++ b/include/MetroidPrime/PathFinding/CPathFindRegion.hpp @@ -0,0 +1,64 @@ +#ifndef _CPATHFINDREGION +#define _CPATHFINDREGION + +#include +#include + +class CPFRegion; +class CPFRegionData { + CPFRegionData(); + + void SetOpenLess(CPFRegion* region); + CPFRegion* GetOpenLess(); + + void SetOpenMore(CPFRegion* region); + CPFRegion* GetOpenMore(); + + float GetCost(); + + void* GetParent(); + void Setup(CPFRegion* region, float cost); + void Setup(CPFRegion* region, float, float); + void GetG(); + + void SetBestPoint(const CVector3f& point); + const CVector3f& GetBestPoint() const; + + void SetCookie(int cookie); + int GetCookie() const; + +private: + float x0_bestPointDistSq; + CVector3f x4_bestPoint; + int x10_cookie; + float x14_cost; + float x18_g; + float x1c_h; + CPFRegion* x20_parent; + CPFRegion* x24_openLess; + CPFRegion* x28_openMore; + int x2c_parentLink; +}; + +class CPFArea; +class CPFNode; +class CPFLink; +class CPFRegion { + CPFRegion(); + void Fixup(CPFArea& area, int& numNodes); + +private: + uint x0_numNodes; + CPFNode* x4_startNode; + uint x8_numLinks; + CPFLink* xc_startLink; + uint x10_flags; + float x14_height; + CVector3f x18_normal; + uint x24_regionIdx; + CVector3f x28_centroid; + CAABox x34_bounds; + CPFRegionData* x4c_data; +}; + +#endif // _CPATHFINDREGION diff --git a/include/MetroidPrime/PathFinding/CPathFindSearch.hpp b/include/MetroidPrime/PathFinding/CPathFindSearch.hpp new file mode 100644 index 00000000..336129c2 --- /dev/null +++ b/include/MetroidPrime/PathFinding/CPathFindSearch.hpp @@ -0,0 +1,11 @@ +#ifndef _CPATHFINDSEARCH +#define _CPATHFINDSEARCH + +class CPFOpenList { + +}; + +class CPathFindSearch { + +}; +#endif // _CPATHFINDSEARCH diff --git a/src/GuiSys/CGuiObject.cpp b/src/GuiSys/CGuiObject.cpp index bff217b0..17667a39 100644 --- a/src/GuiSys/CGuiObject.cpp +++ b/src/GuiSys/CGuiObject.cpp @@ -36,8 +36,8 @@ void CGuiObject::Draw(const CGuiWidgetDrawParms& parms) const { void CGuiObject::MoveInWorld(const CVector3f& offset) { CVector3f pos; - if (x64_parent != nullptr) { - pos = x64_parent->RotateW2O(offset); + if (GetParent() != nullptr) { + pos = GetParent()->RotateW2O(offset); } x4_localXF.AddTranslation(offset); RecalculateTransforms(); diff --git a/src/MetroidPrime/CPhysicsActor.cpp b/src/MetroidPrime/CPhysicsActor.cpp index ceeb7ee0..483c988a 100644 --- a/src/MetroidPrime/CPhysicsActor.cpp +++ b/src/MetroidPrime/CPhysicsActor.cpp @@ -1,5 +1,6 @@ #include "MetroidPrime/CPhysicsActor.hpp" +#include "Kyoto/Math/CTransform4f.hpp" #include "Kyoto/Math/CloseEnough.hpp" #include "rstl/math.hpp" @@ -93,8 +94,8 @@ CPhysicsState CPhysicsActor::GetPhysicsState() const { void CPhysicsActor::SetPhysicsState(const CPhysicsState& state) { SetTranslation(state.GetTranslation()); - const CQuaternion& quat = state.GetOrientationWR(); - const CVector3f& translation = GetTranslation(); + CQuaternion quat = state.GetOrientation(); + CVector3f translation = GetTranslation(); SetTransform(quat.BuildTransform4f(translation)); SetConstantForceWR(state.GetConstantForceWR()); SetAngularMomentumWR(state.GetAngularMomentumWR()); @@ -137,7 +138,7 @@ CMotionState CPhysicsActor::PredictAngularMotion(float dt) const { CMotionState CPhysicsActor::PredictLinearMotion(float dt) const { CVector3f velocity = CalculateNewVelocityWR_UsingImpulses(); - CVector3f sum = x15c_force + x150_momentum; + CVector3f sum = GetConstantTotalForceWR(); return CMotionState(dt * velocity, CNUQuaternion(0.0f, CVector3f::Zero()), dt * sum + x168_impulse, CAxisAngle::Identity()); @@ -179,10 +180,10 @@ void CPhysicsActor::AddMotionState(const CMotionState& state) { CNUQuaternion q(CNUQuaternion::BuildFromMatrix3f(GetTransform().BuildMatrix3f())); q += state.GetOrientation(); const CQuaternion& quat = CQuaternion::FromNUQuaternion(q); - + CVector3f transPos = GetTransform().GetTranslation(); SetTransform(quat.BuildTransform4f(transPos)); - + transPos += state.GetTranslation(); SetTranslation(transPos); @@ -190,7 +191,6 @@ void CPhysicsActor::AddMotionState(const CMotionState& state) { x108_angularMomentum += state.GetAngularMomentum(); ComputeDerivedQuantities(); - } bool CPhysicsActor::WillMove(const CStateManager& mgr) {