C# Класс Axiom.Core.SceneNode

Represents a node in a scene graph.
A SceneNode is a type of Node which is used to organize objects in a scene. It has the same hierarchical transformation properties of the generic Node class, but also adds the ability to attach world objects to the node, and stores hierarchical bounding volumes of the nodes in the tree. Child nodes are contained within the bounds of the parent, and so on down the tree, allowing for fast culling.
Наследование: Node
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
autoTrackLocalDirection Vector3
autoTrackOffset Vector3
autoTrackTarget SceneNode
creator SceneManager
isInSceneGraph bool
isYawFixed bool
lightList LightList
lightListDirty bool
objectList Axiom.Collections.MovableObjectCollection
showBoundingBox bool
visible bool
wireBox WireBoundingBox
worldAABB Axiom.Math.AxisAlignedBox
worldBoundingSphere Axiom.Math.Sphere
yawFixedAxis Vector3

Открытые методы

Метод Описание
AddBoundingBoxToQueue ( RenderQueue queue ) : void

Adds this nodes bounding box (wireframe) to the RenderQueue.

AttachObject ( Axiom.Core.MovableObject obj ) : void

Attaches a MovableObject to this scene node.

A MovableObject will not show up in the scene until it is attached to a SceneNode.

CreateChildSceneNode ( ) : SceneNode

Creates a new child scene node.

CreateChildSceneNode ( Vector3 translate ) : SceneNode

Creates a new child scene node.

CreateChildSceneNode ( Vector3 translate, Quaternion rotate ) : SceneNode

Creates a new child scene node.

CreateChildSceneNode ( string name ) : SceneNode

Creates a new name child node.

CreateChildSceneNode ( string name, Vector3 translate ) : SceneNode

Creates a new named child scene node.

CreateChildSceneNode ( string name, Vector3 translate, Quaternion rotate ) : SceneNode

Creates a new named child scene node.

DetachAllObjects ( ) : void

Removes all currently attached SceneObjects from this SceneNode.

Bounds for this SceneNode are also updated.

DetachObject ( Axiom.Core.MovableObject obj ) : void

Removes the specifed object from this scene node.

Bounds for this SceneNode are also updated.

FindLights ( float radius ) : LightList

Allows retrieval of the nearest lights to the center of this SceneNode.

This method allows a list of lights, ordered by proximity to the center of this SceneNode, to be retrieved. Multiple access to this method when neither the node nor the lights have moved will result in the same list being returned without recalculation. Can be useful when implementing IRenderable.Lights.

FindVisibleObjects ( Camera camera, RenderQueue queue ) : void

Overloaded method.

FindVisibleObjects ( Camera camera, RenderQueue queue, bool includeChildren, bool displayNodes ) : void

Overloaded method.

FindVisibleObjects ( Camera camera, RenderQueue queue, bool includeChildren, bool displayNodes, bool onlyShadowCasters ) : void

Internal method which locates any visible objects attached to this node and adds them to the passed in queue.

GetDebugRenderable ( ) : Node.DebugRenderable
GetObject ( int index ) : Axiom.Core.MovableObject

Returns a movable object attached to this node by index. Node that this method is O(n), whereas the string overload of this method is O(1). Use the string version of this method if speed is important.

GetObject ( string name ) : Axiom.Core.MovableObject

Returns a movable object attached to this node by name. Node that this method is O(n), whereas the integer overload of this method is O(1). Use the integer version of this method if speed is important.

LookAt ( Vector3 target, TransformSpace relativeTo ) : void
LookAt ( Vector3 target, TransformSpace relativeTo, Vector3 localDirection ) : void

Points the local Z direction of this node at a point in space.

NotifyAttachedObjectNameChanged ( Axiom.Core.MovableObject obj ) : void

Rekeys the scene object using its new Name

RemoveAndDestroyAllChildren ( ) : void

Removes and destroys all children in the subtree of this node.

Use this to destroy all nodes found in the child subtree of this node and remove them from the scene graph. Note that all objects attached to the nodes will be detached but will not be destroyed.

RemoveAndDestroyChild ( SceneNode sceneNode ) : void

This method removes and destroys the child and all of its children.

Unlike removeChild, which removes a single named child from this node but does not destroy it, this method destroys the child and all of it's children.

Use this if you wish to recursively destroy a node as well as detaching it from it's parent. Note that any objects attached to the nodes will be detached but will not themselves be destroyed.

RemoveAndDestroyChild ( String name ) : void

