2023-11-19 09:38:07 -05:00
|
|
|
#include "orientableroi.h"
|
|
|
|
|
2023-12-11 16:33:46 -05:00
|
|
|
#include "decomp.h"
|
2023-11-19 09:38:07 -05:00
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(OrientableROI, 0xdc)
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5910
|
2023-11-19 09:38:07 -05:00
|
|
|
void OrientableROI::VTable0x1c()
|
|
|
|
{
|
|
|
|
UpdateWorldBoundingVolumes();
|
|
|
|
UpdateWorldVelocity();
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5930
|
2023-11-19 09:38:07 -05:00
|
|
|
void OrientableROI::SetLocalTransform(const Matrix4Impl& p_transform)
|
|
|
|
{
|
|
|
|
reinterpret_cast<Matrix4Impl&>(m_local2world) = p_transform;
|
|
|
|
UpdateWorldBoundingVolumes();
|
|
|
|
UpdateWorldVelocity();
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5960
|
2023-11-19 09:38:07 -05:00
|
|
|
void OrientableROI::VTable0x24(const Matrix4Data& p_transform)
|
|
|
|
{
|
|
|
|
Matrix4Data l_matrix(m_local2world);
|
|
|
|
m_local2world.EqualsMxProduct(&p_transform, &l_matrix);
|
|
|
|
UpdateWorldBoundingVolumes();
|
|
|
|
UpdateWorldVelocity();
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a59b0
|
2023-11-19 09:38:07 -05:00
|
|
|
void OrientableROI::UpdateWorldData(const Matrix4Data& p_transform)
|
|
|
|
{
|
|
|
|
Matrix4Data l_matrix(m_local2world);
|
|
|
|
m_local2world.EqualsMxProduct(&l_matrix, &p_transform);
|
|
|
|
UpdateWorldBoundingVolumes();
|
|
|
|
UpdateWorldVelocity();
|
|
|
|
|
|
|
|
// iterate over comps
|
|
|
|
if (m_comp)
|
|
|
|
for (CompoundObject::iterator iter = m_comp->begin(); !(iter == m_comp->end()); iter++) {
|
|
|
|
ROI* child = *iter;
|
|
|
|
static_cast<OrientableROI*>(child)->UpdateWorldData(p_transform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5a50
|
2023-11-19 09:38:07 -05:00
|
|
|
void OrientableROI::UpdateWorldVelocity()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5d80
|
2023-11-19 09:38:07 -05:00
|
|
|
const Vector3& OrientableROI::GetWorldVelocity() const
|
|
|
|
{
|
|
|
|
return (Vector3&) *m_world_velocity.GetData();
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5d90
|
2023-11-19 09:38:07 -05:00
|
|
|
const BoundingBox& OrientableROI::GetWorldBoundingBox() const
|
|
|
|
{
|
|
|
|
return m_world_bounding_box;
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5da0
|
2023-11-19 09:38:07 -05:00
|
|
|
const BoundingSphere& OrientableROI::GetWorldBoundingSphere() const
|
|
|
|
{
|
|
|
|
return m_world_bounding_sphere;
|
|
|
|
}
|