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
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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