diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index e2a7ce16..029826c0 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -38,22 +38,6 @@ int g_roiConfig = 100; // GLOBAL: LEGO1 0x101013ac ROIHandler g_someHandlerFunction = NULL; -// FUNCTION: LEGO1 0x100a46a0 -void LegoROI::WrappedSetLocalTransform(Matrix4& p_transform) -{ - SetLocalTransform(p_transform); -} - -// STUB: LEGO1 0x100a46b0 -void LegoROI::FUN_100a46b0(Matrix4& p_transform) -{ -} - -// STUB: LEGO1 0x100a58f0 -void LegoROI::FUN_100a58f0(const Matrix4& p_transform) -{ -} - // FUNCTION: LEGO1 0x100a81c0 void LegoROI::configureLegoROI(int p_roiConfig) { diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index aa4f3b37..643713a3 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -44,10 +44,6 @@ class LegoROI : public ViewROI { ); static unsigned char ColorAliasLookup(char* p_param, float& p_red, float& p_green, float& p_blue, float& p_other); - void WrappedSetLocalTransform(Matrix4& p_transform); - void FUN_100a46b0(Matrix4& p_transform); - void FUN_100a58f0(const Matrix4& p_transform); - inline const char* GetName() const { return m_name; } inline LegoEntity* GetUnknown0x104() { return m_unk0x104; } diff --git a/LEGO1/realtime/orientableroi.cpp b/LEGO1/realtime/orientableroi.cpp index 988b3f77..f8d6d03f 100644 --- a/LEGO1/realtime/orientableroi.cpp +++ b/LEGO1/realtime/orientableroi.cpp @@ -20,6 +20,33 @@ OrientableROI::OrientableROI() 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 void OrientableROI::VTable0x1c() { @@ -30,13 +57,13 @@ void OrientableROI::VTable0x1c() // FUNCTION: LEGO1 0x100a5930 void OrientableROI::SetLocalTransform(const Matrix4& p_transform) { - reinterpret_cast(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_vector) +{ + m_world_velocity = p_vector; +} + // FUNCTION: LEGO1 0x100a5a50 void OrientableROI::UpdateWorldVelocity() { diff --git a/LEGO1/realtime/orientableroi.h b/LEGO1/realtime/orientableroi.h index 9f059826..0c5ca139 100644 --- a/LEGO1/realtime/orientableroi.h +++ b/LEGO1/realtime/orientableroi.h @@ -28,10 +28,16 @@ class OrientableROI : public ROI { 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_vector); + const MxMatrix& GetLocal2World() const { return m_local2world; } const float* GetWorldPosition() const { return m_local2world[3]; } const float* GetWorldDirection() const { return m_local2world[2]; }