Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TAbstractLightNode
Unit
X3DNodes
Declaration
type TAbstractLightNode = class(TAbstractChildNode)
Description
Base class for all VRML / X3D light nodes.
Note that even the old VRML 1.0 light nodes inherit from this. Although they interpret some bits differently ("ambientIntensity" < 0 has special meaning). But most of the fields behave identically, they only have different default values.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
function GetProjectionLocationLocal: TVector3; virtual; |
|
 |
procedure SetProjectionLocationLocal(const Value: TVector3); virtual; |
|
 |
function GetProjectionDirectionLocal: TVector3; virtual; |
|
 |
procedure SetProjectionDirectionLocal(const Value: TVector3); virtual; |
|
 |
procedure CreateNode; override; |
|
 |
function ProjectionMatrix: TMatrix4; virtual; |
Matrices for rendering shadow map from this light. Identity in this class, override for subclasses able to do shadow mapping.
|
 |
function ModelviewMatrix: TMatrix4; virtual; |
|
 |
function ModelviewRotationMatrix: TMatrix4; virtual; |
|
 |
procedure GetView(out Pos, Dir, Side, Up: TVector3); |
|
 |
procedure Box3DDistances(const Box: TBox3D; out MinDistance, MaxDistance: Single); virtual; abstract; |
Calculate distances between the given Box and this light source. This is intended to capture the depth distances where the box resides, useful for calculating e.g. depth ranges to capture in the shadow maps. Depending on light source type, various distance measures may be used, appropriate to light sources projection.
Always MinDistance <= MaxDistance. They may be negative when we measure along the light's direction.
Exceptions raised
- EBox3DEmpty
- When used with an empty box.
|
 |
procedure UpdateLightInstanceState( var LightInstance: TLightInstance; State: TX3DGraphTraverseState); |
Update TLightInstance record when lighting State changes. Assumes that LightInstance.Node = Self.
This will set LightInstance.Transform properties, and recalculate all LightInstance properties based on Transform.
|
 |
procedure UpdateLightInstance( var LightInstance: TLightInstance); virtual; |
Update TLightInstance record when lighting location/direction (and other properties precalculated on TLightInstance) change. Assumes that LightInstance.Node = Self.
|
 |
function Scope: TLightScope; virtual; |
Light scope. Default implementation returns lsGlobal or lsLocal, depending on "global" field value (this follows VRML/X3D >= 2.0 rules).
|
 |
function PositionAndDirection: TVector4; virtual; abstract; |
Position and direction expressed in homogeneous coordinates. For positional lights, the last component is always 1. For directional lights, the last component is always 0.
Note that this is expressed in the local light node coordinate system.
|
 |
procedure SetEffects(const Value: array of TEffectNode); |
|
Properties
 |
property FdIntensity: TSFFloat read FFdIntensity; |
|
 |
property FdColor: TSFColor read FFdColor; |
|
 |
property FdAmbientIntensity: TSFFloat read FFdAmbientIntensity; |
|
 |
property FdGlobal: TSFBool read FFdGlobal; |
|
 |
property FdShadowVolumes: TSFBool read FFdShadowVolumes; |
|
 |
property FdShadowVolumesMain: TSFBool read FFdShadowVolumesMain; |
|
 |
property FdProjectionFar: TSFFloat read FFdProjectionFar; |
|
 |
property FdDefaultShadowMap: TSFNode read FFdDefaultShadowMap; |
|
 |
property FdShadows: TSFBool read FFdShadows; |
|
 |
property FdEffects: TMFNode read FFdEffects; |
|
 |
property Transform: TMatrix4 read FTransform; |
Transformation of this light node. Beware: In X3D, light nodes can be instantiated many times within the scene, with different transformations, so this transformation property should not be used in general.
Use this only if you you know that light node occurs only once within the scene (see [http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_shadow_maps]). Or if you're fine with just getting an undefined transformation, for any of the light instances.
This value is calculated during traversing. Last BeforeTraverse call for this node sets this property. By default, it represents identity transformation.
|
 |
property InvertedTransform: TMatrix4 read FInvertedTransform; |
|
 |
property ProjectionSceneLocation: TVector3
read GetProjectionSceneLocation
write SetProjectionSceneLocation; |
|
 |
property ProjectionSceneDirection: TVector3
read GetProjectionSceneDirection
write SetProjectionSceneDirection; |
|
 |
property AmbientIntensity: Single read GetAmbientIntensity write SetAmbientIntensity; |
|
 |
property Global: boolean read GetGlobal write SetGlobal; |
|
 |
property Intensity: Single read GetIntensity write SetIntensity; |
|
 |
property IsOn: boolean read GetIsOn write SetIsOn; |
|
 |
property Shadows: boolean read GetShadows write SetShadows; |
|
 |
property ShadowVolumes: boolean read GetShadowVolumes write SetShadowVolumes; |
|
 |
property ShadowVolumesMain: boolean read GetShadowVolumesMain write SetShadowVolumesMain; |
|
 |
property ProjectionNear: Single read GetProjectionNear write SetProjectionNear; |
|
 |
property ProjectionFar: Single read GetProjectionFar write SetProjectionFar; |
|
 |
property Up: TVector3 read GetUp write SetUp; |
|
Generated by PasDoc 0.15.0.
|