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

[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality. More...

#include <legoroi.h>

Inheritance diagram for LegoROI:
Collaboration diagram for LegoROI:

Public Member Functions

 LegoROI (Tgl::Renderer *p_renderer)
 [AI] Constructs a new LegoROI for a given renderer. More...
 
 LegoROI (Tgl::Renderer *p_renderer, ViewLODList *p_lodList)
 [AI] Constructs a LegoROI with a specified LOD list to manage its geometry representations. More...
 
 ~LegoROI () override
 [AI] Destroys the LegoROI, cleaning up children and name resources. More...
 
LegoResult Read (OrientableROI *p_unk0xd4, Tgl::Renderer *p_renderer, ViewLODListManager *p_viewLODListManager, LegoTextureContainer *p_textureContainer, LegoStorage *p_storage)
 [AI] Reads and initializes this ROI from a LEGO project resource stream, populating geometry, color/texture, and children recursively. More...
 
LegoROIFindChildROI (const LegoChar *p_name, LegoROI *p_roi)
 [AI] Recursively searches for a child ROI by name, starting at the given ROI. More...
 
LegoResult FUN_100a8da0 (LegoTreeNode *p_node, const Matrix4 &p_matrix, LegoTime p_time, LegoROI *p_roi)
 [AI] [Unknown function. More...
 
LegoResult SetFrame (LegoAnim *p_anim, LegoTime p_time)
 [AI] Sets the current animation frame for this ROI based on a parsed animation structure. More...
 
LegoResult SetLodColor (LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
 [AI] Sets the RGBA color for all LODs and recursively for all children. More...
 
LegoResult SetTextureInfo (LegoTextureInfo *p_textureInfo)
 [AI] Associates every LOD in this ROI (and sub-ROIs) with a given texture (palette/material information). More...
 
LegoResult GetTextureInfo (LegoTextureInfo *&p_textureInfo)
 [AI] Attempts to retrieve a texture info pointer used by any LOD in this ROI or its children. More...
 
LegoResult FUN_100a9330 (LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha)
 [AI] Alias to SetLodColor; applies color to all LODs and children. More...
 
LegoResult SetLodColor (const LegoChar *p_name)
 [AI] Sets all LOD and child colors based on a named logical color alias. More...
 
LegoResult FUN_100a93b0 (const LegoChar *p_name)
 [AI] Like SetLodColor, but uses a different implementation or legacy style. More...
 
LegoU32 FUN_100a9410 (Vector3 &p_v1, Vector3 &p_v2, float p_f1, float p_f2, Vector3 &p_v3, LegoBool p_collideBox)
 [AI] Tests for collision along or within sphere/box, and computes intersection point as needed. More...
 
void SetName (const LegoChar *p_name)
 [AI] Sets this ROI's name, replacing the previous (converted to lower-case). More...
 
float IntrinsicImportance () const override
 [AI] Returns the importance rating for LOD/visibility management (fixed value). More...
 
void UpdateWorldBoundingVolumes () override
 [AI] Updates this ROI's world-space bounding volumes based on its local-to-world transform. More...
 
void ClearMeshOffset ()
 [AI] Resets mesh offset for all LODs in this ROI. More...
 
void SetDisplayBB (int p_displayBB)
 [AI] Sets whether to display or hide the bounding box. More...
 
const LegoCharGetName () const
 [AI] Gets this ROI's name. More...
 
LegoEntityGetEntity ()
 [AI] Gets the entity associated with this ROI (or NULL). More...
 
BoundingSphereGetBoundingSphere ()
 [AI] Accesses the local bounding sphere object. More...
 
void SetEntity (LegoEntity *p_entity)
 [AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic). More...
 
void SetComp (CompoundObject *p_comp)
 [AI] Attaches a new CompoundObject pointer (container for child ROIs). More...
 
void SetBoundingSphere (const BoundingSphere &p_sphere)
 [AI] Sets the local and world bounding spheres. More...
 
void SetUnknown0x80 (const BoundingBox &p_unk0x80)
 [AI] Sets the local bounding box from read data. More...
 
- Public Member Functions inherited from ViewROI
 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 void FUN_100a8e80 (LegoTreeNode *p_node, Matrix4 &p_matrix, LegoTime p_time, LegoROI **p_roiMap)
 [AI] [Static] Recursively evaluates animation nodes, updating the transformation matrices and visibility for ROI instances using a mapping table. More...
 
static void FUN_100a8fd0 (LegoTreeNode *p_node, Matrix4 &p_matrix, LegoTime p_time, LegoROI **p_roiMap)
 [AI] [Static] Similar to FUN_100a8e80, but only updates transformation matrices, not visibility or invocation. More...
 
static LegoResult FUN_100a8cb0 (LegoAnimNodeData *p_data, LegoTime p_time, Matrix4 &p_matrix)
 [AI] [Static] Sets the transform matrix for a given animation node at a specific time. More...
 
static void FUN_100a81b0 (const LegoChar *p_error, const LegoChar *p_name)
 [AI] [Static] Prints or logs an error message about missing ROI for animation (no-op in release). More...
 
static void configureLegoROI (int p_roi)
 [AI] [Static] Configures the global ROI loading limit, controlling max LODs at load time. More...
 
static void SetColorOverride (ColorOverride p_colorOverride)
 [AI] [Static] Sets the global color override callback function to allow palette remapping or customization. More...
 
static LegoBool GetRGBAColor (const LegoChar *p_name, float &p_red, float &p_green, float &p_blue, float &p_alpha)
 [AI] [Static] Resolves a logical color alias into RGBA floats. More...
 
static LegoBool ColorAliasLookup (const LegoChar *p_param, float &p_red, float &p_green, float &p_blue, float &p_alpha)
 [AI] [Static] Looks up a color alias in the static alias table and sets p_red/p_green/p_blue/p_alpha with normalized [0..1] floats. More...
 
static LegoBool GetPaletteEntries (const LegoChar *p_name, unsigned char *paletteEntries, LegoU32 p_numEntries)
 [AI] [Static] Fetches palette entries for a named texture using current texture handler. More...
 
- Static Public Member Functions inherited from ViewROI
static undefined SetUnk101013d8 (undefined p_flag)
 [AI] Sets the global flag g_unk101013d8 and returns its previous value. More...
 

Additional Inherited Members

- Public Types inherited from OrientableROI
enum  { c_bit1 = 0x01 , c_bit2 = 0x02 }
 
- Protected Member Functions inherited from ViewROI
void UpdateWorldData (const Matrix4 &parent2world) override
 [AI] Updates object's and geometry's world transformation based on parent's world matrix. More...
 
- Protected Attributes inherited from ViewROI
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...
 

Detailed Description

[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.

Handles instance data for a 3D LEGO model, including hierarchy, bounding volumes, color/texturing, animation, and child ROIs.

[AI] This class extends ViewROI by providing LEGO-specific parsing from files, color alias lookups, palette management, naming, hierarchical composition, and interfaces for per-frame and per-animation state updating. Typical usage is to load and represent a LEGO object in a game world scene, supporting animation/skin selection, per-instance palette colorization, and child object composition. @size 0x108 [AI] @vtable LEGO1 0x100dbe38 [AI]

Definition at line 43 of file legoroi.h.

Constructor & Destructor Documentation

◆ LegoROI() [1/2]

LegoROI::LegoROI ( Tgl::Renderer p_renderer)

[AI] Constructs a new LegoROI for a given renderer.

Initializes basic ROI members without attaching to a LOD list yet.

Parameters
p_renderer[AI] The 3D renderer/context used for geometry.

Definition at line 72 of file legoroi.cpp.

◆ LegoROI() [2/2]

LegoROI::LegoROI ( Tgl::Renderer p_renderer,
ViewLODList p_lodList 
)

[AI] Constructs a LegoROI with a specified LOD list to manage its geometry representations.

Parameters
p_renderer[AI] Renderer to use for geometry.
p_lodList[AI] The view-level LOD list handle.

Definition at line 80 of file legoroi.cpp.

◆ ~LegoROI()

LegoROI::~LegoROI ( )
override

[AI] Destroys the LegoROI, cleaning up children and name resources.

Definition at line 88 of file legoroi.cpp.

Member Function Documentation

◆ ClearMeshOffset()

void LegoROI::ClearMeshOffset ( )

[AI] Resets mesh offset for all LODs in this ROI.

Definition at line 832 of file legoroi.cpp.

◆ ColorAliasLookup()

LegoBool LegoROI::ColorAliasLookup ( const LegoChar p_param,
float &  p_red,
float &  p_green,
float &  p_blue,
float &  p_alpha 
)
static

[AI] [Static] Looks up a color alias in the static alias table and sets p_red/p_green/p_blue/p_alpha with normalized [0..1] floats.

Parameters
p_param[AI] Color alias to search.
p_red[AI] Out: red component.
p_green[AI] Out: green component.
p_blue[AI] Out: blue component.
p_alpha[AI] Out: alpha component.
Returns
[AI] TRUE if a match was found; otherwise FALSE.

Definition at line 776 of file legoroi.cpp.

◆ configureLegoROI()

void LegoROI::configureLegoROI ( int  p_roi)
static

[AI] [Static] Configures the global ROI loading limit, controlling max LODs at load time.

Parameters
p_roi[AI] New LOD limit value.

Definition at line 66 of file legoroi.cpp.

◆ FindChildROI()

LegoROI * LegoROI::FindChildROI ( const LegoChar p_name,
LegoROI p_roi 
)

[AI] Recursively searches for a child ROI by name, starting at the given ROI.

[AI] Performs a depth-first search to find a child whose name matches p_name (case-insensitive).

Parameters
p_name[AI] Name to search for (case-insensitive).
p_roi[AI] ROI node to search from; if null, no search.
Returns
[AI] The first matching child ROI found, or NULL if none.

Definition at line 349 of file legoroi.cpp.

◆ FUN_100a81b0()

void LegoROI::FUN_100a81b0 ( const LegoChar p_error,
const LegoChar p_name 
)
static

[AI] [Static] Prints or logs an error message about missing ROI for animation (no-op in release).

Parameters
p_error[AI] Error string format.
p_name[AI] ROI name or additional details.

Definition at line 61 of file legoroi.cpp.

◆ FUN_100a8cb0()

LegoResult LegoROI::FUN_100a8cb0 ( LegoAnimNodeData p_data,
LegoTime  p_time,
Matrix4 p_matrix 
)
static

[AI] [Static] Sets the transform matrix for a given animation node at a specific time.

Parameters
p_data[AI] Animation node data.
p_time[AI] Animation time/frame to set.
p_matrix[AI] Matrix to be updated with local transform.
Returns
[AI] Always returns SUCCESS.

Definition at line 340 of file legoroi.cpp.

◆ FUN_100a8da0()

LegoResult LegoROI::FUN_100a8da0 ( LegoTreeNode p_node,
const Matrix4 p_matrix,
LegoTime  p_time,
LegoROI p_roi 
)

[AI] [Unknown function.

] Used during animation update to update the transformation of the ROI hierarchy given animation nodes.

Parameters
p_node[AI] Animation tree node data.
p_matrix[AI] The parent local-to-world transformation; input for children.
p_time[AI] The animation time/frame to evaluate.
p_roi[AI] Current ROI context in the hierarchy.
Returns
[AI] Always returns SUCCESS.

Definition at line 382 of file legoroi.cpp.

◆ FUN_100a8e80()

void LegoROI::FUN_100a8e80 ( LegoTreeNode p_node,
Matrix4 p_matrix,
LegoTime  p_time,
LegoROI **  p_roiMap 
)
static

[AI] [Static] Recursively evaluates animation nodes, updating the transformation matrices and visibility for ROI instances using a mapping table.

Parameters
p_node[AI] Current animation node.
p_matrix[AI] Parent (accumulated) transformation matrix.
p_time[AI] Animation time/frame.
p_roiMap[AI] Lookup table of animation node index to LegoROI*.

Definition at line 414 of file legoroi.cpp.

◆ FUN_100a8fd0()

void LegoROI::FUN_100a8fd0 ( LegoTreeNode p_node,
Matrix4 p_matrix,
LegoTime  p_time,
LegoROI **  p_roiMap 
)
static

[AI] [Static] Similar to FUN_100a8e80, but only updates transformation matrices, not visibility or invocation.

Parameters
p_node[AI] Animation tree node.
p_matrix[AI] Parent transformation.
p_time[AI] Animation time/frame.
p_roiMap[AI] ROI pointer map, index by animation node.

Definition at line 445 of file legoroi.cpp.

◆ FUN_100a9330()

LegoResult LegoROI::FUN_100a9330 ( LegoFloat  p_red,
LegoFloat  p_green,
LegoFloat  p_blue,
LegoFloat  p_alpha 
)

[AI] Alias to SetLodColor; applies color to all LODs and children.

Parameters
p_red[AI] Red component [0...1].
p_green[AI] Green component [0...1].
p_blue[AI] Blue component [0...1].
p_alpha[AI] Alpha component [0...1].
Returns
[AI] Result of SetLodColor.

Definition at line 563 of file legoroi.cpp.

◆ FUN_100a93b0()

LegoResult LegoROI::FUN_100a93b0 ( const LegoChar p_name)

[AI] Like SetLodColor, but uses a different implementation or legacy style.

[AI_SUGGESTED_NAME: SetLodColorLegacy]

Parameters
p_name[AI] Color alias.
Returns
[AI] Result from FUN_100a9330.

Definition at line 582 of file legoroi.cpp.

◆ FUN_100a9410()

LegoU32 LegoROI::FUN_100a9410 ( Vector3 p_v1,
Vector3 p_v2,
float  p_f1,
float  p_f2,
Vector3 p_v3,
LegoBool  p_collideBox 
)

[AI] Tests for collision along or within sphere/box, and computes intersection point as needed.

[AI] Checks either the ROI's box or sphere. Supports ray or vector intersection tests, updating p_v3 with intersection details if relevant.

Parameters
p_v1[AI] Start location for intersection test.
p_v2[AI] Direction/step vector.
p_f1[AI] Magnitude/scalar for limiting the intersection check.
p_f2[AI] [Unknown. Used in calculations but intention unclear.]
p_v3[AI] Point to receive intersection coordinate if any.
p_collideBox[AI] If true, collide against box; otherwise, collide against sphere.
Returns
[AI] 1 if collision/intersection detected; else 0.

Definition at line 594 of file legoroi.cpp.

◆ GetBoundingSphere()

BoundingSphere & LegoROI::GetBoundingSphere ( )
inline

[AI] Accesses the local bounding sphere object.

Returns
[AI] Reference to this ROI's bounding sphere.

Definition at line 299 of file legoroi.h.

◆ GetEntity()

LegoEntity * LegoROI::GetEntity ( )
inline

[AI] Gets the entity associated with this ROI (or NULL).

Returns
[AI] Pointer to the current LegoEntity.

Definition at line 293 of file legoroi.h.

◆ GetName()

const LegoChar * LegoROI::GetName ( ) const
inline

[AI] Gets this ROI's name.

Returns
[AI] Pointer to the ROI name string.

Definition at line 287 of file legoroi.h.

◆ GetPaletteEntries()

LegoBool LegoROI::GetPaletteEntries ( const LegoChar p_name,
unsigned char *  paletteEntries,
LegoU32  p_numEntries 
)
static

[AI] [Static] Fetches palette entries for a named texture using current texture handler.

Parameters
p_name[AI] Name of texture/palette.
paletteEntries[AI] Pointer to buffer where entries will be written.
p_numEntries[AI] Number of entries to be written.
Returns
[AI] TRUE if palette data is available, otherwise FALSE.

Definition at line 792 of file legoroi.cpp.

◆ GetRGBAColor()

LegoBool LegoROI::GetRGBAColor ( const LegoChar p_name,
float &  p_red,
float &  p_green,
float &  p_blue,
float &  p_alpha 
)
static

[AI] [Static] Resolves a logical color alias into RGBA floats.

Can also pass through color aliases via override.

Parameters
p_name[AI] Logical name or palette string.
p_red[AI] Out: red value.
p_green[AI] Out: green value.
p_blue[AI] Out: blue value.
p_alpha[AI] Out: alpha value.
Returns
[AI] TRUE if alias found and color resolved, FALSE otherwise.

Definition at line 758 of file legoroi.cpp.

◆ GetTextureInfo()

LegoResult LegoROI::GetTextureInfo ( LegoTextureInfo *&  p_textureInfo)

[AI] Attempts to retrieve a texture info pointer used by any LOD in this ROI or its children.

Parameters
p_textureInfo[AI] Reference to receive found texture info pointer.
Returns
[AI] SUCCESS if found, FAILURE if not present in hierarchy.

Definition at line 537 of file legoroi.cpp.

◆ IntrinsicImportance()

float LegoROI::IntrinsicImportance ( ) const
overridevirtual

[AI] Returns the importance rating for LOD/visibility management (fixed value).

Returns
[AI] Always 0.5, representing default intrinsic importance.

Implements ROI.

Definition at line 848 of file legoroi.cpp.

◆ Read()

LegoResult LegoROI::Read ( OrientableROI p_unk0xd4,
Tgl::Renderer p_renderer,
ViewLODListManager p_viewLODListManager,
LegoTextureContainer p_textureContainer,
LegoStorage p_storage 
)

[AI] Reads and initializes this ROI from a LEGO project resource stream, populating geometry, color/texture, and children recursively.

[AI] Reads names, bounding box/sphere, textures/colors, LODs, and recursively loads all sub-ROIs from resource storage.

Parameters
p_unk0xd4[AI] The parent ROI (can be null for the root).
p_renderer[AI] Renderer used to create LOD geometry.
p_viewLODListManager[AI] LOD manager for lookup/creation.
p_textureContainer[AI] Source for texture information.
p_storage[AI] Opened resource file stream to read from.
Returns
[AI] SUCCESS or FAILURE, depending on if parsing succeeded.

Definition at line 108 of file legoroi.cpp.

◆ SetBoundingSphere()

void LegoROI::SetBoundingSphere ( const BoundingSphere p_sphere)
inline

[AI] Sets the local and world bounding spheres.

Parameters
p_sphere[AI] Bounding sphere to assign.

Definition at line 317 of file legoroi.h.

◆ SetColorOverride()

void LegoROI::SetColorOverride ( ColorOverride  p_colorOverride)
static

[AI] [Static] Sets the global color override callback function to allow palette remapping or customization.

Parameters
p_colorOverride[AI] Function pointer to override.

Definition at line 808 of file legoroi.cpp.

◆ SetComp()

void LegoROI::SetComp ( CompoundObject p_comp)
inline

[AI] Attaches a new CompoundObject pointer (container for child ROIs).

Parameters
p_comp[AI] Compound object pointer to set.

Definition at line 311 of file legoroi.h.

◆ SetDisplayBB()

void LegoROI::SetDisplayBB ( int  p_displayBB)

[AI] Sets whether to display or hide the bounding box.

(Not implemented)

Parameters
p_displayBB[AI] Display/hide flag.

Definition at line 842 of file legoroi.cpp.

◆ SetEntity()

void LegoROI::SetEntity ( LegoEntity p_entity)
inline

[AI] Associates a LegoEntity with this ROI (typically called by parent entity/logic).

Parameters
p_entity[AI] Entity to attach.

Definition at line 305 of file legoroi.h.

◆ SetFrame()

LegoResult LegoROI::SetFrame ( LegoAnim p_anim,
LegoTime  p_time 
)

[AI] Sets the current animation frame for this ROI based on a parsed animation structure.

Parameters
p_anim[AI] Animation to use for data.
p_time[AI] Time/frame to set.
Returns
[AI] SUCCESS if operation completed, FAILURE otherwise.

Definition at line 471 of file legoroi.cpp.

◆ SetLodColor() [1/2]

LegoResult LegoROI::SetLodColor ( const LegoChar p_name)

[AI] Sets all LOD and child colors based on a named logical color alias.

[AI] Looks up the color via defined alias, then assigns by SetLodColor.

Parameters
p_name[AI] Canonical LEGO color alias.
Returns
[AI] Result from internal SetLodColor call.

Definition at line 570 of file legoroi.cpp.

◆ SetLodColor() [2/2]

LegoResult LegoROI::SetLodColor ( LegoFloat  p_red,
LegoFloat  p_green,
LegoFloat  p_blue,
LegoFloat  p_alpha 
)

[AI] Sets the RGBA color for all LODs and recursively for all children.

[AI] Each LOD and each sub-ROI receives the color setting; if any LOD or child fails, returns FAILURE.

Parameters
p_red[AI] Red component [0...1].
p_green[AI] Green component [0...1].
p_blue[AI] Blue component [0...1].
p_alpha[AI] Alpha component [0...1].
Returns
[AI] SUCCESS if all set, FAILURE otherwise.

Definition at line 484 of file legoroi.cpp.

◆ SetName()

void LegoROI::SetName ( const LegoChar p_name)

[AI] Sets this ROI's name, replacing the previous (converted to lower-case).

Parameters
p_name[AI] New name to assign, or NULL to clear.

Definition at line 814 of file legoroi.cpp.

◆ SetTextureInfo()

LegoResult LegoROI::SetTextureInfo ( LegoTextureInfo p_textureInfo)

[AI] Associates every LOD in this ROI (and sub-ROIs) with a given texture (palette/material information).

Parameters
p_textureInfo[AI] The texture info to apply.
Returns
[AI] SUCCESS if all set, FAILURE otherwise.

Definition at line 510 of file legoroi.cpp.

◆ SetUnknown0x80()

void LegoROI::SetUnknown0x80 ( const BoundingBox p_unk0x80)
inline

[AI] Sets the local bounding box from read data.

Parameters
p_unk0x80[AI] Local bounding box.

Definition at line 323 of file legoroi.h.

◆ UpdateWorldBoundingVolumes()

void LegoROI::UpdateWorldBoundingVolumes ( )
overridevirtual

[AI] Updates this ROI's world-space bounding volumes based on its local-to-world transform.

[AI] Updates both bounding box and sphere, propagating to parent where needed.

Implements OrientableROI.

Definition at line 854 of file legoroi.cpp.


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