Isle
|
[AI] Represents an ROI (Real-time Object Instance) that can be oriented in world space, supporting local-to-world transformations and hierarchical parenting of orientation. More...
#include <orientableroi.h>
Public Types | |
enum | { c_bit1 = 0x01 , c_bit2 = 0x02 } |
Public Member Functions | |
OrientableROI () | |
Default constructor. More... | |
const float * | GetWorldVelocity () const override |
Returns a pointer to the object's velocity vector in world space. More... | |
const BoundingBox & | GetWorldBoundingBox () const override |
Returns the object's bounding box in world coordinates. More... | |
const BoundingSphere & | GetWorldBoundingSphere () const override |
Returns the object's bounding sphere in world coordinates. More... | |
virtual void | VTable0x14 () |
[AI] Calls VTable0x1c(). More... | |
virtual void | UpdateWorldBoundingVolumes ()=0 |
Recalculates all world bounding volumes from the current local-to-world transform. More... | |
virtual void | VTable0x1c () |
[AI] Concrete subclass implementation should implement this to perform post-bounding-volume-change logic. More... | |
virtual void | SetLocalTransform (const Matrix4 &p_transform) |
Sets the local-to-world transformation matrix directly. More... | |
virtual void | VTable0x24 (const Matrix4 &p_transform) |
Post-multiplies the current local-to-world matrix by p_transform. More... | |
virtual void | UpdateWorldData (const Matrix4 &p_transform) |
Applies p_transform in (presumably) parent coordinates and updates world data for self and children. More... | |
virtual void | UpdateWorldVelocity () |
Updates the world velocity (must be implemented by subclasses if custom velocity logic is needed). More... | |
void | WrappedSetLocalTransform (const Matrix4 &p_transform) |
Wraps SetLocalTransform, for possible override or interface uniformity. More... | |
void | UpdateTransformationRelativeToParent (const Matrix4 &p_transform) |
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldData. More... | |
void | WrappedVTable0x24 (const Matrix4 &p_transform) |
Wraps VTable0x24, possibly for decoupling or uniform invocation. More... | |
void | GetLocalTransform (Matrix4 &p_transform) |
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative to it. More... | |
void | FUN_100a58f0 (const Matrix4 &p_transform) |
Assigns the given matrix as the local-to-world transformation and enables some internal flags. More... | |
void | FUN_100a5a30 (const Vector3 &p_world_velocity) |
Sets the world velocity to the provided vector. More... | |
const Matrix4 & | GetLocal2World () const |
Accessor for the current local-to-world transformation matrix. More... | |
const float * | GetWorldPosition () const |
Returns a pointer to the world position from the transformation matrix (translation row). More... | |
const float * | GetWorldDirection () const |
Returns a pointer to the world direction vector (forward axis) from the transformation matrix. More... | |
const float * | GetWorldUp () const |
Returns a pointer to the world up vector from the transformation matrix. More... | |
OrientableROI * | GetParentROI () const |
Accessor for the parent ROI in the transformation hierarchy. More... | |
void | SetParentROI (OrientableROI *p_parentROI) |
Sets the parent ROI used for transformation hierarchy. More... | |
void | ToggleUnknown0xd8 (BOOL p_enable) |
Enables or disables some bitfields in the internal unknown status variable m_unk0xd8. More... | |
![]() | |
ROI () | |
[AI] Constructs an empty ROI, initially visible with no LOD or compound object assigned. More... | |
virtual | ~ROI () |
[AI] Destroys the ROI and asserts that 'comp' and 'lods' are managed/deleted by derived types. More... | |
virtual float | IntrinsicImportance () const =0 |
[AI] Returns the intrinsic importance (used for LOD selection, culling etc). More... | |
virtual const float * | GetWorldVelocity () const =0 |
[AI] Returns the object's world-space velocity as a pointer to float values. More... | |
virtual const BoundingBox & | GetWorldBoundingBox () const =0 |
[AI] Returns the world-space bounding box of the object. More... | |
virtual const BoundingSphere & | GetWorldBoundingSphere () const =0 |
[AI] Returns the world-space bounding sphere of the object. More... | |
const LODListBase * | GetLODs () const |
[AI] Returns the LOD list associated with this ROI, or NULL if not set. More... | |
const LODObject * | GetLOD (int i) const |
[AI] Returns the LODObject at the specified index. More... | |
int | GetLODCount () const |
[AI] Returns the number of available LODs for this ROI. More... | |
const CompoundObject * | GetComp () const |
[AI] Returns the pointer to the compound object structure, or NULL if not present. More... | |
unsigned char | GetVisibility () |
[AI] Returns the visibility flag; true if visible, false if hidden. More... | |
void | SetVisibility (unsigned char p_visible) |
[AI] Sets the visibility flag to the provided value. More... | |
Protected Attributes | |
MxMatrix | m_local2world |
The transform from local to world space; 4x4 transformation matrix. More... | |
BoundingBox | m_world_bounding_box |
The object's axis-aligned bounding box in world space, recalculated as needed. More... | |
BoundingBox | m_unk0x80 |
An unknown bounding box; usage unclear, could be related to extended collision or volume testing. More... | |
BoundingSphere | m_world_bounding_sphere |
The object's bounding sphere in world space, recalculated from m_local2world. More... | |
Mx3DPointFloat | m_world_velocity |
The object's velocity vector in world coordinates. More... | |
OrientableROI * | m_parentROI |
If non-null, points to the parent OrientableROI for local/world transformation hierarchy. More... | |
undefined4 | m_unk0xd8 |
Unknown status or flag field; bits manipulated via ToggleUnknown0xd8, possibly related to dirty state or internal update need. More... | |
![]() | |
CompoundObject * | comp |
[AI] List of sub-ROIs composing this ROI (compound object), or NULL. [AI] More... | |
LODListBase * | lods |
[AI] Pointer to list of LODObject instances, or NULL if not set. [AI] More... | |
unsigned char | m_visible |
[AI] Visibility flag: nonzero = visible. [AI] More... | |
[AI] Represents an ROI (Real-time Object Instance) that can be oriented in world space, supporting local-to-world transformations and hierarchical parenting of orientation.
Abstract base for objects that require orientation in the LEGO Island engine 3D world.
Inherits from ROI, and adds transformation, orientation, velocity, and bounding volume management.
Main responsibility: Provides transformation (matrix), velocity, and bounding volume handling for objects with orientation (position/rotation), allowing parent-child relationship for local/world calculations.
Notable responsibilities:
Abstract: cannot be instantiated; requires children to implement UpdateWorldBoundingVolumes. [AI]
Definition at line 29 of file orientableroi.h.
anonymous enum |
Definition at line 31 of file orientableroi.h.
OrientableROI::OrientableROI | ( | ) |
Default constructor.
Initializes bounding volumes, velocity, transformation matrix, and parent. [AI]
Definition at line 10 of file orientableroi.cpp.
void OrientableROI::FUN_100a58f0 | ( | const Matrix4 & | p_transform | ) |
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
[AI]
p_transform | New local-to-world transformation. [AI] |
Definition at line 104 of file orientableroi.cpp.
void OrientableROI::FUN_100a5a30 | ( | const Vector3 & | p_world_velocity | ) |
Sets the world velocity to the provided vector.
[AI]
p_world_velocity | New velocity in world space. [AI] |
Definition at line 152 of file orientableroi.cpp.
|
inline |
Accessor for the current local-to-world transformation matrix.
[AI]
Definition at line 152 of file orientableroi.h.
void OrientableROI::GetLocalTransform | ( | Matrix4 & | p_transform | ) |
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative to it.
[AI]
If the object has a parent, returns the transform needed to reach this object from its parent. [AI]
p_transform | Matrix to fill with the transform. [AI] |
Definition at line 72 of file orientableroi.cpp.
|
inline |
Accessor for the parent ROI in the transformation hierarchy.
[AI]
Definition at line 176 of file orientableroi.h.
|
overridevirtual |
Returns the object's bounding box in world coordinates.
[AI]
Implements ROI.
Definition at line 195 of file orientableroi.cpp.
|
overridevirtual |
Returns the object's bounding sphere in world coordinates.
[AI]
Implements ROI.
Definition at line 201 of file orientableroi.cpp.
|
inline |
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
[AI]
Definition at line 164 of file orientableroi.h.
|
inline |
Returns a pointer to the world position from the transformation matrix (translation row).
[AI]
Definition at line 158 of file orientableroi.h.
|
inline |
Returns a pointer to the world up vector from the transformation matrix.
[AI]
Definition at line 170 of file orientableroi.h.
|
overridevirtual |
Returns a pointer to the object's velocity vector in world space.
[AI]
Implements ROI.
Definition at line 189 of file orientableroi.cpp.
|
virtual |
Sets the local-to-world transformation matrix directly.
[AI]
Updates m_local2world and recalculates bounding volumes and velocity. [AI]
p_transform | New transformation matrix (local-to-world). [AI] |
Reimplemented in ViewROI.
Definition at line 118 of file orientableroi.cpp.
|
inline |
Sets the parent ROI used for transformation hierarchy.
[AI]
p_parentROI | Parent OrientableROI pointer. [AI] |
Definition at line 182 of file orientableroi.h.
|
inline |
Enables or disables some bitfields in the internal unknown status variable m_unk0xd8.
[AI]
If enabled, sets both c_bit1 and c_bit2; otherwise only clears c_bit1. The exact meaning is unknown. [AI]
p_enable | TRUE to enable, FALSE to clear c_bit1. [AI] |
Definition at line 192 of file orientableroi.h.
void OrientableROI::UpdateTransformationRelativeToParent | ( | const Matrix4 & | p_transform | ) |
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldData.
[AI]
Used when an object's transform is to be re-parented or altered in the context of another parent. [AI]
p_transform | Transform relative to parent to be adopted. [AI] |
Definition at line 32 of file orientableroi.cpp.
|
pure virtual |
Recalculates all world bounding volumes from the current local-to-world transform.
Must be implemented by subclasses. [AI]
Typically, this means recalculating m_world_bounding_box and m_world_bounding_sphere after m_local2world changes. [AI]
Implemented in LegoROI.
|
virtual |
Applies p_transform in (presumably) parent coordinates and updates world data for self and children.
[AI]
Typical usage: propagate transformation hierarchy. [AI]
p_transform | Transform to apply in world or parent space. [AI] |
Reimplemented in ViewROI.
Definition at line 135 of file orientableroi.cpp.
|
virtual |
Updates the world velocity (must be implemented by subclasses if custom velocity logic is needed).
[AI]
For many objects, may be left empty if not moving. [AI]
Definition at line 158 of file orientableroi.cpp.
|
inlinevirtual |
[AI] Calls VTable0x1c().
Default implementation delegates to VTable0x1c. May be overridden by children. [AI]
Definition at line 64 of file orientableroi.h.
|
virtual |
[AI] Concrete subclass implementation should implement this to perform post-bounding-volume-change logic.
Default calls UpdateWorldBoundingVolumes and UpdateWorldVelocity. [AI]
Reimplemented in ViewROI.
Definition at line 111 of file orientableroi.cpp.
|
virtual |
Post-multiplies the current local-to-world matrix by p_transform.
[AI]
This allows relative rotation/translation to be combined. [AI]
p_transform | Matrix to post-multiply. [AI] |
Reimplemented in ViewROI.
Definition at line 126 of file orientableroi.cpp.
void OrientableROI::WrappedSetLocalTransform | ( | const Matrix4 & | p_transform | ) |
Wraps SetLocalTransform, for possible override or interface uniformity.
[AI]
p_transform | Matrix to set as local-to-world. [AI] |
Definition at line 26 of file orientableroi.cpp.
void OrientableROI::WrappedVTable0x24 | ( | const Matrix4 & | p_transform | ) |
Wraps VTable0x24, possibly for decoupling or uniform invocation.
[AI]
p_transform | Transform to post-multiply. [AI] |
Definition at line 65 of file orientableroi.cpp.
|
protected |
The transform from local to world space; 4x4 transformation matrix.
[AI]
Definition at line 206 of file orientableroi.h.
|
protected |
If non-null, points to the parent OrientableROI for local/world transformation hierarchy.
[AI]
Definition at line 231 of file orientableroi.h.
|
protected |
An unknown bounding box; usage unclear, could be related to extended collision or volume testing.
[AI]
Definition at line 216 of file orientableroi.h.
|
protected |
Unknown status or flag field; bits manipulated via ToggleUnknown0xd8, possibly related to dirty state or internal update need.
[AI]
Definition at line 236 of file orientableroi.h.
|
protected |
The object's axis-aligned bounding box in world space, recalculated as needed.
[AI]
Definition at line 211 of file orientableroi.h.
|
protected |
The object's bounding sphere in world space, recalculated from m_local2world.
[AI]
Definition at line 221 of file orientableroi.h.
|
protected |
The object's velocity vector in world coordinates.
[AI]
Definition at line 226 of file orientableroi.h.