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.

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.

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

This item has no description.

Protected function GetProjectionDirectionLocal: TVector3; override;

This item has no description.

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

This item has no description.

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.

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.

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).

Public function SpotCosCutoff: Single;

This item has no description.

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.

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.

Public function ModelviewMatrix: TMatrix4; override;

This item has no description.

Public function ModelviewRotationMatrix: TMatrix4; override;

This item has no description.

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.

Public function HasRadius: boolean; override;

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

Should the "radius" field be taken into account.

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).

Public procedure CreateNode; override;

Create node fields and events.

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.

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.

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).

Public property Direction: TVector3 read GetDirection write SetDirection;

This item has no description.

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).

Public property DropOffRate: Single read GetDropOffRate write SetDropOffRate;

This item has no description.

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).

Public property CutOffAngle: Single read GetCutOffAngle write SetCutOffAngle;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.