Isle
Loading...
Searching...
No Matches
OrientableROI Class Referenceabstract

[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>

Inheritance diagram for OrientableROI:
Collaboration diagram for OrientableROI:

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 BoundingBoxGetWorldBoundingBox () const override
 Returns the object's bounding box in world coordinates. More...
 
const BoundingSphereGetWorldBoundingSphere () 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 Matrix4GetLocal2World () 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...
 
OrientableROIGetParentROI () 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...
 
- Public Member Functions inherited from ROI
 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 BoundingBoxGetWorldBoundingBox () const =0
 [AI] Returns the world-space bounding box of the object. More...
 
virtual const BoundingSphereGetWorldBoundingSphere () const =0
 [AI] Returns the world-space bounding sphere of the object. More...
 
const LODListBaseGetLODs () const
 [AI] Returns the LOD list associated with this ROI, or NULL if not set. More...
 
const LODObjectGetLOD (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 CompoundObjectGetComp () 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...
 
OrientableROIm_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...
 
- Protected Attributes inherited from ROI
CompoundObjectcomp
 [AI] List of sub-ROIs composing this ROI (compound object), or NULL. [AI] More...
 
LODListBaselods
 [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...
 

Detailed Description

[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:

  • Maintains hierarchy via parent ROI pointer
  • Holds a local-to-world matrix for accurate orientation
  • Updates bounding box and bounding sphere in world space
  • Provides utility operations for transformation propagation and bounding calculations

Abstract: cannot be instantiated; requires children to implement UpdateWorldBoundingVolumes. [AI]

Definition at line 29 of file orientableroi.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
c_bit1 

[AI] Bit mask for internal status flag 1 (see usage in ToggleUnknown0xd8).

Meaning unknown. [AI]

c_bit2 

[AI] Bit mask for internal status flag 2 (see usage in ToggleUnknown0xd8).

Meaning unknown. [AI]

Definition at line 31 of file orientableroi.h.

Constructor & Destructor Documentation

◆ OrientableROI()

OrientableROI::OrientableROI ( )

Default constructor.

Initializes bounding volumes, velocity, transformation matrix, and parent. [AI]

Definition at line 10 of file orientableroi.cpp.

Member Function Documentation

◆ FUN_100a58f0()

void OrientableROI::FUN_100a58f0 ( const Matrix4 p_transform)

Assigns the given matrix as the local-to-world transformation and enables some internal flags.

[AI]

Parameters
p_transformNew local-to-world transformation. [AI]

Definition at line 104 of file orientableroi.cpp.

◆ FUN_100a5a30()

void OrientableROI::FUN_100a5a30 ( const Vector3 p_world_velocity)

Sets the world velocity to the provided vector.

[AI]

Parameters
p_world_velocityNew velocity in world space. [AI]

Definition at line 152 of file orientableroi.cpp.

◆ GetLocal2World()

const Matrix4 & OrientableROI::GetLocal2World ( ) const
inline

Accessor for the current local-to-world transformation matrix.

[AI]

Returns
Reference to the local-to-world matrix. [AI]

Definition at line 152 of file orientableroi.h.

◆ GetLocalTransform()

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]

Parameters
p_transformMatrix to fill with the transform. [AI]

Definition at line 72 of file orientableroi.cpp.

◆ GetParentROI()

OrientableROI * OrientableROI::GetParentROI ( ) const
inline

Accessor for the parent ROI in the transformation hierarchy.

[AI]

Returns
OrientableROI pointer for the parent (may be nullptr). [AI]

Definition at line 176 of file orientableroi.h.

◆ GetWorldBoundingBox()

const BoundingBox & OrientableROI::GetWorldBoundingBox ( ) const
overridevirtual

Returns the object's bounding box in world coordinates.

[AI]

Returns
Reference to world-aligned bounding box. [AI]

Implements ROI.

Definition at line 195 of file orientableroi.cpp.

◆ GetWorldBoundingSphere()

const BoundingSphere & OrientableROI::GetWorldBoundingSphere ( ) const
overridevirtual

Returns the object's bounding sphere in world coordinates.

[AI]

Returns
Reference to world-aligned bounding sphere. [AI]

Implements ROI.

Definition at line 201 of file orientableroi.cpp.

◆ GetWorldDirection()

const float * OrientableROI::GetWorldDirection ( ) const
inline

Returns a pointer to the world direction vector (forward axis) from the transformation matrix.

[AI]

Returns
Pointer to the direction component of m_local2world. [AI]

Definition at line 164 of file orientableroi.h.

◆ GetWorldPosition()

const float * OrientableROI::GetWorldPosition ( ) const
inline

Returns a pointer to the world position from the transformation matrix (translation row).

[AI]

Returns
Pointer to the translation component of m_local2world. [AI]

Definition at line 158 of file orientableroi.h.

◆ GetWorldUp()

const float * OrientableROI::GetWorldUp ( ) const
inline

Returns a pointer to the world up vector from the transformation matrix.

[AI]

Returns
Pointer to the up component of m_local2world. [AI]

Definition at line 170 of file orientableroi.h.

◆ GetWorldVelocity()

const float * OrientableROI::GetWorldVelocity ( ) const
overridevirtual

Returns a pointer to the object's velocity vector in world space.

[AI]

Returns
Pointer to float array for velocity. [AI]

Implements ROI.

Definition at line 189 of file orientableroi.cpp.

◆ SetLocalTransform()

void OrientableROI::SetLocalTransform ( const Matrix4 p_transform)
virtual

Sets the local-to-world transformation matrix directly.

[AI]

Updates m_local2world and recalculates bounding volumes and velocity. [AI]

Parameters
p_transformNew transformation matrix (local-to-world). [AI]

Reimplemented in ViewROI.

Definition at line 118 of file orientableroi.cpp.

◆ SetParentROI()

void OrientableROI::SetParentROI ( OrientableROI p_parentROI)
inline

Sets the parent ROI used for transformation hierarchy.

[AI]

Parameters
p_parentROIParent OrientableROI pointer. [AI]

Definition at line 182 of file orientableroi.h.

◆ ToggleUnknown0xd8()

void OrientableROI::ToggleUnknown0xd8 ( BOOL  p_enable)
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]

Parameters
p_enableTRUE to enable, FALSE to clear c_bit1. [AI]

Definition at line 192 of file orientableroi.h.

◆ UpdateTransformationRelativeToParent()

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]

Parameters
p_transformTransform relative to parent to be adopted. [AI]

Definition at line 32 of file orientableroi.cpp.

◆ UpdateWorldBoundingVolumes()

virtual void OrientableROI::UpdateWorldBoundingVolumes ( )
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.

◆ UpdateWorldData()

void OrientableROI::UpdateWorldData ( const Matrix4 p_transform)
virtual

Applies p_transform in (presumably) parent coordinates and updates world data for self and children.

[AI]

Typical usage: propagate transformation hierarchy. [AI]

Parameters
p_transformTransform to apply in world or parent space. [AI]

Reimplemented in ViewROI.

Definition at line 135 of file orientableroi.cpp.

◆ UpdateWorldVelocity()

void OrientableROI::UpdateWorldVelocity ( )
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.

◆ VTable0x14()

virtual void OrientableROI::VTable0x14 ( )
inlinevirtual

[AI] Calls VTable0x1c().

Default implementation delegates to VTable0x1c. May be overridden by children. [AI]

Definition at line 64 of file orientableroi.h.

◆ VTable0x1c()

void OrientableROI::VTable0x1c ( )
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.

◆ VTable0x24()

void OrientableROI::VTable0x24 ( const Matrix4 p_transform)
virtual

Post-multiplies the current local-to-world matrix by p_transform.

[AI]

This allows relative rotation/translation to be combined. [AI]

Parameters
p_transformMatrix to post-multiply. [AI]

Reimplemented in ViewROI.

Definition at line 126 of file orientableroi.cpp.

◆ WrappedSetLocalTransform()

void OrientableROI::WrappedSetLocalTransform ( const Matrix4 p_transform)

Wraps SetLocalTransform, for possible override or interface uniformity.

[AI]

Parameters
p_transformMatrix to set as local-to-world. [AI]

Definition at line 26 of file orientableroi.cpp.

◆ WrappedVTable0x24()

void OrientableROI::WrappedVTable0x24 ( const Matrix4 p_transform)

Wraps VTable0x24, possibly for decoupling or uniform invocation.

[AI]

Parameters
p_transformTransform to post-multiply. [AI]

Definition at line 65 of file orientableroi.cpp.

Member Data Documentation

◆ m_local2world

MxMatrix OrientableROI::m_local2world
protected

The transform from local to world space; 4x4 transformation matrix.

[AI]

Definition at line 206 of file orientableroi.h.

◆ m_parentROI

OrientableROI* OrientableROI::m_parentROI
protected

If non-null, points to the parent OrientableROI for local/world transformation hierarchy.

[AI]

Definition at line 231 of file orientableroi.h.

◆ m_unk0x80

BoundingBox OrientableROI::m_unk0x80
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.

◆ m_unk0xd8

undefined4 OrientableROI::m_unk0xd8
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.

◆ m_world_bounding_box

BoundingBox OrientableROI::m_world_bounding_box
protected

The object's axis-aligned bounding box in world space, recalculated as needed.

[AI]

Definition at line 211 of file orientableroi.h.

◆ m_world_bounding_sphere

BoundingSphere OrientableROI::m_world_bounding_sphere
protected

The object's bounding sphere in world space, recalculated from m_local2world.

[AI]

Definition at line 221 of file orientableroi.h.

◆ m_world_velocity

Mx3DPointFloat OrientableROI::m_world_velocity
protected

The object's velocity vector in world coordinates.

[AI]

Definition at line 226 of file orientableroi.h.


The documentation for this class was generated from the following files: