Castle Game Engine: X3DNodes: Class TAbstractPositionalLightNode

# Class TAbstractPositionalLightNode
Description | Hierarchy | Fields | Methods | Properties
## Unit X3DNodes ## Declaration `type TAbstractPositionalLightNode = class(TAbstractLightNode)` ## Description no description available, TAbstractLightNode description follows 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 TAbstractPositionalLightNode ## Overview ### Methods
| `procedure CreateNode; override;`
| `function DistanceNeededForAttenuation: boolean;`
| `function Attenuation(const DistanceToLight: Single): Single; overload;`
| `function Attenuation(const DistanceToLight: Double): Double; overload;`
| `function HasAttenuation: boolean;`
| `function HasRadius: boolean; virtual;`
| `procedure UpdateLightInstance(var LightInstance: TLightInstance); override;`
### Properties
| `property FdLocation: TSFVec3f read FFdLocation;`
| `property FdAttenuation: TSFVec3f read FFdAttenuation;`
| `property FdRadius: TSFFloat read FFdRadius;`
## Description ### Methods
| `procedure CreateNode; override;`
| `function DistanceNeededForAttenuation: boolean;`
Calculate light intensity drop because of the distance to the light. This follows the equation `1/max( attenuation[0] + ... )` from the VRML/X3D specification, it is the same as OpenGL attenuation. Since calculating the DistanceToLight for the Attenuation method may be time-consuming in some situations, you can check `DistanceNeededForAttenuation` first. When the `DistanceNeededForAttenuation` returns `False`, then the value of DistanceToLight parameter is ignored (you can pass anything). The DistanceToLight should be a distance in the light source local coordinate system. TODO: although our renderers currently ignore this: ray-tracer uses global coord system, OpenGL (fixed-function and shader) renderer uses eye coord system (should be equal to global coord system for normal cameras).
| `function Attenuation(const DistanceToLight: Single): Single; overload;`
| `function Attenuation(const DistanceToLight: Double): Double; overload;`
| `function HasAttenuation: boolean;`
Is attenuation relevant. When `False`, you know that Attenuation function always returns 1, so there's no point in using it at all.
| `function HasRadius: boolean; virtual;`
Should the "radius" field be taken into account.
| `procedure UpdateLightInstance(var LightInstance: TLightInstance); override;`
### Properties
| `property FdLocation: TSFVec3f read FFdLocation;`
| `property FdAttenuation: TSFVec3f read FFdAttenuation;`
| `property FdRadius: TSFFloat read FFdRadius;`
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:16