Isle
Loading...
Searching...
No Matches
orientableroi.h
Go to the documentation of this file.
1#ifndef ORIENTABLEROI_H
2#define ORIENTABLEROI_H
3
4#include "decomp.h"
6#include "roi.h"
7
8#include <windows.h>
9
10// VTABLE: LEGO1 0x100dbc08
11// SIZE 0xdc
12
29class OrientableROI : public ROI {
30public:
31 enum {
33 c_bit1 = 0x01,
35 c_bit2 = 0x02
36 };
37
42
47 const float* GetWorldVelocity() const override;
48
53 const BoundingBox& GetWorldBoundingBox() const override;
54
59 const BoundingSphere& GetWorldBoundingSphere() const override;
60
64 virtual void VTable0x14() { VTable0x1c(); }
65
71 virtual void UpdateWorldBoundingVolumes() = 0;
72
76 virtual void VTable0x1c();
77
84 virtual void SetLocalTransform(const Matrix4& p_transform);
85
92 virtual void VTable0x24(const Matrix4& p_transform);
93
100 virtual void UpdateWorldData(const Matrix4& p_transform);
101
107 virtual void UpdateWorldVelocity();
108
113 void WrappedSetLocalTransform(const Matrix4& p_transform);
114
120 void UpdateTransformationRelativeToParent(const Matrix4& p_transform);
121
126 void WrappedVTable0x24(const Matrix4& p_transform);
127
134 void GetLocalTransform(Matrix4& p_transform);
135
140 void FUN_100a58f0(const Matrix4& p_transform);
141
146 void FUN_100a5a30(const Vector3& p_world_velocity);
147
152 const Matrix4& GetLocal2World() const { return m_local2world; }
153
158 const float* GetWorldPosition() const { return m_local2world[3]; }
159
164 const float* GetWorldDirection() const { return m_local2world[2]; }
165
170 const float* GetWorldUp() const { return m_local2world[1]; }
171
177
182 void SetParentROI(OrientableROI* p_parentROI) { m_parentROI = p_parentROI; }
183
192 void ToggleUnknown0xd8(BOOL p_enable)
193 {
194 if (p_enable) {
196 }
197 else {
198 m_unk0xd8 &= ~c_bit1;
199 }
200 }
201
202protected:
207
212
217
222
227
232
237};
238
239// SYNTHETIC: LEGO1 0x100a4630
240// OrientableROI::`scalar deleting destructor'
241
242// SYNTHETIC: LEGO1 0x100aa2f0
243// OrientableROI::~OrientableROI
244
245#endif // ORIENTABLEROI_H
[AI] Represents an axis-aligned bounding box in 3D space, using minimum and maximum points.
Definition: roi.h:20
[AI] Represents a bounding sphere in 3D space with center and radius.
Definition: roi.h:56
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
[AI] Represents an ROI (Real-time Object Instance) that can be oriented in world space,...
Definition: orientableroi.h:29
const BoundingSphere & GetWorldBoundingSphere() const override
Returns the object's bounding sphere in world coordinates.
OrientableROI()
Default constructor.
BoundingBox m_world_bounding_box
The object's axis-aligned bounding box in world space, recalculated as needed.
virtual void SetLocalTransform(const Matrix4 &p_transform)
Sets the local-to-world transformation matrix directly.
@ c_bit2
[AI] Bit mask for internal status flag 2 (see usage in ToggleUnknown0xd8).
Definition: orientableroi.h:35
@ c_bit1
[AI] Bit mask for internal status flag 1 (see usage in ToggleUnknown0xd8).
Definition: orientableroi.h:33
const float * GetWorldUp() const
Returns a pointer to the world up vector from the transformation matrix.
const float * GetWorldPosition() const
Returns a pointer to the world position from the transformation matrix (translation row).
const float * GetWorldDirection() const
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
undefined4 m_unk0xd8
Unknown status or flag field; bits manipulated via ToggleUnknown0xd8, possibly related to dirty state...
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
virtual void UpdateWorldVelocity()
Updates the world velocity (must be implemented by subclasses if custom velocity logic is needed).
void WrappedSetLocalTransform(const Matrix4 &p_transform)
Wraps SetLocalTransform, for possible override or interface uniformity.
virtual void VTable0x1c()
[AI] Concrete subclass implementation should implement this to perform post-bounding-volume-change lo...
Mx3DPointFloat m_world_velocity
The object's velocity vector in world coordinates.
BoundingBox m_unk0x80
An unknown bounding box; usage unclear, could be related to extended collision or volume testing.
void FUN_100a5a30(const Vector3 &p_world_velocity)
Sets the world velocity to the provided vector.
const float * GetWorldVelocity() const override
Returns a pointer to the object's velocity vector in world space.
MxMatrix m_local2world
The transform from local to world space; 4x4 transformation matrix.
void GetLocalTransform(Matrix4 &p_transform)
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative...
virtual void VTable0x24(const Matrix4 &p_transform)
Post-multiplies the current local-to-world matrix by p_transform.
virtual void VTable0x14()
[AI] Calls VTable0x1c().
Definition: orientableroi.h:64
void WrappedVTable0x24(const Matrix4 &p_transform)
Wraps VTable0x24, possibly for decoupling or uniform invocation.
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
OrientableROI * m_parentROI
If non-null, points to the parent OrientableROI for local/world transformation hierarchy.
virtual void UpdateWorldBoundingVolumes()=0
Recalculates all world bounding volumes from the current local-to-world transform.
void SetParentROI(OrientableROI *p_parentROI)
Sets the parent ROI used for transformation hierarchy.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
OrientableROI * GetParentROI() const
Accessor for the parent ROI in the transformation hierarchy.
const BoundingBox & GetWorldBoundingBox() const override
Returns the object's bounding box in world coordinates.
BoundingSphere m_world_bounding_sphere
The object's bounding sphere in world space, recalculated from m_local2world.
void ToggleUnknown0xd8(BOOL p_enable)
Enables or disables some bitfields in the internal unknown status variable m_unk0xd8.
virtual void UpdateWorldData(const Matrix4 &p_transform)
Applies p_transform in (presumably) parent coordinates and updates world data for self and children.
[AI] Abstract base class for Real-time Object Instances (ROI) in the world.
Definition: roi.h:162
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
unsigned int undefined4
Definition: decomp.h:28
typedef BOOL(FAR PASCAL *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA