mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Improve matches in ROI classes (#608)
* Improve matches in ROI classes * More function implementations * Fix name * Fix vtables * Add annotation
This commit is contained in:

committed by
GitHub

parent
e609924e4c
commit
ec29f2633d
@@ -16,8 +16,35 @@ OrientableROI::OrientableROI()
|
||||
ZEROVEC3(m_world_velocity);
|
||||
IDENTMAT4(m_local2world);
|
||||
|
||||
m_unk0xd4 = 0;
|
||||
m_unk0xd8 |= c_bit1 | c_bit2;
|
||||
m_unk0xd4 = NULL;
|
||||
ToggleUnknown0xd8(TRUE);
|
||||
}
|
||||
|
||||
// Maybe an overload based on MxMatrix type
|
||||
// FUNCTION: LEGO1 0x100a46a0
|
||||
void OrientableROI::WrappedSetLocalTransform(const Matrix4& p_transform)
|
||||
{
|
||||
SetLocalTransform(p_transform);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100a46b0
|
||||
void OrientableROI::FUN_100a46b0(Matrix4& p_transform)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// Maybe an overload based on MxMatrix type
|
||||
// FUNCTION: LEGO1 0x100a5090
|
||||
void OrientableROI::WrappedVTable0x24(const Matrix4& p_transform)
|
||||
{
|
||||
VTable0x24(p_transform);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a58f0
|
||||
void OrientableROI::FUN_100a58f0(const Matrix4& p_transform)
|
||||
{
|
||||
m_local2world = p_transform;
|
||||
ToggleUnknown0xd8(TRUE);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5910
|
||||
@@ -30,13 +57,13 @@ void OrientableROI::VTable0x1c()
|
||||
// FUNCTION: LEGO1 0x100a5930
|
||||
void OrientableROI::SetLocalTransform(const Matrix4& p_transform)
|
||||
{
|
||||
reinterpret_cast<Matrix4&>(m_local2world) = p_transform;
|
||||
m_local2world = p_transform;
|
||||
UpdateWorldBoundingVolumes();
|
||||
UpdateWorldVelocity();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5960
|
||||
void OrientableROI::VTable0x24(const MxMatrix& p_transform)
|
||||
void OrientableROI::VTable0x24(const Matrix4& p_transform)
|
||||
{
|
||||
MxMatrix l_matrix(m_local2world);
|
||||
m_local2world.Product(p_transform, l_matrix);
|
||||
@@ -45,7 +72,7 @@ void OrientableROI::VTable0x24(const MxMatrix& p_transform)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a59b0
|
||||
void OrientableROI::UpdateWorldData(const MxMatrix& p_transform)
|
||||
void OrientableROI::UpdateWorldData(const Matrix4& p_transform)
|
||||
{
|
||||
MxMatrix l_matrix(m_local2world);
|
||||
m_local2world.Product(l_matrix, p_transform);
|
||||
@@ -61,6 +88,12 @@ void OrientableROI::UpdateWorldData(const MxMatrix& p_transform)
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5a30
|
||||
void OrientableROI::FUN_100a5a30(const Vector3& p_world_velocity)
|
||||
{
|
||||
m_world_velocity = p_world_velocity;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5a50
|
||||
void OrientableROI::UpdateWorldVelocity()
|
||||
{
|
||||
|
@@ -5,6 +5,8 @@
|
||||
#include "mxgeometry/mxmatrix.h"
|
||||
#include "roi.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// VTABLE: LEGO1 0x100dbc08
|
||||
// SIZE 0xdc
|
||||
class OrientableROI : public ROI {
|
||||
@@ -19,32 +21,43 @@ public:
|
||||
const float* GetWorldVelocity() const override; // vtable+0x08
|
||||
const BoundingBox& GetWorldBoundingBox() const override; // vtable+0x0c
|
||||
const BoundingSphere& GetWorldBoundingSphere() const override; // vtable+0x10
|
||||
|
||||
// FUNCTION: LEGO1 0x100a5db0
|
||||
virtual void VTable0x14() { VTable0x1c(); } // vtable+0x14
|
||||
virtual void VTable0x14() { VTable0x1c(); } // vtable+0x14
|
||||
|
||||
virtual void UpdateWorldBoundingVolumes() = 0; // vtable+0x18
|
||||
virtual void VTable0x1c(); // vtable+0x1c
|
||||
virtual void SetLocalTransform(const Matrix4& p_transform); // vtable+0x20
|
||||
virtual void VTable0x24(const MxMatrix& p_transform); // vtable+0x24
|
||||
virtual void UpdateWorldData(const MxMatrix& p_transform); // vtable+0x28
|
||||
virtual void VTable0x24(const Matrix4& p_transform); // vtable+0x24
|
||||
virtual void UpdateWorldData(const Matrix4& p_transform); // vtable+0x28
|
||||
virtual void UpdateWorldVelocity(); // vtable+0x2c
|
||||
|
||||
void WrappedSetLocalTransform(const Matrix4& p_transform);
|
||||
void FUN_100a46b0(Matrix4& p_transform);
|
||||
void WrappedVTable0x24(const Matrix4& p_transform);
|
||||
void FUN_100a58f0(const Matrix4& p_transform);
|
||||
void FUN_100a5a30(const Vector3& p_world_velocity);
|
||||
|
||||
const MxMatrix& GetLocal2World() const { return m_local2world; }
|
||||
const float* GetWorldPosition() const { return m_local2world[3]; }
|
||||
const float* GetWorldDirection() const { return m_local2world[2]; }
|
||||
const float* GetWorldUp() const { return m_local2world[1]; }
|
||||
OrientableROI* GetUnknown0xd4() const { return m_unk0xd4; }
|
||||
|
||||
void ToggleUnknown0xd8(BOOL p_enable)
|
||||
{
|
||||
if (p_enable) {
|
||||
m_unk0xd8 |= c_bit1 | c_bit2;
|
||||
}
|
||||
else {
|
||||
m_unk0xd8 &= ~c_bit1;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
MxMatrix m_local2world; // 0x10
|
||||
BoundingBox m_world_bounding_box; // 0x58
|
||||
|
||||
// Unclear whether the following vectors are:
|
||||
// 1) Part of m_world_bounding_box;
|
||||
// 2) A second BoundingBox;
|
||||
// 3) Standalone vectors
|
||||
|
||||
Mx3DPointFloat m_unk0x80; // 0x80
|
||||
Mx3DPointFloat m_unk0x94; // 0x94
|
||||
MxMatrix m_local2world; // 0x10
|
||||
BoundingBox m_world_bounding_box; // 0x58
|
||||
BoundingBox m_unk0x80; // 0x80
|
||||
BoundingSphere m_world_bounding_sphere; // 0xa8
|
||||
Mx3DPointFloat m_world_velocity; // 0xc0
|
||||
OrientableROI* m_unk0xd4; // 0xd4
|
||||
|
@@ -15,10 +15,10 @@
|
||||
// SIZE 0x28
|
||||
class BoundingBox {
|
||||
public:
|
||||
const Mx3DPointFloat& Min() const { return min; }
|
||||
Mx3DPointFloat& Min() { return min; }
|
||||
const Mx3DPointFloat& Max() const { return max; }
|
||||
Mx3DPointFloat& Max() { return max; }
|
||||
const Vector3& Min() const { return min; }
|
||||
Vector3& Min() { return min; }
|
||||
const Vector3& Max() const { return max; }
|
||||
Vector3& Max() { return max; }
|
||||
|
||||
private:
|
||||
Mx3DPointFloat min; // 0x00
|
||||
@@ -31,8 +31,8 @@ private:
|
||||
// SIZE 0x18
|
||||
class BoundingSphere {
|
||||
public:
|
||||
const Mx3DPointFloat& Center() const { return center; }
|
||||
Mx3DPointFloat& Center() { return center; }
|
||||
const Vector3& Center() const { return center; }
|
||||
Vector3& Center() { return center; }
|
||||
const float& Radius() const { return radius; }
|
||||
float& Radius() { return radius; }
|
||||
|
||||
|
Reference in New Issue
Block a user