Class TSpotLightNode_1

Unit

Declaration

type TSpotLightNode_1 = class(TAbstractPositionalLightNode)

Description

This item has no description. Showing description inherited from TAbstractPositionalLightNode.

Base class for all positional lights.

Source: scene/x3d/x3dnodes_1.inc (line 392).

Hierarchy

Overview

Methods

Protected function GetProjectionLocationLocal: TVector3; override;
Protected procedure SetProjectionLocationLocal(const Value: TVector3); override;
Protected function GetProjectionDirectionLocal: TVector3; override;
Protected procedure SetProjectionDirectionLocal(const Value: TVector3); override;
Public constructor Create(const AX3DName: string = ''; const ABaseUrl: String = ''); override;
Public function SpotExponent: Single;
Public function SpotCutoffDeg: Single;
Public function SpotCosCutoff: Single;
Public procedure UpdateLightInstance(var LightInstance: TLightInstance); override;
Public function ProjectionMatrix: TMatrix4; override;
Public function ModelviewMatrix: TMatrix4; override;
Public function ModelviewRotationMatrix: TMatrix4; override;
Public procedure Box3DDistances(const Box: TBox3D; out MinDistance, MaxDistance: Single); override;
Public function HasRadius: boolean; override;
Public function Scope: TLightScope; override;
Public procedure CreateNode; override;
Public class function ClassX3DType: String; override;
Public class function ForVRMLVersion(const Version: TX3DVersion): Boolean; override;

Properties

Public property FdDirection: TSFVec3f read FFdDirection;
Public property Direction: TVector3 read GetDirection write SetDirection;
Public property FdDropOffRate: TSFFloat read FFdDropOffRate;
Public property DropOffRate: Single read GetDropOffRate write SetDropOffRate;
Public property FdCutOffAngle: TSFFloat read FFdCutOffAngle;
Public property CutOffAngle: Single read GetCutOffAngle write SetCutOffAngle;

Description

Methods

Protected function GetProjectionLocationLocal: TVector3; override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 394).

Protected procedure SetProjectionLocationLocal(const Value: TVector3); override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 395).

Protected function GetProjectionDirectionLocal: TVector3; override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 396).

Protected procedure SetProjectionDirectionLocal(const Value: TVector3); override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 397).

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: String = ''); override;

This item has no description. Showing description inherited from TX3DNode.Create.

Constructor. Initializes various properties:

  • Name, BaseUrl are initialized from given parameters.

  • The Fields, Events lists are filled in every descendant, to have all the fields/events defined by the specification.

  • DefaultContainerField, and other node-specific stuff, is filled in descendants. This is actually implemented in CreateNode, that is called at the end of this constructor.

Source: scene/x3d/x3dnodes_1.inc (line 399).

Public function SpotExponent: Single;

Spot exponent (based on dropOffRate). Not normalized (i.e. is a real exponent, in VRML 1.0 expresses in [0..1] range to mean exponents [0..128]). Clamp to correct range.

Source: scene/x3d/x3dnodes_1.inc (line 405).

Public function SpotCutoffDeg: Single;

Spot cutoff angle (based on cutOffAngle).

Expressed in degrees, clamped to correct range (see TSpotLightNode.SpotCutoffDeg for reasons). (since user can input any value in VRML, and also conversion radians -> degrees could accidentally raise value slightly > 90, so cutOffAngle = 1.5708 is in degrees 90.0002104591, which would cause OpenGL fixed-function error).

Source: scene/x3d/x3dnodes_1.inc (line 415).

Public function SpotCosCutoff: Single;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 417).

Public procedure UpdateLightInstance(var LightInstance: TLightInstance); override;

This item has no description. Showing description inherited from TAbstractLightNode.UpdateLightInstance.

Update TLightInstance record when lighting location/direction (and other properties precalculated on TLightInstance) change. Assumes that LightInstance.Node = Self.

Source: scene/x3d/x3dnodes_1.inc (line 419).

Public function ProjectionMatrix: TMatrix4; override;

This item has no description. Showing description inherited from TAbstractPunctualLightNode.ProjectionMatrix.

Matrices for rendering shadow map from this light. Identity in this class, override for subclasses able to do shadow mapping.

