mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 12:21:39 +00:00
SWA API mappings
This commit is contained in:
parent
4ab26a1696
commit
eb3225c2f7
12 changed files with 121 additions and 3 deletions
19
UnleashedRecomp/api/Hedgehog/Math/Aabb.h
Normal file
19
UnleashedRecomp/api/Hedgehog/Math/Aabb.h
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace Hedgehog::Math
|
||||||
|
{
|
||||||
|
class CAabb // Eigen::AlignedBox3f
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Hedgehog::Math::CVector min;
|
||||||
|
Hedgehog::Math::CVector max;
|
||||||
|
|
||||||
|
CVector Center() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_SIZEOF(CAabb, 0x18);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "Aabb.inl"
|
||||||
12
UnleashedRecomp/api/Hedgehog/Math/Aabb.inl
Normal file
12
UnleashedRecomp/api/Hedgehog/Math/Aabb.inl
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
namespace Hedgehog::Math
|
||||||
|
{
|
||||||
|
inline CVector Hedgehog::Math::CAabb::Center() const
|
||||||
|
{
|
||||||
|
// return (min + max) / 2;
|
||||||
|
Hedgehog::Math::CVector result;
|
||||||
|
result.X = (max.X + min.X) * 0.5f;
|
||||||
|
result.Y = (max.Y + min.Y) * 0.5f;
|
||||||
|
result.Z = 0.5f * (max.Z + min.Z);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
UnleashedRecomp/api/Hedgehog/Math/Matrix.h
Normal file
21
UnleashedRecomp/api/Hedgehog/Math/Matrix.h
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace Hedgehog::Math
|
||||||
|
{
|
||||||
|
class CMatrix
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
be<float> data[16]; // Eigen::Affine3f
|
||||||
|
};
|
||||||
|
|
||||||
|
class CMatrix44
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
be<float> data[16]; // Eigen::Matrix4f
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_SIZEOF(CMatrix, 0x40);
|
||||||
|
SWA_ASSERT_SIZEOF(CMatrix44, 0x40);
|
||||||
|
}
|
||||||
17
UnleashedRecomp/api/Hedgehog/Math/Quaternion.h
Normal file
17
UnleashedRecomp/api/Hedgehog/Math/Quaternion.h
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace Hedgehog::Math
|
||||||
|
{
|
||||||
|
class CQuaternion //Eigen::Quaternionf;
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
be<float> X;
|
||||||
|
be<float> Y;
|
||||||
|
be<float> Z;
|
||||||
|
be<float> W;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_SIZEOF(CQuaternion, 0x10);
|
||||||
|
}
|
||||||
|
|
@ -28,3 +28,5 @@ namespace Hedgehog::Math
|
||||||
be<float> W;
|
be<float> W;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "Vector.inl"
|
||||||
|
|
|
||||||
4
UnleashedRecomp/api/Hedgehog/Math/Vector.inl
Normal file
4
UnleashedRecomp/api/Hedgehog/Math/Vector.inl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
namespace Hedgehog::Math
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
18
UnleashedRecomp/api/Hedgehog/MirageCore/Camera/hhCamera.h
Normal file
18
UnleashedRecomp/api/Hedgehog/MirageCore/Camera/hhCamera.h
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace Hedgehog::Mirage
|
||||||
|
{
|
||||||
|
class CCamera : Base::CObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Math::CMatrix m_View;
|
||||||
|
Math::CMatrix44 m_Projection;
|
||||||
|
Math::CVector m_Position;
|
||||||
|
Math::CVector m_Direction;
|
||||||
|
be<float> m_AspectRatio;
|
||||||
|
be<float> m_Near;
|
||||||
|
be<float> m_Far;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -27,7 +27,11 @@
|
||||||
#include "Hedgehog/Base/Type/hhSharedString.h"
|
#include "Hedgehog/Base/Type/hhSharedString.h"
|
||||||
#include "Hedgehog/Base/hhObject.h"
|
#include "Hedgehog/Base/hhObject.h"
|
||||||
#include "Hedgehog/Database/System/hhDatabaseData.h"
|
#include "Hedgehog/Database/System/hhDatabaseData.h"
|
||||||
|
#include "Hedgehog/Math/Aabb.h"
|
||||||
|
#include "Hedgehog/Math/Matrix.h"
|
||||||
|
#include "Hedgehog/Math/Quaternion.h"
|
||||||
#include "Hedgehog/Math/Vector.h"
|
#include "Hedgehog/Math/Vector.h"
|
||||||
|
#include "Hedgehog/MirageCore/Camera/hhCamera.h"
|
||||||
#include "Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h"
|
#include "Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h"
|
||||||
#include "Hedgehog/MirageCore/RenderData/hhMaterialData.h"
|
#include "Hedgehog/MirageCore/RenderData/hhMaterialData.h"
|
||||||
#include "Hedgehog/MirageCore/RenderData/hhMeshData.h"
|
#include "Hedgehog/MirageCore/RenderData/hhMeshData.h"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ namespace SWA
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
xpointer<void> m_pVftable;
|
xpointer<void> m_pVftable;
|
||||||
SWA_INSERT_PADDING(0xC4);
|
// SWA::CCamera::MyCamera
|
||||||
|
SWA_INSERT_PADDING(0xC4);
|
||||||
be<float> m_VertAspectRatio;
|
be<float> m_VertAspectRatio;
|
||||||
SWA_INSERT_PADDING(0x48);
|
SWA_INSERT_PADDING(0x48);
|
||||||
be<float> m_HorzAspectRatio;
|
be<float> m_HorzAspectRatio;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ namespace SWA
|
||||||
SWA_INSERT_PADDING(0x10);
|
SWA_INSERT_PADDING(0x10);
|
||||||
};
|
};
|
||||||
|
|
||||||
SWA_INSERT_PADDING(0x1C);
|
SWA_INSERT_PADDING(0x10);
|
||||||
|
hh::map<Hedgehog::Base::CSharedString, boost::shared_ptr<SWA::CWorld>> m_Worlds;
|
||||||
boost::shared_ptr<Hedgehog::Database::CDatabase> m_spDatabase;
|
boost::shared_ptr<Hedgehog::Database::CDatabase> m_spDatabase;
|
||||||
SWA_INSERT_PADDING(0x88);
|
SWA_INSERT_PADDING(0x88);
|
||||||
Hedgehog::Base::CSharedString m_StageName;
|
Hedgehog::Base::CSharedString m_StageName;
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,21 @@ namespace SWA
|
||||||
class CMember
|
class CMember
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x80);
|
//boost::shared_ptr<Hedgehog::Mirage::CRenderScene> m_spRenderScene;
|
||||||
|
//Hedgehog::Base::CSharedString m_Name;
|
||||||
|
SWA_INSERT_PADDING(0xC);
|
||||||
|
boost::shared_ptr<CCamera> m_spCamera;
|
||||||
|
boost::shared_ptr<CCamera> m_spOverrideCamera;
|
||||||
|
SWA_INSERT_PADDING(0x64);
|
||||||
};
|
};
|
||||||
|
|
||||||
xpointer<CMember> m_pMember;
|
xpointer<CMember> m_pMember;
|
||||||
|
|
||||||
|
boost::shared_ptr<CCamera> GetCamera() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//SWA_ASSERT_OFFSETOF(CWorld::CMember, m_spCamera, 0xC);
|
||||||
|
//SWA_ASSERT_SIZEOF(CWorld::CMember, 0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "World.inl"
|
||||||
|
|
|
||||||
7
UnleashedRecomp/api/SWA/System/World.inl
Normal file
7
UnleashedRecomp/api/SWA/System/World.inl
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
inline boost::shared_ptr<CCamera> CWorld::GetCamera() const
|
||||||
|
{
|
||||||
|
return m_pMember->m_spOverrideCamera ? m_pMember->m_spOverrideCamera : m_pMember->m_spCamera;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue