Class TSceneNode

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSceneNode = class(TAttributeExchangingObject)

Description

Base class for all scene nodes.
A scene node is a node in the hierarchical scene graph. Every scene node may have children, which are also scene nodes. Children move relative to their parent's position. If the parent of a node is not visible, its children won't be visible either. In this way, it is for example easily possible to attach a light to a moving car, or to place a walking character on a moving platform on a moving ship.

Hierarchy

Overview

Methods

Public constructor Create(NReference: Pointer; NSceneManager: TReferenceCounted; NAutoDrop: Boolean = False);
Public function Clone(Parent: TSceneNode = nil; NewManager: TReferenceCounted = nil): TSceneNode; inline;
Public function GetAnimators: TAnimatorListIterator; inline;
Public function GetChildren: TSceneNodeListIterator; inline;
Public function GetParent: TSceneNode; inline;
Public function GetTransformedBoundingBox: TBoundingBox; inline;
Public function GetTriangleSelector: TReferenceCounted; inline;
Public function IsTrulyVisible: Boolean; inline;
Public procedure AddAnimator(Animator: TSceneNodeAnimator); inline;
Public procedure AddChild(Child: TSceneNode); inline;
Public procedure OnAnimate(TimeMS: LongWord); inline;
Public procedure OnRegisterSceneNode; inline;
Public procedure Remove; inline;
Public procedure RemoveAll; inline;
Public procedure RemoveAnimator(Anim: TSceneNodeAnimator); inline;
Public procedure RemoveAnimators; inline;
Public procedure RemoveChild(Child: TSceneNode); inline;
Public procedure Render; inline;
Public procedure SetMaterialFlag(Flag: TMaterialFlag; NewValue: Boolean = True); inline;
Public procedure SetMaterialTexture(TextureLayer: LongWord; Texture: TTexture); inline;
Public procedure SetMaterialType(NewType: TMaterialType); inline;
Public procedure SetParent(NewParent: TSceneNode); inline;
Public procedure SetTriangleSelector(NewSelector: TReferenceCounted); inline;
Public procedure UpdateAbsolutePosition; inline;

Properties

Public property AbsolutePosition: TVector3D read GetAbsolutePosition;
Public property AbsoluteTransformation: TMatrix4 read GetAbsoluteTransformation;
Public property AutomaticCulling: TAutomaticCulling read GetAutomaticCulling write SetAutomaticCulling;
Public property BoundingBox: TBoundingBox read GetBoundingBox;
Public property DebugDataVisible: LongWord read IsDebugDataVisible write SetDebugDataVisible;
Public property ID: LongInt read GetID write SetID;
Public property IsDebugObject: Boolean read GetIsDebugObject write SetIsDebugObject;
Public property MaterialCount: LongWord read GetMaterialCount;
Public property Materials[Index: LongWord]: PMaterial read GetMaterial;
Public property Name: AnsiString read GetName write SetName;
Public property Position: TVector3D read GetPosition write SetPosition;
Public property Rotation: TVector3D read GetRotation write SetRotation;
Public property Scale: TVector3D read GetScale write SetScale;
Public property SceneManager: TReferenceCounted read FSceneManager;
Public property SceneNodeType: TSceneNodeType read GetSceneNodeType;
Public property Visible: Boolean read IsVisible write SetVisible;

Description

Methods

Public constructor Create(NReference: Pointer; NSceneManager: TReferenceCounted; NAutoDrop: Boolean = False);

Creates a Wrapper object from a pointer handle. Only used internally.

Public function Clone(Parent: TSceneNode = nil; NewManager: TReferenceCounted = nil): TSceneNode; inline;

Creates a clone of this scene node and its children.

Parameters
Parent
A new parent (optional)
NewManager
A new SceneManager (optional)
Public function GetAnimators: TAnimatorListIterator; inline;

Returns an iterator for all scene node animators.

Public function GetChildren: TSceneNodeListIterator; inline;

Returns an iterator for all child nodes.

Public function GetParent: TSceneNode; inline;

Returns the node's parent.

