Class TShapeTreeTransform

Unit

Declaration

type TShapeTreeTransform = class(TShapeTreeGroup)

Description

Node of the TShapeTree transforming it's children. Use this to handle X3D TTransformNode and similar nodes (which define TTransformFunctionality).

Hierarchy

Overview

Fields

Public TransformNeedsUpdate: Boolean;

Methods

Public constructor Create(const AParentScene: TX3DEventsEngine);
Public destructor Destroy; override;
Public procedure FastTransformUpdate(var AnythingChanged: Boolean); virtual;
Public function DebugInfoWithoutChildren: String; override;
Public function TransformNode: TX3DNode;

Properties

Public property TransformFunctionality: TTransformFunctionality read FTransformFunctionality write SetTransformFunctionality;
Public property TransformState: TX3DGraphTraverseState read FTransformState;

Description

Fields

Public TransformNeedsUpdate: Boolean;

Do we need call to FastTransformUpdateCore to recalculate our transformation (in TransformState.Transformation).

Methods

Public constructor Create(const AParentScene: TX3DEventsEngine);

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public procedure FastTransformUpdate(var AnythingChanged: Boolean); virtual;

Process transformation changes here and in child, if only TransformNeedsUpdate = true.

This calls FastTransformUpdateCore if update is really necessary, which in turn will make real update, call FastTransformUpdateCore on all children, and set TransformNeedsUpdate = false.

In effect, calling this may set TransformNeedsUpdate to false both on this instance, and on some children.

This makes updating transformation hierarchy, from the instances with smallest Depth, and looking only at shapes with possibly TransformNeedsUpdate=true (stored in TransformationDirty by TCastleSceneCore) optimal:

- We only enter subtrees with TransformNeedsUpdate=true, no need to process whole Shapes tree (esp. important if only a small subset of the transformations changed, e.g. we changed TTransformNode of one object in a model with 10000 objects).

- We do not process the same subtree multiple times. This is especially important for typical skeletons (glTF Skin, H-Anim HAnimHumanoid, a regular Transform hierarchy with rigid objects, Spine JSON skeletons...) where usually every frame, many joints change transformation. In this case, FastTransformUpdate on smallest depth will do the actual work – it will be the skeleton root. FastTransformUpdate on other depths will be usually ignored (if you only have this one skeleton in entire model), because they've been already updated.

Public function DebugInfoWithoutChildren: String; override;

This item has no description. Showing description inherited from TShapeTree.DebugInfoWithoutChildren.

Describe this shape, not recursively.

Public function TransformNode: TX3DNode;

This item has no description.

Properties

Public property TransformFunctionality: TTransformFunctionality read FTransformFunctionality write SetTransformFunctionality;

This item has no description.

Public property TransformState: TX3DGraphTraverseState read FTransformState;

State right before traversing the TransformNode. Owned by this TShapeTreeTransform instance. You should assign to it when you set TransformNode.

The TransformState.Transformation contains the parent transformation, before the effect of the node in TransformNode is applied.


Generated by PasDoc 0.16.0-snapshot.