This method removes and destroys the child and all of its children.

Unlike removeChild, which removes a single named child from this node but does not destroy it, this method destroys the child and all of it's children.

Use this if you wish to recursively destroy a node as well as detaching it from it's parent. Note that any objects attached to the nodes will be detached but will not themselves be destroyed.

SceneNode ( SceneManager creator ) : System

Basic constructor. Takes a scene manager reference to record the creator.

Can be created manually, but should be left the Create* Methods.

SceneNode ( SceneManager creator, string name ) : System

Overloaded constructor. Takes a scene manager reference to record the creator, and a name for the node.

SetAsRootNode ( ) : void

Only called by SceneManagers

SetAutoTracking ( bool enabled ) : void
SetAutoTracking ( bool enabled, SceneNode target ) : void
SetAutoTracking ( bool enabled, SceneNode target, Vector3 localDirection ) : void
SetAutoTracking ( bool enabled, SceneNode target, Vector3 localDirection, Vector3 offset ) : void

Enables / disables automatic tracking of another SceneNode.

If you enable auto-tracking, this SceneNode will automatically rotate to point it's -Z at the target SceneNode every frame, no matter how it or the other SceneNode move. Note that by default the -Z points at the origin of the target SceneNode, if you want to tweak this, provide a vector in the 'offset' parameter and the target point will be adjusted.

SetDirection ( Real x, Real y, Real z ) : void
SetDirection ( Real x, Real y, Real z, TransformSpace relativeTo ) : void
SetDirection ( Real x, Real y, Real z, TransformSpace relativeTo, Vector3 localDirectionVector ) : void

Sets the node's direction vector ie it's local -z.

Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use the property.

SetDirection ( Vector3 vec ) : void
SetDirection ( Vector3 vec, TransformSpace relativeTo ) : void
SetDirection ( Vector3 vec, TransformSpace relativeTo, Vector3 localDirection ) : void

Sets the node's direction vector ie it's local -z.

Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use the property.

SetFixedYawAxis ( bool useFixed ) : void

Sets a default fixed yaw axis of Y.

SetFixedYawAxis ( bool useFixed, Vector3 fixedAxis ) : void

Tells the node whether to yaw around it's own local Y axis or a fixed axis of choice.

