Isle
Loading...
Searching...
No Matches
ViewROI Class Reference

[AI] ViewROI objects represent viewable and placeable objects in the scene, each holding their own transformation and geometry group for rendering. More...

#include <viewroi.h>

Inheritance diagram for ViewROI:
Collaboration diagram for ViewROI:

Public Member Functions

 ViewROI (Tgl::Renderer *pRenderer, ViewLODList *lodList)
 [AI] Constructs a ViewROI with the specified renderer and LOD list. More...
 
 ~ViewROI () override
 [AI] Destructor cleans up internal geometry and releases LOD list reference. More...
 
void SetLODList (ViewLODList *lodList)
 [AI] Sets the ViewLODList for this ROI, managing reference counting. More...
 
float IntrinsicImportance () const override
 [AI] Returns the intrinsic importance of this ROI, used for LOD or sorting. More...
 
void VTable0x1c () override
 [AI] Updates internal state, potentially related to animation or LOD switching (exact purpose unclear). More...
 
void SetLocalTransform (const Matrix4 &p_transform) override
 [AI] Sets the local transformation; propagates to the underlying geometry group. More...
 
void VTable0x24 (const Matrix4 &p_transform) override
 [AI] Updates an internal transformation, synchronizing ROI and geometry. More...
 
virtual Tgl::GroupGetGeometry ()
 [AI] Returns a pointer to this ROI's Tgl::Group geometry for rendering and manipulation. More...
 
virtual const Tgl::GroupGetGeometry () const
 [AI] Returns a const pointer to this ROI's Tgl::Group geometry. More...
 
int GetUnknown0xe0 ()
 [AI] Gets the value of an internal state field at offset 0xe0. More...
 
void SetUnknown0xe0 (int p_unk0xe0)
 [AI] Sets the value of the internal state field at offset 0xe0. More...
 
- Public Member Functions inherited from OrientableROI
 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...
 

Static Public Member Functions

static undefined SetUnk101013d8 (undefined p_flag)
 [AI] Sets the global flag g_unk101013d8 and returns its previous value. More...
 

Protected Member Functions

void UpdateWorldData (const Matrix4 &parent2world) override
 [AI] Updates object's and geometry's world transformation based on parent's world matrix. More...
 

Protected Attributes

Tgl::Groupgeometry
 [AI] Root group for all geometry/renderable objects for this ROI. More...
 
int m_unk0xe0
 [AI] Unidentified state integer, typically initialized to -1. More...
 
- Protected Attributes inherited from OrientableROI
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...
 

Additional Inherited Members

- Public Types inherited from OrientableROI
enum  { c_bit1 = 0x01 , c_bit2 = 0x02 }
 

Detailed Description

[AI] ViewROI objects represent viewable and placeable objects in the scene, each holding their own transformation and geometry group for rendering.

[AI] ViewROI is derived from OrientableROI and serves as a specialized ROI (Real-time Object Instance) that maintains a reference to a group of renderable geometry (Tgl::Group) and its LODs via a ViewLODList. Used for any entity or collection of objects manipulated by the view/render manager. The class manages reference counting for its LOD list and owns its geometry group, cleaning up on destruction.

Definition at line 13 of file viewroi.h.

Constructor & Destructor Documentation

◆ ViewROI()

ViewROI::ViewROI ( Tgl::Renderer pRenderer,
ViewLODList lodList 
)
inline

[AI] Constructs a ViewROI with the specified renderer and LOD list.

Parameters
pRenderer[AI] The Tgl::Renderer used to create the geometry group.
lodList[AI] The list of Level of Details for this object; will have its reference count managed.

[AI] Initializes the geometry field via the renderer, and sets the internal unknown field to -1.

Definition at line 21 of file viewroi.h.

◆ ~ViewROI()

ViewROI::~ViewROI ( )
inlineoverride

[AI] Destructor cleans up internal geometry and releases LOD list reference.

[AI] Calls SetLODList(0) to decrease the reference of the current LOD list, then deletes the geometry group.

Definition at line 32 of file viewroi.h.

Member Function Documentation

◆ GetGeometry() [1/2]

Tgl::Group * ViewROI::GetGeometry ( )
virtual

[AI] Returns a pointer to this ROI's Tgl::Group geometry for rendering and manipulation.

[AI] The Tgl::Group acts as the root for all renderable geometry in this ROI.

Returns
[AI] Pointer to the modifiable geometry group.

Definition at line 19 of file viewroi.cpp.

