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

[AI] Central class managing the LEGO Island 3D rendering subsystem. More...

#include <lego3dmanager.h>

Classes

struct  CreateStruct
 [AI] Construction parameters for initializing the 3D system. More...
 

Public Member Functions

 Lego3DManager ()
 [AI] Constructs and initializes the Lego3DManager in an uninitialized state. More...
 
virtual ~Lego3DManager ()
 [AI] Destructor. More...
 
BOOL Create (CreateStruct &rCreateStruct)
 [AI] Initializes the LEGO 3D system using the specified creation parameters. More...
 
void Destroy ()
 [AI] Cleans up the 3D system and destroys internal objects. More...
 
BOOL Add (ViewROI &rROI)
 [AI] Adds a ViewROI (rendered object) to the scene. More...
 
BOOL Remove (ViewROI &rROI)
 [AI] Removes a ViewROI from the scene. More...
 
BOOL Moved (ViewROI &rROI)
 [AI] Notifies the manager that the ROI has moved and needs spatial update. More...
 
BOOL SetPointOfView (ViewROI &rROI)
 [AI] Sets the camera's point of view to match the given ROI. More...
 
double Render (double p_und)
 [AI] Renders the current frame. More...
 
int SetFrustrum (float p_fov, float p_front, float p_back)
 [AI] Sets the 3D perspective frustum parameters for camera and view. More...
 
Tgl::RendererGetRenderer ()
 [AI] Provides access to the underlying Tgl::Renderer instance. More...
 
Tgl::GroupGetScene ()
 [AI] Returns the root Tgl::Group for the 3D scene. More...
 
Lego3DViewGetLego3DView ()
 [AI] Returns the encapsulated Lego3DView instance. More...
 
ViewLODListManagerGetViewLODListManager ()
 [AI] Returns the internal ViewLODListManager instance. More...
 

Detailed Description

[AI] Central class managing the LEGO Island 3D rendering subsystem.

This manager is responsible for orchestrating rendering, scene composition, and related view and display options.

Internally, it aggregates the core rendering objects, scene views, and a manager for level-of-detail (LOD) lists. It provides interfaces to add/remove objects from the 3D scene, set the camera point of view, manipulate frustum parameters, and trigger rendering.

Ownership of created objects (Renderer, Lego3DView, ViewLODListManager) is managed here.

[AI] This class encapsulates the main 3D responsibilities for the LEGO Island game, delegating view-based logic to Lego3DView and rendering commands to Tgl::Renderer.

Definition at line 39 of file lego3dmanager.h.

Constructor & Destructor Documentation

◆ Lego3DManager()

Lego3DManager::Lego3DManager ( )

[AI] Constructs and initializes the Lego3DManager in an uninitialized state.

Definition at line 36 of file lego3dmanager.cpp.

◆ ~Lego3DManager()

Lego3DManager::~Lego3DManager ( )
virtual

[AI] Destructor.

Calls Destroy() to clean up owned resources.

Definition at line 46 of file lego3dmanager.cpp.

Member Function Documentation

◆ Add()

BOOL Lego3DManager::Add ( ViewROI rROI)
inline

[AI] Adds a ViewROI (rendered object) to the scene.

Delegates to Lego3DView. The ROI will be taken into account for rendering.

Parameters
rROI[AI] Reference to the ROI to add.
Returns
TRUE if added successfully, FALSE otherwise [AI]

Definition at line 198 of file lego3dmanager.h.

◆ Create()

BOOL Lego3DManager::Create ( CreateStruct rCreateStruct)

[AI] Initializes the LEGO 3D system using the specified creation parameters.

This sets up the Tgl::Renderer, Lego3DView, and ViewLODListManager. Must be called once before use.

Parameters
rCreateStruct[AI] Details the rendering window, buffers, and device settings.
Returns
TRUE on success, FALSE otherwise [AI]

Definition at line 52 of file lego3dmanager.cpp.

◆ Destroy()

void Lego3DManager::Destroy ( )

[AI] Cleans up the 3D system and destroys internal objects.

Frees the Renderer, View, and LOD Manager.

Definition at line 79 of file lego3dmanager.cpp.

◆ GetLego3DView()

Lego3DView * Lego3DManager::GetLego3DView ( )
inline

[AI] Returns the encapsulated Lego3DView instance.

View handles detailed scene/camera logic and should be used for advanced manipulation.

Returns
Pointer to Lego3DView [AI]

Definition at line 242 of file lego3dmanager.h.

◆ GetRenderer()

Tgl::Renderer * Lego3DManager::GetRenderer ( )
inline

[AI] Provides access to the underlying Tgl::Renderer instance.

Use to submit lower-level rendering commands or queries.

Returns
Renderer instance pointer [AI]

Definition at line 229 of file lego3dmanager.h.

◆ GetScene()

Tgl::Group * Lego3DManager::GetScene ( )
inline

[AI] Returns the root Tgl::Group for the 3D scene.

This is the object tree containing all rendered geometry.

Returns
Root scene group [AI]

Definition at line 234 of file lego3dmanager.h.

◆ GetViewLODListManager()

ViewLODListManager * Lego3DManager::GetViewLODListManager ( )
inline

[AI] Returns the internal ViewLODListManager instance.

Used for managing all LOD object lists within the 3D subsystem.

Returns
ViewLODListManager pointer [AI]

Definition at line 247 of file lego3dmanager.h.

◆ Moved()

BOOL Lego3DManager::Moved ( ViewROI rROI)
inline

[AI] Notifies the manager that the ROI has moved and needs spatial update.

Calls corresponding update on Lego3DView.

Parameters
rROI[AI] The ROI that has moved.
Returns
TRUE if update required, FALSE otherwise [AI]

Definition at line 222 of file lego3dmanager.h.

◆ Remove()

BOOL Lego3DManager::Remove ( ViewROI rROI)
inline

[AI] Removes a ViewROI from the scene.

Delegates to Lego3DView.

Parameters
rROI[AI] The ROI to remove.
Returns
TRUE if removed, FALSE if not present [AI]

Definition at line 206 of file lego3dmanager.h.

◆ Render()

double Lego3DManager::Render ( double  p_und)

[AI] Renders the current frame.

Triggers drawing of the 3D scene. Accepts a parameter (purpose unclear, possibly frame time or LOD factor).

Parameters
p_und[AI] Unclear usage (likely time delta or update tick).
Returns
Rendering time, frame statistics, or implementation-defined double value. [AI]

Definition at line 92 of file lego3dmanager.cpp.

◆ SetFrustrum()

int Lego3DManager::SetFrustrum ( float  p_fov,
float  p_front,
float  p_back 
)

[AI] Sets the 3D perspective frustum parameters for camera and view.

Updates field-of-view, near, and far plane distances used for rendering.

Parameters
p_fov[AI] Field of view in degrees
p_front[AI] Near clipping plane
p_back[AI] Far clipping plane
Returns
Always 0 (no error handling) [AI]

Definition at line 101 of file lego3dmanager.cpp.

◆ SetPointOfView()

BOOL Lego3DManager::SetPointOfView ( ViewROI rROI)
inline

[AI] Sets the camera's point of view to match the given ROI.

Delegates to Lego3DView, which applies the transformation.

Parameters
rROI[AI] The ROI serving as the new point of view.
Returns
TRUE if successful [AI]

Definition at line 214 of file lego3dmanager.h.


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