This method allows you to change the yaw behavior of the node - by default, it yaws around it's own local Y axis when told to yaw with TransformSpace.Local, this makes it yaw around a fixed axis. You only really need this when you're using auto tracking (SetAutoTracking(bool), because when you're manually rotating a node you can specify the TransformSpace in which you wish to work anyway.

Yaw ( float degrees ) : void

Overridden to apply fixed yaw axis behavior.

Защищенные методы

Метод Описание
CreateChildImpl ( ) : Node

CreateChildImpl ( string name ) : Node

OnRename ( string oldName ) : void
Update ( bool updateChildren, bool hasParentChanged ) : void

Internal method to update the Node.

Updates this scene node and any relevant children to incorporate transforms etc. Don't call this yourself unless you are writing a SceneManager implementation.

UpdateBounds ( ) : void

Tell the SceneNode to update the world bound info it stores.

UpdateFromParent ( ) : void

dispose ( bool disposeManagedResources ) : void

Приватные методы

Метод Описание
AutoTrack ( ) : void

Internal method used to update auto-tracking scene nodes.

Clear ( ) : void

Need to clear list of child objects in addition to base class functionality.

Описание методов

AddBoundingBoxToQueue() публичный метод

Adds this nodes bounding box (wireframe) to the RenderQueue.
public AddBoundingBoxToQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
Результат void

AttachObject() публичный метод

Attaches a MovableObject to this scene node.
A MovableObject will not show up in the scene until it is attached to a SceneNode.
public AttachObject ( Axiom.Core.MovableObject obj ) : void
obj Axiom.Core.MovableObject
Результат void

CreateChildImpl() защищенный метод

protected CreateChildImpl ( ) : Node
Результат Node

CreateChildImpl() защищенный метод

protected CreateChildImpl ( string name ) : Node
name string
Результат Node

CreateChildSceneNode() публичный метод

Creates a new child scene node.
public CreateChildSceneNode ( ) : SceneNode
Результат SceneNode

CreateChildSceneNode() публичный метод

Creates a new child scene node.
public CreateChildSceneNode ( Vector3 translate ) : SceneNode
translate Vector3 A vector to specify the position relative to the parent.
Результат SceneNode

CreateChildSceneNode() публичный метод

Creates a new child scene node.
public CreateChildSceneNode ( Vector3 translate, Quaternion rotate ) : SceneNode
translate Vector3 A vector to specify the position relative to the parent.
rotate Axiom.Math.Quaternion A quaternion to specify the orientation relative to the parent.
Результат SceneNode

CreateChildSceneNode() публичный метод

Creates a new name child node.
public CreateChildSceneNode ( string name ) : SceneNode
name string
Результат SceneNode

CreateChildSceneNode() публичный метод

Creates a new named child scene node.
public CreateChildSceneNode ( string name, Vector3 translate ) : SceneNode
name string Name of the node.
translate Vector3 A vector to specify the position relative to the parent.
Результат SceneNode

CreateChildSceneNode() публичный метод

Creates a new named child scene node.
public CreateChildSceneNode ( string name, Vector3 translate, Quaternion rotate ) : SceneNode
name string Name of the node.
translate Vector3 A vector to specify the position relative to the parent.
rotate Axiom.Math.Quaternion A quaternion to specify the orientation relative to the parent.
Результат SceneNode

DetachAllObjects() публичный метод

Removes all currently attached SceneObjects from this SceneNode.
Bounds for this SceneNode are also updated.
public DetachAllObjects ( ) : void
Результат void

DetachObject() публичный метод

Removes the specifed object from this scene node.
Bounds for this SceneNode are also updated.
public DetachObject ( Axiom.Core.MovableObject obj ) : void
obj Axiom.Core.MovableObject Reference to the object to remove.
Результат void

FindLights() публичный метод

Allows retrieval of the nearest lights to the center of this SceneNode.
This method allows a list of lights, ordered by proximity to the center of this SceneNode, to be retrieved. Multiple access to this method when neither the node nor the lights have moved will result in the same list being returned without recalculation. Can be useful when implementing IRenderable.Lights.
public FindLights ( float radius ) : LightList
radius float Parameter to specify lights intersecting a given radius of /// this SceneNode's centre
Результат LightList

FindVisibleObjects() публичный метод

Overloaded method.
public FindVisibleObjects ( Camera camera, RenderQueue queue ) : void
camera Camera
queue Axiom.Graphics.RenderQueue
Результат void

FindVisibleObjects() публичный метод

Overloaded method.
public FindVisibleObjects ( Camera camera, RenderQueue queue, bool includeChildren, bool displayNodes ) : void
camera Camera
queue Axiom.Graphics.RenderQueue
includeChildren bool
displayNodes bool
Результат void

FindVisibleObjects() публичный метод

Internal method which locates any visible objects attached to this node and adds them to the passed in queue.
public FindVisibleObjects ( Camera camera, RenderQueue queue, bool includeChildren, bool displayNodes, bool onlyShadowCasters ) : void
camera Camera Active camera.
queue Axiom.Graphics.RenderQueue Queue to which these objects should be added.
includeChildren bool If true, cascades down to all children.
displayNodes bool Renders the local axes for the node.
onlyShadowCasters bool
Результат void

GetDebugRenderable() публичный метод

public GetDebugRenderable ( ) : Node.DebugRenderable
Результат Node.DebugRenderable

GetObject() публичный метод

Returns a movable object attached to this node by index. Node that this method is O(n), whereas the string overload of this method is O(1). Use the string version of this method if speed is important.
public GetObject ( int index ) : Axiom.Core.MovableObject
index int The index of the object to return.
Результат Axiom.Core.MovableObject

GetObject() публичный метод

Returns a movable object attached to this node by name. Node that this method is O(n), whereas the integer overload of this method is O(1). Use the integer version of this method if speed is important.
public GetObject ( string name ) : Axiom.Core.MovableObject
name string The name of the object to return.
Результат Axiom.Core.MovableObject

LookAt() публичный метод

public LookAt ( Vector3 target, TransformSpace relativeTo ) : void
target Vector3
relativeTo TransformSpace
Результат void

LookAt() публичный метод

Points the local Z direction of this node at a point in space.
public LookAt ( Vector3 target, TransformSpace relativeTo, Vector3 localDirection ) : void
target Vector3 A vector specifying the look at point.
relativeTo TransformSpace The space in which the point resides.
localDirection Vector3 /// The vector which normally describes the natural direction of the node, usually -Z. ///
Результат void

NotifyAttachedObjectNameChanged() публичный метод

Rekeys the scene object using its new Name
public NotifyAttachedObjectNameChanged ( Axiom.Core.MovableObject obj ) : void
obj Axiom.Core.MovableObject
Результат void

OnRename() защищенный метод

protected OnRename ( string oldName ) : void
oldName string
Результат void

RemoveAndDestroyAllChildren() публичный метод

Removes and destroys all children in the subtree of this node.
Use this to destroy all nodes found in the child subtree of this node and remove them from the scene graph. Note that all objects attached to the nodes will be detached but will not be destroyed.
public RemoveAndDestroyAllChildren ( ) : void
Результат void

RemoveAndDestroyChild() публичный метод

This method removes and destroys the child and all of its children.
Unlike removeChild, which removes a single named child from this node but does not destroy it, this method destroys the child and all of it's children.

Use this if you wish to recursively destroy a node as well as detaching it from it's parent. Note that any objects attached to the nodes will be detached but will not themselves be destroyed.

public RemoveAndDestroyChild ( SceneNode sceneNode ) : void
sceneNode SceneNode The node to remove and destroy
Результат void

RemoveAndDestroyChild() публичный метод

This method removes and destroys the child and all of its children.
Unlike removeChild, which removes a single named child from this node but does not destroy it, this method destroys the child and all of it's children.

Use this if you wish to recursively destroy a node as well as detaching it from it's parent. Note that any objects attached to the nodes will be detached but will not themselves be destroyed.

public RemoveAndDestroyChild ( String name ) : void
name String name of the node to remove and destroy
Результат void

SceneNode() публичный метод

Basic constructor. Takes a scene manager reference to record the creator.
Can be created manually, but should be left the Create* Methods.
public SceneNode ( SceneManager creator ) : System
creator SceneManager
Результат System

SceneNode() публичный метод

Overloaded constructor. Takes a scene manager reference to record the creator, and a name for the node.
public SceneNode ( SceneManager creator, string name ) : System
creator SceneManager
name string
Результат System

SetAsRootNode() публичный метод

Only called by SceneManagers
public SetAsRootNode ( ) : void
Результат void

SetAutoTracking() публичный метод

public SetAutoTracking ( bool enabled ) : void
enabled bool
Результат void

SetAutoTracking() публичный метод

public SetAutoTracking ( bool enabled, SceneNode target ) : void
enabled bool
target SceneNode
Результат void

SetAutoTracking() публичный метод

public SetAutoTracking ( bool enabled, SceneNode target, Vector3 localDirection ) : void
enabled bool
target SceneNode
localDirection Vector3
Результат void

SetAutoTracking() публичный метод

Enables / disables automatic tracking of another SceneNode.
If you enable auto-tracking, this SceneNode will automatically rotate to point it's -Z at the target SceneNode every frame, no matter how it or the other SceneNode move. Note that by default the -Z points at the origin of the target SceneNode, if you want to tweak this, provide a vector in the 'offset' parameter and the target point will be adjusted.
public SetAutoTracking ( bool enabled, SceneNode target, Vector3 localDirection, Vector3 offset ) : void
enabled bool /// If true, tracking will be enabled and the 'target' cannot be null. /// If false tracking will be disabled and the current orientation will be maintained. ///
target SceneNode /// Reference to the SceneNode to track. Can be null if and only if the enabled param is false. ///
localDirection Vector3 /// The local vector considered to be the usual 'direction' /// of the node; normally the local -Z but can be another direction. ///
offset Vector3 /// If supplied, this is the target point in local space of the target node /// instead of the origin of the target node. Good for fine tuning the look at point. ///
Результат void

SetDirection() публичный метод

public SetDirection ( Real x, Real y, Real z ) : void
x Real
y Real
z Real
Результат void

SetDirection() публичный метод

public SetDirection ( Real x, Real y, Real z, TransformSpace relativeTo ) : void
x Real
y Real
z Real
relativeTo TransformSpace
Результат void

SetDirection() публичный метод

Sets the node's direction vector ie it's local -z.
Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use the property.
public SetDirection ( Real x, Real y, Real z, TransformSpace relativeTo, Vector3 localDirectionVector ) : void
x Real The x component of the direction vector.
y Real The y component of the direction vector.
z Real The z component of the direction vector.
relativeTo TransformSpace The space in which this direction vector is expressed.
localDirectionVector Vector3 The vector which normally describes the natural direction /// of the node, usually -Z. ///
Результат void

SetDirection() публичный метод

public SetDirection ( Vector3 vec ) : void
vec Vector3
Результат void

SetDirection() публичный метод

public SetDirection ( Vector3 vec, TransformSpace relativeTo ) : void
vec Vector3
relativeTo TransformSpace
Результат void

SetDirection() публичный метод

Sets the node's direction vector ie it's local -z.
Note that the 'up' vector for the orientation will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same). If you need more control, use the property.
public SetDirection ( Vector3 vec, TransformSpace relativeTo, Vector3 localDirection ) : void
vec Vector3 The direction vector.
relativeTo TransformSpace The space in which this direction vector is expressed.
localDirection Vector3 The vector which normally describes the natural direction /// of the node, usually -Z. ///
Результат void