◆ GetGeometry() [2/2]

const Tgl::Group * ViewROI::GetGeometry ( ) const
virtual

[AI] Returns a const pointer to this ROI's Tgl::Group geometry.

Returns
[AI] Const pointer to the geometry group.

Definition at line 25 of file viewroi.cpp.

◆ GetUnknown0xe0()

int ViewROI::GetUnknown0xe0 ( )
inline

[AI] Gets the value of an internal state field at offset 0xe0.

[AI] The usage of the field is unknown, possibly a rendering or animation state.

Returns
[AI] Integer value of m_unk0xe0.

Definition at line 108 of file viewroi.h.

◆ IntrinsicImportance()

float ViewROI::IntrinsicImportance ( ) const
overridevirtual

[AI] Returns the intrinsic importance of this ROI, used for LOD or sorting.

[AI] This value is used to determine level of detail or culling priority.

Returns
[AI] The intrinsic importance scalar.

Implements ROI.

Definition at line 13 of file viewroi.cpp.

◆ SetLocalTransform()

void ViewROI::SetLocalTransform ( const Matrix4 p_transform)
overridevirtual

[AI] Sets the local transformation; propagates to the underlying geometry group.

Parameters
p_transform[AI] The new local-to-world transformation matrix.

[AI] After updating its own matrix, updates the Tgl::Group to match the new transformation.

Reimplemented from OrientableROI.

Definition at line 57 of file viewroi.cpp.

◆ SetLODList()

void ViewROI::SetLODList ( ViewLODList lodList)
inline

[AI] Sets the ViewLODList for this ROI, managing reference counting.

Parameters
lodList[AI] The new ViewLODList to set for this ROI.

[AI] Decreases the reference count of the current LOD list (if any), sets the new list, and increases its reference count.

Definition at line 44 of file viewroi.h.

◆ SetUnk101013d8()

undefined ViewROI::SetUnk101013d8 ( undefined  p_flag)
static

[AI] Sets the global flag g_unk101013d8 and returns its previous value.

Parameters
p_flag[AI] The flag value to set.
Returns
[AI] The previous value of the global flag.

[AI] Utility for toggling a static/global rendering or logic state across ViewROI.

Definition at line 81 of file viewroi.cpp.

◆ SetUnknown0xe0()

void ViewROI::SetUnknown0xe0 ( int  p_unk0xe0)
inline

[AI] Sets the value of the internal state field at offset 0xe0.

Parameters
p_unk0xe0[AI] New value for m_unk0xe0.

Definition at line 114 of file viewroi.h.

◆ UpdateWorldData()

void ViewROI::UpdateWorldData ( const Matrix4 parent2world)
overrideprotectedvirtual

[AI] Updates object's and geometry's world transformation based on parent's world matrix.

Parameters
parent2world[AI] The parent's world transformation matrix.

[AI] Ensures both internal state and geometry group match the new world location/orientation.

Reimplemented from OrientableROI.

Definition at line 31 of file viewroi.cpp.

◆ VTable0x1c()

void ViewROI::VTable0x1c ( )
overridevirtual

[AI] Updates internal state, potentially related to animation or LOD switching (exact purpose unclear).

[AI] Calls parent's method and synchronizes transformation to geometry.

Note
[AI] Name from vtable; specific purpose unknown. [AI_SUGGESTED_NAME: UpdateInternalState]

Reimplemented from OrientableROI.

Definition at line 69 of file viewroi.cpp.

◆ VTable0x24()

void ViewROI::VTable0x24 ( const Matrix4 p_transform)
overridevirtual

[AI] Updates an internal transformation, synchronizing ROI and geometry.

Parameters
p_transform[AI] Matrix to apply as a secondary or derived transformation.

[AI] Similar to SetLocalTransform, provided for derived class or specialized transformation. [AI_SUGGESTED_NAME: ApplyExtraTransform]

Reimplemented from OrientableROI.

Definition at line 45 of file viewroi.cpp.

Member Data Documentation

◆ geometry

Tgl::Group* ViewROI::geometry
protected

[AI] Root group for all geometry/renderable objects for this ROI.

Definition at line 135 of file viewroi.h.

◆ m_unk0xe0

int ViewROI::m_unk0xe0
protected

[AI] Unidentified state integer, typically initialized to -1.

[AI] Usage unclear; may control ROI behavior or rendering modes. [AI_SUGGESTED_NAME: internalState]

Definition at line 141 of file viewroi.h.


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