Public function GetTransformedBoundingBox: TBoundingBox; inline;

Get the axis aligned, transformed and animated absolute bounding box of this node.

Public function GetTriangleSelector: TReferenceCounted; inline;

Returns the triangle selector attached to this scene node.

Public function IsTrulyVisible: Boolean; inline;

Check whether the node is truly visible, taking into accounts its parents' visibility.

Public procedure AddAnimator(Animator: TSceneNodeAnimator); inline;

Adds an animator which should animate this node.

Public procedure AddChild(Child: TSceneNode); inline;

Adds a child to this scene node.

Public procedure OnAnimate(TimeMS: LongWord); inline;

OnAnimate() is called just before rendering the whole scene.

Public procedure OnRegisterSceneNode; inline;

This method is called just before the rendering process of the whole scene.

Public procedure Remove; inline;

Removes this scene node from the scene.

Public procedure RemoveAll; inline;

Removes all children of this scene node.

Public procedure RemoveAnimator(Anim: TSceneNodeAnimator); inline;

Removes an animator from this scene node.

Public procedure RemoveAnimators; inline;

Removes all animators from this scene node.

Public procedure RemoveChild(Child: TSceneNode); inline;

Removes a child from this scene node.

Public procedure Render; inline;

Renders the node.

Public procedure SetMaterialFlag(Flag: TMaterialFlag; NewValue: Boolean = True); inline;

Sets all material flags at once to a new value.

Public procedure SetMaterialTexture(TextureLayer: LongWord; Texture: TTexture); inline;

Sets the texture of the specified layer in all materials to the new texture.

Parameters
TextureLayer
Layer of texture to be set. Must be a value smaller than MaxMaterialTextures.
Texture
The new Texture.
Public procedure SetMaterialType(NewType: TMaterialType); inline;

Sets the material type of all materials in this scene node to a new material type.

Public procedure SetParent(NewParent: TSceneNode); inline;

Changes the parent of the scene node.

Public procedure SetTriangleSelector(NewSelector: TReferenceCounted); inline;

Sets the triangle selector of the scene node.

Public procedure UpdateAbsolutePosition; inline;

Updates the absolute position based on the relative and the parents position.
Note: This does not recursively update the parents absolute positions, so if you have a deeper hierarchy you might want to update the parents first.

Properties

Public property AbsolutePosition: TVector3D read GetAbsolutePosition;

Gets the absolute position of the node in world coordinates.

Public property AbsoluteTransformation: TMatrix4 read GetAbsoluteTransformation;

Get the absolute transformation of the node. Is recalculated every OnAnimate() call.

Public property AutomaticCulling: TAutomaticCulling read GetAutomaticCulling write SetAutomaticCulling;

Enables or disables automatic culling based on the bounding box.

Public property BoundingBox: TBoundingBox read GetBoundingBox;

The axis aligned, not transformed bounding box of this node.

Public property DebugDataVisible: LongWord read IsDebugDataVisible write SetDebugDataVisible;

Returns or sets if debug data like bounding boxes are drawn.

Public property ID: LongInt read GetID write SetID;

The ID of the scene node

Public property IsDebugObject: Boolean read GetIsDebugObject write SetIsDebugObject;

Returns or sets if this scene node is a debug object.

Public property MaterialCount: LongWord read GetMaterialCount;
 
Public property Materials[Index: LongWord]: PMaterial read GetMaterial;

Returns the material based on the zero based index i.

Public property Name: AnsiString read GetName write SetName;

The name of the scnene node.

Public property Position: TVector3D read GetPosition write SetPosition;

The position of the node relative to its parent.

Public property Rotation: TVector3D read GetRotation write SetRotation;

The rotation of the node relative to its parent.

Public property Scale: TVector3D read GetScale write SetScale;

The relative scale of the scene node.

Public property SceneManager: TReferenceCounted read FSceneManager;

The manager of this scene node.

Public property SceneNodeType: TSceneNodeType read GetSceneNodeType;

The type of this scene node

Public property Visible: Boolean read IsVisible write SetVisible;

Whether this node is visible or not.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22