SetFixedYawAxis() публичный метод

Sets a default fixed yaw axis of Y.
public SetFixedYawAxis ( bool useFixed ) : void
useFixed bool
Результат void

SetFixedYawAxis() публичный метод

Tells the node whether to yaw around it's own local Y axis or a fixed axis of choice.
This method allows you to change the yaw behavior of the node - by default, it yaws around it's own local Y axis when told to yaw with TransformSpace.Local, this makes it yaw around a fixed axis. You only really need this when you're using auto tracking (SetAutoTracking(bool), because when you're manually rotating a node you can specify the TransformSpace in which you wish to work anyway.
public SetFixedYawAxis ( bool useFixed, Vector3 fixedAxis ) : void
useFixed bool /// If true, the axis passed in the second parameter will always be the yaw axis no /// matter what the node orientation. If false, the node returns to it's default behavior. ///
fixedAxis Vector3 The axis to use if the first parameter is true.
Результат void

Update() защищенный метод

Internal method to update the Node.
Updates this scene node and any relevant children to incorporate transforms etc. Don't call this yourself unless you are writing a SceneManager implementation.
protected Update ( bool updateChildren, bool hasParentChanged ) : void
updateChildren bool
hasParentChanged bool
Результат void

UpdateBounds() защищенный метод

Tell the SceneNode to update the world bound info it stores.
protected UpdateBounds ( ) : void
Результат void

UpdateFromParent() защищенный метод

protected UpdateFromParent ( ) : void
Результат void

Yaw() публичный метод

Overridden to apply fixed yaw axis behavior.
public Yaw ( float degrees ) : void
degrees float
Результат void

dispose() защищенный метод

protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
Результат void

Описание свойств

autoTrackLocalDirection защищенное свойство

Local 'normal' direction vector.
protected Vector3 autoTrackLocalDirection
Результат Vector3

autoTrackOffset защищенное свойство

Tracking offset for fine tuning.
protected Vector3 autoTrackOffset
Результат Vector3

autoTrackTarget защищенное свойство

Auto tracking target.
protected SceneNode,Axiom.Core autoTrackTarget
Результат SceneNode

creator защищенное свойство

Reference to the scene manager who created me.
protected SceneManager,Axiom.Core creator
Результат SceneManager

isInSceneGraph защищенное свойство

Is this node a current part of the scene graph?
protected bool isInSceneGraph
Результат bool

isYawFixed защищенное свойство

Where to yaw around a fixed axis.
protected bool isYawFixed
Результат bool

lightList защищенное свойство

List of lights within range of this node.
protected LightList lightList
Результат LightList

lightListDirty защищенное свойство

Keeps track of whether the list of lights located near this node needs updating.
protected bool lightListDirty
Результат bool

objectList защищенное свойство

A collection of all objects attached to this scene node.
protected MovableObjectCollection,Axiom.Collections objectList
Результат Axiom.Collections.MovableObjectCollection

showBoundingBox защищенное свойство

Whether or not to display this node's bounding box.
protected bool showBoundingBox
Результат bool

visible защищенное свойство

Determines whether node and children are visible or not.
protected bool visible
Результат bool

wireBox защищенное свойство

Renderable bounding box for this node.
protected WireBoundingBox,Axiom.Core wireBox
Результат WireBoundingBox

worldAABB защищенное свойство

Bounding box. Updated through Update.
protected AxisAlignedBox,Axiom.Math worldAABB
Результат Axiom.Math.AxisAlignedBox

worldBoundingSphere защищенное свойство

Word bounding sphere surrounding this node.
protected Sphere,Axiom.Math worldBoundingSphere
Результат Axiom.Math.Sphere

yawFixedAxis защищенное свойство

Fixed axis to yaw around.
protected Vector3 yawFixedAxis
Результат Vector3