Source: scene/x3d/x3dnodes_1.inc (line 421).

Public function ModelviewMatrix: TMatrix4; override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 422).

Public function ModelviewRotationMatrix: TMatrix4; override;

This item has no description.

Source: scene/x3d/x3dnodes_1.inc (line 423).

Public procedure Box3DDistances(const Box: TBox3D; out MinDistance, MaxDistance: Single); override;

This item has no description. Showing description inherited from TAbstractPunctualLightNode.Box3DDistances.

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.

Source: scene/x3d/x3dnodes_1.inc (line 424).

Public function HasRadius: boolean; override;

This item has no description. Showing description inherited from TAbstractPositionalLightNode.HasRadius.

Should the "radius" field be taken into account.

Source: scene/x3d/x3dnodes_1.inc (line 426).

Public function Scope: TLightScope; override;

This item has no description. Showing description inherited from TAbstractLightNode.Scope.

Light scope. Default implementation returns lsGlobal or lsLocal, depending on "global" field value (this follows VRML/X3D >= 2.0 rules).

Source: scene/x3d/x3dnodes_1.inc (line 427).

Public procedure CreateNode; override;

Create node fields and events.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 35).

Public class function ClassX3DType: String; override;

This item has no description. Showing description inherited from TX3DNode.ClassX3DType.

Node type name in VRML/X3D, for this class. Normal VRML/X3D node classes should override this to return something non-empty, and then X3DType automatically will return the same value.

Empty for classes that don't have a hardcoded VRML/X3D node name, like a special TX3DUnknownNode. Such special classes should override then X3DType to return actual non-empty name there.

You usually should call X3DType. The only use of this method is that it works on classes (it's "class function"), without needing at actual instance.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 36).

Public class function ForVRMLVersion(const Version: TX3DVersion): Boolean; override;

This item has no description. Showing description inherited from TX3DNode.ForVRMLVersion.

Some nodes are present only in specific VRML/X3D version. This functions decides it.

For example some nodes can only work in VRML < 2.0, some others only in VRML >= 2.0. There are even some pairs of nodes: for example TConeNode_1 works with VRML < 2.0, TConeNode works with VRML >= 2.0.

NodesManager will use this.

Default implementation of this function returns always True. Generally, I don't try to set this too aggresively — in other words, for all cases when it's sensible, I allow nodes to be used in every VRML/X3D version, even when official specification doesn't. This means that when reading VRML 1.0 files actually a large part of VRML 2.0 is allowed too, and also while reading VRML 2.0 many constructs from VRML 1.0 (officially no longer present in VRML 2.0) are allowed too. I'm trying to support what I call a "sum of VRML 1.0 and 2.0".

In practice I only use this function when various VRML/X3D versions specify the same node name but

  • With different fields.

    For example Cone and Cylinder have slightly different fields, due to the fact that VRML 2.0 resigned from using TSFBitMask fields.

  • With different behavior.

    For example definitions of Sphere for VRML 1.0 and 2.0 are practically equal. However, the behavior from where to take texture and material info is different — in VRML 1.0 we take last Texture2, Material etc. nodes, while in VRML 2.0 we look in parent Shape's "appearance" field. So once again two different Sphere classes are needed.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 37).

Properties

Public property FdDirection: TSFVec3f read FFdDirection;

Internal wrapper for property Direction. This wrapper API may change, we advise to access simpler Direction instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 41).

Public property Direction: TVector3 read GetDirection write SetDirection;

This item has no description.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 43).

Public property FdDropOffRate: TSFFloat read FFdDropOffRate;

Internal wrapper for property DropOffRate. This wrapper API may change, we advise to access simpler DropOffRate instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 47).

Public property DropOffRate: Single read GetDropOffRate write SetDropOffRate;

This item has no description.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 49).

Public property FdCutOffAngle: TSFFloat read FFdCutOffAngle;

Internal wrapper for property CutOffAngle. This wrapper API may change, we advise to access simpler CutOffAngle instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 53).

Public property CutOffAngle: Single read GetCutOffAngle write SetCutOffAngle;

This item has no description.

Source: scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc (line 55).


Generated by PasDoc 0.17.0.snapshot.