Class TX3DGraphTraverseState
Unit
Declaration
type TX3DGraphTraverseState = class(TObject)
Description
Current state (transformation and such) when traversing VRML/X3D graph.
For VRML/X3D >= 2.0 this could be simpler, as VRML/X3D >= 2.0 doesn't need to keep track for example of the VRML1State. But we want to still handle VRML 1.0, 100% correctly, so here we are: this class contains whole state needed for any VRML/X3D version.
Hierarchy
- TObject
- TX3DGraphTraverseState
Overview
Fields
Lights: TLightInstancesList; |
|
Transformation: TTransformation; |
|
TextureTransform: TMatrix4; |
|
ShapeNode: TAbstractShapeNode; |
|
InsideInline: Cardinal; |
|
InsidePrototype: Cardinal; |
|
InsideIgnoreCollision: Cardinal; |
|
InsideInvisible: Cardinal; |
|
PointingDeviceSensors: TPointingDeviceSensorList; |
|
HumanoidTransformation: TTransformation; |
|
Humanoid: THAnimHumanoidNode; |
|
ClipPlanes: TClipPlaneList; |
|
LocalFog: TLocalFogNode; |
|
Effects: TX3DNodeList; |
Methods
procedure AddLight(const Light: TLightInstance); |
|
procedure AssignTransform(Source: TX3DGraphTraverseState); |
|
function Transform: TMatrix4; deprecated 'use Transformation.Transform'; |
|
function InvertedTransform: TMatrix4; deprecated 'use Transformation.InverseTransform'; |
|
constructor CreateCopy(Source: TX3DGraphTraverseState); |
|
constructor Create; |
|
destructor Destroy; override; |
|
procedure Assign(Source: TX3DGraphTraverseState); |
|
procedure Clear; |
|
function Equals(SecondValue: TX3DGraphTraverseState; const IgnoreTransform: boolean): boolean; reintroduce; |
|
function MainTexture: TAbstractTextureNode; overload; |
|
function MainTexture(const GeometryForTexCoord: TAbstractGeometryNode; out TexCoordIndex: Integer): TAbstractTextureNode; overload; |
|
function BlendMode: TBlendModeNode; |
|
function AddClipPlane: PClipPlane; |
|
function MaterialInfo: TMaterialInfo; |
Properties
property VRML1State: TVRML1State read FVRML1State; |
|
property LastNodes: TVRML1State read FVRML1State; deprecated 'use VRML1State'; |
Description
Fields
Lights: TLightInstancesList; |
|
Lights active in this state. May be Note that VRML >= 2.0 "global" lights are added from TCastleSceneCore, not during the traverse pass. |
Transformation: TTransformation; |
|
Transformation of this state. Calculated efficiently while traversing the X3D graph. |
TextureTransform: TMatrix4; |
|
Current texture transformation. Usable only for VRML 1.0, in VRML 2.0 texture transformations don't accumulate like modelview transformations. |
ShapeNode: TAbstractShapeNode; |
|
InsideInline: Cardinal; |
|
Information if you're within any inline node or expanded prototype. These are measured from the node where you started TX3DNode.Traverse call, that is they assume that the initial node from where you're traversing is at level 0 (not inside inline or expanded prototype). These are useful to establish "run-time name scope" of X3D, see X3D spec 4.4.7 (needed e.g. when handling Anchor node with "#Viewpoint" URL). Interpreting this for our implementation, specification says that if you traverse from node X, then all traversed nodes with Also this is useful for searching for the first bindable node after loading the file. Specification says to ignore inline content in this case (although prototype content is Ok in this case). When scriping will be implemented, probably analogous InsideScriptCreatedNode will also be needed, as the spec says that bindable nodes should not be searched within things like "Browser.createX3DFromString()". |
InsidePrototype: Cardinal; |
|
PointingDeviceSensors: TPointingDeviceSensorList; |
|
Active pointing device sensors in this state. This can contain only nodes descending from X3DPointingDeviceSensorNode, and additionally an Anchor node. This list automatically honours VRML / X3D rules for what pointing device sensor is active: pointing device within some group node affects all children in this group node. (And when multiple pointing device sensors are within the same grouping node, they all work.) |
HumanoidTransformation: TTransformation; |
|
For Humanoid skeleton, these contain cummulated joint transformation. |
Humanoid: THAnimHumanoidNode; |
|
Humanoid node containing us, or |
ClipPlanes: TClipPlaneList; |
|
They are collected here regardless of whether they are enabled or not. This allows efficient implementation of Ordered from the most global to most local ones. So, following the X3D specification, we should consider the first clip planes on this list more important. Always |
LocalFog: TLocalFogNode; |
|
Local fog settings. When |
Effects: TX3DNodeList; |
|
Effects (TEffectNode) affecting this state. |
Methods
procedure AddLight(const Light: TLightInstance); |
|
procedure AssignTransform(Source: TX3DGraphTraverseState); |
|
Copy transformation-related fields from Source. Copies Transformation. Copies also the ClipPlanes list, as it contains the transformation information. |
function Transform: TMatrix4; deprecated 'use Transformation.Transform'; |
|
Warning: this symbol is deprecated: use Transformation.Transform |
function InvertedTransform: TMatrix4; deprecated 'use Transformation.InverseTransform'; |
|
Warning: this symbol is deprecated: use Transformation.InverseTransform |
constructor CreateCopy(Source: TX3DGraphTraverseState); |
|
constructor Create; |
|
Standard constructor. Uses global VRML1DefaultState as default nodes for VRML1State. This makes it fast, and improves cache (more nodes have equal reference). |
destructor Destroy; override; |
|
procedure Assign(Source: TX3DGraphTraverseState); |
|
procedure Clear; |
|
Clear the whole state, just like this TX3DGraphTraverseState instance would be just constructed. |
function Equals(SecondValue: TX3DGraphTraverseState; const IgnoreTransform: boolean): boolean; reintroduce; |
|
Compare with other TX3DGraphTraverseState instance. True if these two states, when applied to the same geometry, result in the same TGeometryArrays output. If IgnoreTransform then we should ignore transformation during comparison (it means that renderer is absolutely sure that different transformation of geometry doesn't affect the generated arrays). |
function MainTexture: TAbstractTextureNode; overload; |
|
Primary texture that determines RGB color and opacity. See TAppearanceNode.MainTexture for definition. |
function MainTexture(const GeometryForTexCoord: TAbstractGeometryNode; out TexCoordIndex: Integer): TAbstractTextureNode; overload; |
|
function BlendMode: TBlendModeNode; |
|
Returns |
function AddClipPlane: PClipPlane; |
|
function MaterialInfo: TMaterialInfo; |
|
Material information at this state. See TMaterialInfo for usage description. Returns Returned TMaterialInfo is valid only as long as the underlying Material or CommonSurfaceShader node exists. Do not free it yourself, it will be automatically freed. |
Properties
property VRML1State: TVRML1State read FVRML1State; |
|
Nodes that affect how following nodes are rendered, mostly for VRML 1.0 state. |
property LastNodes: TVRML1State read FVRML1State; deprecated 'use VRML1State'; |
|
Warning: this symbol is deprecated: use VRML1State |
Generated by PasDoc 0.16.0.