49 float frontClippingDistance = 0.1;
50 float backClippingDistance = 500;
115 m_pDirectionalLight = 0;
147 m_pDirectionalLight =
163 position[0] = 0, position[1] = 150, position[2] = -150;
183 if (m_pDirectionalLight) {
185 delete m_pDirectionalLight;
186 m_pDirectionalLight = 0;
189 if (m_pAmbientLight) {
191 delete m_pAmbientLight;
204 if (bDirectionalLight ==
FALSE) {
205 pLight = m_pSunLight;
208 pLight = m_pDirectionalLight;
227 if (bDirectionalLight ==
FALSE) {
228 pLight = m_pSunLight;
231 pLight = m_pDirectionalLight;
[AI] 3D view that supports advanced lighting for scene rendering.
~LegoView1() override
[AI] Destructor.
void Destroy() override
[AI] Safely removes all lights from the scene, deletes them, and nulls pointers.
void SetLightTransform(BOOL bDirectionalLight, Tgl::FloatMatrix4 &rMatrix)
[AI] Sets the transformation matrix (position/orientation) for either the sun or directional light.
BOOL AddLightsToViewport()
[AI] Adds the view's lights (sun, directional, ambient) to the active Tgl view for rendering.
BOOL Create(const TglSurface::CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
[AI] Initializes scene, camera, and three types of lights (sun, directional, ambient) using supplied ...
void SetLightColor(BOOL bDirectionalLight, float red, float green, float blue)
[AI] Sets the RGB color for either the sun or directional light.
LegoView1()
[AI] Constructs the view and zeros out all light pointers (sun, directional, ambient).
[AI] Represents a 3D rendering surface holding the main scene group and camera for rendering.
LegoView()
[AI] Constructs an empty LegoView with uninitialized scene and camera.
~LegoView() override
[AI] Destructor.
Tgl::View * CreateView(Tgl::Renderer *pRenderer, Tgl::Device *pDevice) override
[AI] Create and return the Tgl::View object for this surface.
BOOL Create(const CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
[AI] Initialize the LegoView with a scene root and camera using the provided creation parameters and ...
void Destroy() override
[AI] Release all scene and camera resources, call TglSurface cleanup.
4x4 Matrix class with virtual interface for manipulation and transformation.
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Tgl::View * GetView() const
[AI] Gets the current view/camera for this surface.
virtual BOOL Create(const CreateStruct &, Tgl::Renderer *, Tgl::Group *pScene)
[AI] Creates and initializes the surface, rendering device, and optionally installs scene graph.
virtual void Destroy()
[AI] Destroys all resources (view, device), releasing scene and renderer references.
unsigned long GetWidth() const
[AI] Returns the width (in pixels) of the rendered surface.
unsigned long GetHeight() const
[AI] Returns the height (in pixels) of the rendered surface.
[AI] Represents a rendering device/context for the Tgl renderer.
[AI] Represents a source of lighting in the 3D scene.
virtual Result SetTransformation(FloatMatrix4 &)=0
[AI] Sets the transformation matrix for the light source.
virtual Result SetColor(float r, float g, float b)=0
[AI] Sets the light's color.
[AI] Main interface/factory for rendering resources and scene graphs.
virtual View * CreateView(const Device *, const Camera *, unsigned long x, unsigned long y, unsigned long width, unsigned long height)=0
[AI] Creates a rendering view associated with the given device and camera.
virtual Light * CreateLight(LightType, float r, float g, float b)=0
[AI] Creates a new light of the given type and color.
virtual Camera * CreateCamera()=0
[AI] Creates a new camera.
virtual Group * CreateGroup(const Group *pParent=0)=0
[AI] Creates a new group (scene graph node), optionally parented.
[AI] Represents a rendering viewport and drawing context.
virtual Result SetBackgroundColor(float r, float g, float b)=0
[AI] Sets the background color for the view.
virtual Result Remove(const Light *)=0
[AI] Removes a light from the view.
virtual Result SetFrustrum(float frontClippingDistance, float backClippingDistance, float degrees)=0
[AI] Sets front and back clipping planes and view field in degrees.
virtual Result Add(const Light *)=0
[AI] Adds a light to the view for rendering.
#define DECOMP_SIZE_ASSERT(T, S)
float g_directionalLightRGB
float FloatMatrix4[4][4]
[AI] Represents a 4x4 matrix of single-precision floating point values.
@ Point
[AI] Light emitted from a point in all directions. [AI]
@ Directional
[AI] Parallel light rays, such as sunlight. [AI]
@ Ambient
[AI] Non-directional lighting applied equally everywhere. [AI]
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.
[AI] Contains initialization parameters for creating a TglSurface and its underlying DDraw/D3D resour...
BOOL m_isWideViewAngle
[AI] Enables wide or default field-of-view projection.
#define SETMAT4(to, from)