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.
Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 24).
Hierarchy
- TObject
- TX3DGraphTraverseState
Overview
Fields
| Public | Lights: TLightInstancesList; |
| Public | Transformation: TTransformation; |
| Public | Vrml1TextureTransform: TMatrix4; |
| Public | ShapeNode: TAbstractShapeNode; |
| Public | Appearance: TAppearanceNode; |
| Public | InsideInline: Cardinal; |
| Public | InsidePrototype: Cardinal; |
| Public | InsideIgnoreCollision: Cardinal; |
| Public | InsideInvisible: Cardinal; |
| Public | PointingDeviceSensors: TPointingDeviceSensorList; |
| Public | Humanoid: THAnimHumanoidNode; |
| Public | Skin: TSkinNode; |
| Public | ClipPlanes: TClipPlaneList; |
| Public | LocalFog: TLocalFogNode; |
| Public | Effects: TX3DNodeList; |
Methods
| Public | procedure AddLight(const Light: TLightInstance); |
| Public | procedure AssignTransform(Source: TX3DGraphTraverseState); |
| Public | function Transform: TMatrix4; deprecated 'use Transformation.Transform'; |
| Public | function InvertedTransform: TMatrix4; deprecated 'use Transformation.InverseTransform'; |
| Public | constructor CreateCopy(Source: TX3DGraphTraverseState); |
| Public | constructor Create; |
| Public | destructor Destroy; override; |
| Public | procedure Assign(Source: TX3DGraphTraverseState); |
| Public | procedure Clear; |
| Public | function Equals(SecondValue: TX3DGraphTraverseState; const IgnoreTransform: boolean): boolean; reintroduce; |
| Public | function MainTexture: TAbstractTextureNode; overload; |
| Public | function MainTexture(const GeometryForTexCoord: TAbstractGeometryNode; out TexCoordIndex: Integer): TAbstractTextureNode; overload; |
| Public | function BlendMode: TBlendModeNode; |
| Public | function AddClipPlane: PClipPlane; |
| Public | function MaterialInfo: TMaterialInfo; |
| Public | function SkinnedAnimatedShape: Boolean; |
Properties
| Public | property VRML1State: TVRML1State read FVRML1State; |
| Public | property LastNodes: TVRML1State read FVRML1State; deprecated 'use VRML1State'; |
Description
Fields
| Public | 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. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 44). | |
| Public | Transformation: TTransformation; |
|
Transformation of this state. Calculated efficiently while traversing the X3D graph. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 50). | |
| Public | Vrml1TextureTransform: TMatrix4; |
|
VRML 1.0 accumulated texture transformation. Usable only for VRML 1.0, as in X3D / VRML 2.0 texture transformations don't accumulate. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 64). | |
| Public | ShapeNode: TAbstractShapeNode; |
|
Parent shape node in the current state. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 67). | |
| Public | Appearance: TAppearanceNode; |
|
TAppearanceNode associated with the shape (only if ShapeNode<>nil) in the current state. This is always synchronized with ShapeNode.Appearance, if ShapeNode<>nil (and when ShapeNode=nil, then Appearance is also nil). Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 73). | |
| Public | 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()". Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 174). | |
| Public | InsidePrototype: Cardinal; |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 175). | |
| Public | InsideIgnoreCollision: Cardinal; |
|
This is > 0 when traversing nodes that do not participate in collision detection. This counts how many times are we inside Collision node that prevents us from colliding. More precise, this is increased when we traverse inside Collision.children with Collision.enabled = FALSE or Collision.proxy <> NULL (since then Collision.children are not collidable). Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 187). | |
| Public | InsideInvisible: Cardinal; |
|
This is > 0 when traversing nodes that are not visible. This counts how many times are we inside Collision.proxy (with Collision.enabled = TRUE). Collision.proxy is never visible. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 194). | |
| Public | 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.) Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 205). | |
| Public | Humanoid: THAnimHumanoidNode; |
|
Humanoid node containing us, or Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 208). | |
| Public | Skin: TSkinNode; |
|
Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 210). | |
| Public | 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 Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 224). | |
| Public | LocalFog: TLocalFogNode; |
|
Local fog settings. When Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 228). | |
| Public | Effects: TX3DNodeList; |
|
Effects (TEffectNode) affecting this state. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 231). | |
Methods
| Public | procedure AddLight(const Light: TLightInstance); |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 46). | |
| Public | procedure AssignTransform(Source: TX3DGraphTraverseState); |
|
Copy transformation-related fields from Source. Copies Transformation. Copies also the ClipPlanes list, as it contains the transformation information. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 55). | |
| Public | function Transform: TMatrix4; deprecated 'use Transformation.Transform'; |
|
Warning: this symbol is deprecated: use Transformation.Transform This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 57). | |
| Public | function InvertedTransform: TMatrix4; deprecated 'use Transformation.InverseTransform'; |
|
Warning: this symbol is deprecated: use Transformation.InverseTransform This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 58). | |
| Public | constructor CreateCopy(Source: TX3DGraphTraverseState); |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 75). | |
| Public | constructor Create; |
|
Standard constructor. Uses global VRML1DefaultState as default nodes for VRML1State. This makes it fast, and improves cache (more nodes have equal reference). Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 80). | |
| Public | destructor Destroy; override; |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 82). | |
| Public | procedure Assign(Source: TX3DGraphTraverseState); |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 84). | |
| Public | procedure Clear; |
|
Clear the whole state, just like this TX3DGraphTraverseState instance would be just constructed. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 88). | |
| Public | 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). Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 96). | |
| Public | function MainTexture: TAbstractTextureNode; overload; |
|
Texture that determines the primary RGB color and transparency (opacity). When rendering using Gouraud shading (following the X3D 4 specification advise), this is the texture that should be used. For Phong shading, follow instead the full lighting equation and use all textures specified in the material (this "main texture" is just one of them). This takes into account every possibility:
The overloaded version with TexCoordIndex parameter also specifies which texture coordinates / transformations should be used for this texture. It returns -1 when we should use standard MultiTexture specification for this, which also covers the case when The version without extra parameters always returns the same thing (same texture node) as the other overloaded version, it just doesn't return extra parameters GeometryForTexCoord, TexCoordIndex (and may be a bit faster). Returns Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 136). | |
| Public | function MainTexture(const GeometryForTexCoord: TAbstractGeometryNode; out TexCoordIndex: Integer): TAbstractTextureNode; overload; |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 137). | |
| Public | function BlendMode: TBlendModeNode; |
|
Returns Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 142). | |
| Public | function AddClipPlane: PClipPlane; |
|
This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 233). | |
| Public | 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. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 243). | |
| Public | function SkinnedAnimatedShape: Boolean; |
|
Is current shape animated using skinned animation by being inside TSkinNode.FdShapes. Shapes that are rigid children of joints, in TSkinNode.FdSkeleton, are not considered skinned animated by this method. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 249). | |
Properties
| Public | property VRML1State: TVRML1State read FVRML1State; |
|
Nodes that affect how following nodes are rendered, mostly for VRML 1.0 state. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 31). | |
| Public | property LastNodes: TVRML1State read FVRML1State; deprecated 'use VRML1State'; |
|
Warning: this symbol is deprecated: use VRML1State This item has no description. Source: scene/x3d/x3dnodes_x3dgraphtraversestate.inc (line 33). | |
Generated by PasDoc 0.17.0.snapshot.