Matrix/vector refactor (#426)

This commit is contained in:
Christian Semmler
2024-01-12 19:34:38 -05:00
committed by GitHub
parent eac096036a
commit d24f5db42f
41 changed files with 865 additions and 1365 deletions

View File

@@ -2,8 +2,24 @@
#include "decomp.h"
#include <vec.h>
DECOMP_SIZE_ASSERT(OrientableROI, 0xdc)
// FUNCTION: LEGO1 0x100a4420
OrientableROI::OrientableROI()
{
FILLVEC3(m_world_bounding_box.Min(), 888888.8);
FILLVEC3(m_world_bounding_box.Max(), -888888.8);
ZEROVEC3(m_world_bounding_sphere.Center());
m_world_bounding_sphere.Radius() = 0.0;
ZEROVEC3(m_world_velocity);
IDENTMAT4(m_local2world);
m_unk0xd4 = 0;
m_unk0xd8 |= Flag_Bit1 | Flag_Bit2;
}
// FUNCTION: LEGO1 0x100a5910
void OrientableROI::VTable0x1c()
{
@@ -12,27 +28,27 @@ void OrientableROI::VTable0x1c()
}
// FUNCTION: LEGO1 0x100a5930
void OrientableROI::SetLocalTransform(const Matrix4Impl& p_transform)
void OrientableROI::SetLocalTransform(const Matrix4& p_transform)
{
reinterpret_cast<Matrix4Impl&>(m_local2world) = p_transform;
reinterpret_cast<Matrix4&>(m_local2world) = p_transform;
UpdateWorldBoundingVolumes();
UpdateWorldVelocity();
}
// FUNCTION: LEGO1 0x100a5960
void OrientableROI::VTable0x24(const Matrix4Data& p_transform)
void OrientableROI::VTable0x24(const MxMatrix& p_transform)
{
Matrix4Data l_matrix(m_local2world);
m_local2world.EqualsMxProduct(&p_transform, &l_matrix);
MxMatrix l_matrix(m_local2world);
m_local2world.Product(p_transform, l_matrix);
UpdateWorldBoundingVolumes();
UpdateWorldVelocity();
}
// FUNCTION: LEGO1 0x100a59b0
void OrientableROI::UpdateWorldData(const Matrix4Data& p_transform)
void OrientableROI::UpdateWorldData(const MxMatrix& p_transform)
{
Matrix4Data l_matrix(m_local2world);
m_local2world.EqualsMxProduct(&l_matrix, &p_transform);
MxMatrix l_matrix(m_local2world);
m_local2world.Product(l_matrix, p_transform);
UpdateWorldBoundingVolumes();
UpdateWorldVelocity();
@@ -50,9 +66,9 @@ void OrientableROI::UpdateWorldVelocity()
}
// FUNCTION: LEGO1 0x100a5d80
const Vector3& OrientableROI::GetWorldVelocity() const
const float* OrientableROI::GetWorldVelocity() const
{
return (Vector3&) *m_world_velocity.GetData();
return m_world_velocity.GetData();
}
// FUNCTION: LEGO1 0x100a5d90