Class TLight

Unit

Declaration

type TLight = class(TEntity3D)

Description

Light description.

Hierarchy

Overview

Methods

Protected procedure SetEnabled (const aValue: Boolean); override;
Protected procedure SetPosition (aVector: TVector3D); override;
Public CONSTRUCTOR Create (CONST aName: GLuint); VIRTUAL; reintroduce;
Public PROCEDURE Apply; VIRTUAL;

Properties

Public property Name: GLuint READ fName WRITE fName;
Public property Position4D: TVector4D read fPosition4D write SetPosition4D;
Public property Ambient: TColorDescription READ fAmbient WRITE SetAmbient;
Public property Diffuse: TColorDescription READ fDiffuse WRITE SetDiffuse;
Public property Specular: TColorDescription READ fSpecular WRITE SetSpecular;

Description

Methods

Protected procedure SetEnabled (const aValue: Boolean); override;

Changes light state.

Protected procedure SetPosition (aVector: TVector3D); override;

Changes light position.

See also
TEntity3D.Position
Entity position.
TLight.Position4D
Light position as a 4D vector.
Public CONSTRUCTOR Create (CONST aName: GLuint); VIRTUAL; reintroduce;

Constructor.

Parameters
aName
a GL_LIGHT* constant.
See also
TLight.Name
Light name.
Public PROCEDURE Apply; VIRTUAL;

Applies the light.

See also
TLight.Name
Light name.
TEntity3D.Enabled
Is the entity enabled.
TLight.Position4D
Light position as a 4D vector.
TLight.Ambient
Ambient RGBA intensity.
TLight.Diffuse
Diffuse RGBA intensity.
TLight.Specular
Specular RGBA intensity.

Properties

Public property Name: GLuint READ fName WRITE fName;

Light name.

Should be a GL_LIGHT* constant.

Note that it doesn't check if a light with same name exists. That means the last light applied is the one that's used.

Public property Position4D: TVector4D read fPosition4D write SetPosition4D;

Light position as a 4D vector.

This allows to define directional lights when V_W component is 0 but positional when it's 1.

Note that TEntity3D.Position will return Position4D without the V_W component. Also assign Position will change Position4D too. So you can use either one or the other if you don't change the V_W component.

Public property Ambient: TColorDescription READ fAmbient WRITE SetAmbient;

Ambient RGBA intensity.

Public property Diffuse: TColorDescription READ fDiffuse WRITE SetDiffuse;

Diffuse RGBA intensity.

Public property Specular: TColorDescription READ fSpecular WRITE SetSpecular;

Specular RGBA intensity.


Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.