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

[AI] 3D view that supports advanced lighting for scene rendering. More...

#include <legoview1.h>

Inheritance diagram for LegoView1:
Collaboration diagram for LegoView1:

Public Member Functions

 LegoView1 ()
 [AI] Constructs the view and zeros out all light pointers (sun, directional, ambient). More...
 
 ~LegoView1 () override
 [AI] Destructor. More...
 
BOOL AddLightsToViewport ()
 [AI] Adds the view's lights (sun, directional, ambient) to the active Tgl view for rendering. More...
 
BOOL Create (const TglSurface::CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
 [AI] Initializes scene, camera, and three types of lights (sun, directional, ambient) using supplied renderer. More...
 
void Destroy () override
 [AI] Safely removes all lights from the scene, deletes them, and nulls pointers. More...
 
void SetLightTransform (BOOL bDirectionalLight, Tgl::FloatMatrix4 &rMatrix)
 [AI] Sets the transformation matrix (position/orientation) for either the sun or directional light. More...
 
void SetLightColor (BOOL bDirectionalLight, float red, float green, float blue)
 [AI] Sets the RGB color for either the sun or directional light. More...
 
- Public Member Functions inherited from LegoView
 LegoView ()
 [AI] Constructs an empty LegoView with uninitialized scene and camera. More...
 
 ~LegoView () override
 [AI] Destructor. More...
 
BOOL Create (const CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
 [AI] Initialize the LegoView with a scene root and camera using the provided creation parameters and renderer. More...
 
void Destroy () override
 [AI] Release all scene and camera resources, call TglSurface cleanup. More...
 
Tgl::GroupGetScene () const
 [AI] Accessor for the root scene group. More...
 
Tgl::CameraGetCamera () const
 [AI] Accessor for the view's main camera. More...
 
- Public Member Functions inherited from TglSurface
 TglSurface ()
 [AI] Constructs a new TglSurface instance with members initialized to their default state. More...
 
virtual ~TglSurface ()
 [AI] Virtual destructor also triggers Destroy(). More...
 
virtual BOOL Create (const CreateStruct &, Tgl::Renderer *, Tgl::Group *pScene)
 [AI] Creates and initializes the surface, rendering device, and optionally installs scene graph. More...
 
virtual void Destroy ()
 [AI] Destroys all resources (view, device), releasing scene and renderer references. More...
 
virtual double Render ()
 [AI] Renders a single frame and returns the render time for that frame. More...
 
Tgl::RendererGetRenderer () const
 [AI] Gets the active renderer for this surface. More...
 
Tgl::DeviceGetDevice () const
 [AI] Returns the graphics device used by this surface, e.g. More...
 
Tgl::ViewGetView () const
 [AI] Gets the current view/camera for this surface. More...
 
Tgl::GroupGetScene () const
 [AI] Returns the currently attached 3D scene root/group. More...
 
unsigned long GetWidth () const
 [AI] Returns the width (in pixels) of the rendered surface. More...
 
unsigned long GetHeight () const
 [AI] Returns the height (in pixels) of the rendered surface. More...
 
double GetRenderingRate () const
 [AI] Returns the measured rendering rate (frames per second) for the rendering routine. More...
 
double GetFrameRate () const
 [AI] Returns the measured frame rate (frames per second) for the current surface. More...
 
unsigned long GetFrameCount () const
 [AI] Returns the frame count since creation or since last meter reset. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LegoView
Tgl::ViewCreateView (Tgl::Renderer *pRenderer, Tgl::Device *pDevice) override
 [AI] Create and return the Tgl::View object for this surface. More...
 
- Protected Member Functions inherited from TglSurface
virtual Tgl::ViewCreateView (Tgl::Renderer *, Tgl::Device *)=0
 [AI] Abstract view creation. More...
 
virtual void DestroyView ()
 [AI] Destroys (deletes) the surface's view/camera, and resets the pointer to null. More...
 

Detailed Description

[AI] 3D view that supports advanced lighting for scene rendering.

[AI] LegoView1 extends the basic scene/camera view of LegoView by managing three separate lights (sun, directional, ambient) to control scene illumination. Includes methods for attaching and configuring these lights, such as transformation matrices and colors. Used for levels or scenes requiring realistic and flexible 3D lighting models. [AI]

Definition at line 105 of file legoview1.h.

Constructor & Destructor Documentation

◆ LegoView1()

LegoView1::LegoView1 ( )

[AI] Constructs the view and zeros out all light pointers (sun, directional, ambient).

[AI]

Definition at line 112 of file legoview1.cpp.

◆ ~LegoView1()

LegoView1::~LegoView1 ( )
override

[AI] Destructor.

Calls Destroy to remove lights and free their memory. [AI]

Definition at line 121 of file legoview1.cpp.

Member Function Documentation

◆ AddLightsToViewport()

BOOL LegoView1::AddLightsToViewport ( )

[AI] Adds the view's lights (sun, directional, ambient) to the active Tgl view for rendering.

[AI] All three lights are registered with the scene's Tgl::View. Assumes lights exist and view is ready. [AI]

Returns
TRUE on success (always, unless view/lights are missing), FALSE otherwise. [AI]

Definition at line 128 of file legoview1.cpp.

◆ Create()

BOOL LegoView1::Create ( const TglSurface::CreateStruct rCreateStruct,
Tgl::Renderer pRenderer 
)

[AI] Initializes scene, camera, and three types of lights (sun, directional, ambient) using supplied renderer.

Parameters
rCreateStruct[AI] Structure with view/camera/scene setup parameters. [AI]
pRenderer[AI] Renderer used to create scene, camera, and all three lights. [AI]
Returns
TRUE if creation (including all lights) succeeded, FALSE if failed at any stage. [AI]

Definition at line 139 of file legoview1.cpp.

◆ Destroy()

void LegoView1::Destroy ( )
overridevirtual

[AI] Safely removes all lights from the scene, deletes them, and nulls pointers.

[AI]

[AI] Called by destructor; also chains to LegoView::Destroy for full view resource cleanup. [AI]

Reimplemented from LegoView.

Definition at line 175 of file legoview1.cpp.

◆ SetLightColor()

void LegoView1::SetLightColor ( BOOL  bDirectionalLight,
float  red,
float  green,
float  blue 
)

[AI] Sets the RGB color for either the sun or directional light.

Parameters
bDirectionalLight[AI] If TRUE, updates directional light; if FALSE, updates sun (point) light. [AI]
red[AI] Red color component in range [0,1]. [AI]
green[AI] Green color component in range [0,1]. [AI]
blue[AI] Blue color component in range [0,1]. [AI]

Definition at line 223 of file legoview1.cpp.

◆ SetLightTransform()

void LegoView1::SetLightTransform ( BOOL  bDirectionalLight,
Tgl::FloatMatrix4 rMatrix 
)

[AI] Sets the transformation matrix (position/orientation) for either the sun or directional light.

Parameters
bDirectionalLight[AI] If TRUE, sets directional light; if FALSE, sets sun (point) light. [AI]
rMatrix[AI] 4x4 transformation matrix defining new position/direction for the selected light. [AI]

Definition at line 200 of file legoview1.cpp.


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