Castle Game Engine: X3DNodes: Class TAbstractLightNode

# Class TAbstractLightNode
Description | Hierarchy | Fields | Methods | Properties
## 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 TPersistent TNonRefCountedInterfacedPersistent TX3DFileItem TX3DNode TAbstractNode TAbstractChildNode TAbstractLightNode ## Overview ### Methods
| `procedure CreateNode; override;`
| `function ProjectionMatrix: TMatrix4Single; virtual;`
| `function ModelviewMatrix: TMatrix4Single; virtual;`
| `function ModelviewRotationMatrix: TMatrix4Single; virtual;`
| `function GetProjectorMatrix: TMatrix4Single;`
| `function LocationLocal: TVector3Single; virtual;`
| `function Location: TVector3Single;`
| `function DirectionLocal: TVector3Single; virtual;`
| `function Direction: TVector3Single;`
| `procedure GetView(out Pos, Dir, Up: TVector3Single);`
| `procedure Box3DDistances(const Box: TBox3D; out MinDistance, MaxDistance: Single); virtual; abstract;`
| `function CreateLightInstance(State: TX3DGraphTraverseState): TLightInstance;`
| `procedure UpdateLightInstanceState( var LightInstance: TLightInstance; State: TX3DGraphTraverseState);`
| `procedure UpdateLightInstance( var LightInstance: TLightInstance); virtual;`
| `function TransformationChange: TNodeTransformationChange; override;`
| `function Scope: TLightScope; virtual;`
### Properties
| `property FdOn: TSFBool read FFdOn;`
| `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 FdShowProxyGeometry: TSFBool read FFdShowProxyGeometry;`
| `property FdProjectionNear: TSFFloat read FFdProjectionNear;`
| `property FdProjectionFar: TSFFloat read FFdProjectionFar;`
| `property FdUp: TSFVec3f read FFdUp;`
| `property FdDefaultShadowMap: TSFNode read FFdDefaultShadowMap;`
| `property FdShadows: TSFBool read FFdShadows;`
| `property FdEffects: TMFNode read FFdEffects;`
| `property Transform: TMatrix4Single read FTransform;`
## Description ### Methods
| `procedure CreateNode; override;`
| `function ProjectionMatrix: TMatrix4Single; virtual;`
Matrices for rendering shadow map from this light. Identity in this class, override for subclasses able to do shadow mapping.
| `function ModelviewMatrix: TMatrix4Single; virtual;`
| `function ModelviewRotationMatrix: TMatrix4Single; virtual;`
| `function GetProjectorMatrix: TMatrix4Single;`
| `function LocationLocal: TVector3Single; virtual;`
Light location, direction and up vectors. Useful for example when you think of lights as cameras (for shadow maps). DirectionLocal must be exactly zero for PointLight (that doesn't have a direction).
| `function Location: TVector3Single;`
| `function DirectionLocal: TVector3Single; virtual;`
| `function Direction: TVector3Single;`
| `procedure GetView(out Pos, Dir, Up: TVector3Single);`
| `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.
| `function CreateLightInstance(State: TX3DGraphTraverseState): TLightInstance;`
Create TLightInstance record describing this light node under given State.
| `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 TransformationChange: TNodeTransformationChange; override;`
| `function Scope: TLightScope; virtual;`
Light scope. Default implementation returns lsGlobal or lsLocal, depending on "global" field value (this follows VRML/X3D >= 2.0 rules).
### Properties
| `property FdOn: TSFBool read FFdOn;`
| `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 FdShowProxyGeometry: TSFBool read FFdShowProxyGeometry;`
showProxyGeometry field is an Avalon extension, see [http://instant-reality.com/documentation/nodetype/Light/].
| `property FdProjectionNear: TSFFloat read FFdProjectionNear;`
projectionNear / projectionFar / up are Kambi extensions, see [http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_light_projective]
| `property FdProjectionFar: TSFFloat read FFdProjectionFar;`
| `property FdUp: TSFVec3f read FFdUp;`
| `property FdDefaultShadowMap: TSFNode read FFdDefaultShadowMap;`
| `property FdShadows: TSFBool read FFdShadows;`
| `property FdEffects: TMFNode read FFdEffects;`
| `property Transform: TMatrix4Single read FTransform;`
Transformation of this light node. Normal lights can be instanced many times within the scene, with various transformation, so this transformation property cannot be used. However, in special cases, you know that light node occurs only once within the scene (see [http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_shadow_maps]). Then it's useful. It is gathered during traversing. Last BeforeTraverse call for this node sets Transform properties. By default, it represents identity transformation.
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:16