Isle
|
[AI] 3D view that supports advanced lighting for scene rendering. More...
#include <legoview1.h>
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... | |
![]() | |
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::Group * | GetScene () const |
[AI] Accessor for the root scene group. More... | |
Tgl::Camera * | GetCamera () const |
[AI] Accessor for the view's main camera. More... | |
![]() | |
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::Renderer * | GetRenderer () const |
[AI] Gets the active renderer for this surface. More... | |
Tgl::Device * | GetDevice () const |
[AI] Returns the graphics device used by this surface, e.g. More... | |
Tgl::View * | GetView () const |
[AI] Gets the current view/camera for this surface. More... | |
Tgl::Group * | GetScene () 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 | |
![]() | |
Tgl::View * | CreateView (Tgl::Renderer *pRenderer, Tgl::Device *pDevice) override |
[AI] Create and return the Tgl::View object for this surface. More... | |
![]() | |
virtual Tgl::View * | CreateView (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... | |
[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.
LegoView1::LegoView1 | ( | ) |
[AI] Constructs the view and zeros out all light pointers (sun, directional, ambient).
[AI]
Definition at line 112 of file legoview1.cpp.
|
override |
[AI] Destructor.
Calls Destroy to remove lights and free their memory. [AI]
Definition at line 121 of file legoview1.cpp.
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]
Definition at line 128 of file legoview1.cpp.
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.
rCreateStruct | [AI] Structure with view/camera/scene setup parameters. [AI] |
pRenderer | [AI] Renderer used to create scene, camera, and all three lights. [AI] |
Definition at line 139 of file legoview1.cpp.
|
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.
void LegoView1::SetLightColor | ( | BOOL | bDirectionalLight, |
float | red, | ||
float | green, | ||
float | blue | ||
) |
[AI] Sets the RGB color for either the sun or directional light.
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.
void LegoView1::SetLightTransform | ( | BOOL | bDirectionalLight, |
Tgl::FloatMatrix4 & | rMatrix | ||
) |
[AI] Sets the transformation matrix (position/orientation) for either the sun or directional light.
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.