com.jme3.scene
クラス Node

java.lang.Object
  上位を拡張 com.jme3.scene.Spatial
      上位を拡張 com.jme3.scene.Node
すべての実装されたインタフェース:
Asset, Collidable, Savable, java.lang.Cloneable
直系の既知のサブクラス:
AssetLinkNode, AudioNode, BitmapText, CameraNode, LightNode, SkeletonDebugger, StatsView, TerrainQuad

public class Node
extends Spatial
implements Savable

Node defines an internal node of a scene graph. The internal node maintains a collection of children and handles merging said children into a single bound to allow for very fast culling of multiple nodes. Node allows for any number of children to be attached.


入れ子のクラスの概要
 
クラス com.jme3.scene.Spatial から継承された入れ子のクラス/インタフェース
Spatial.CullHint
 
フィールドの概要
 
クラス com.jme3.scene.Spatial から継承されたフィールド
queueDistance
 
コンストラクタの概要
Node()
          Serialization only.
Node(java.lang.String name)
          Constructor instantiates a new Node with a default empty list for containing children.
 
メソッドの概要
 int attachChild(Spatial child)
          attachChild attaches a child to this node.
 int attachChildAt(Spatial child, int index)
          attachChildAt attaches a child to this node at an index.
 Node clone(boolean cloneMaterials)
           
 int collideWith(Collidable other, CollisionResults results)
          Check collision with another Collidable.
 Spatial deepClone()
           
 void depthFirstTraversal(SceneGraphVisitor visitor)
          Visit each scene graph element ordered by DFS
<T extends Spatial>
java.util.List<T>
descendantMatches(java.lang.Class<T> spatialSubclass)
          Convenience wrapper.
<T extends Spatial>
java.util.List<T>
descendantMatches(java.lang.Class<T> spatialSubclass, java.lang.String nameRegex)
          Returns flat list of Spatials implementing the specified class AND with name matching the specified pattern.
<T extends Spatial>
java.util.List<T>
descendantMatches(java.lang.String nameRegex)
          Convenience wrapper.
 void detachAllChildren()
          detachAllChildren removes all children attached to this node.
 int detachChild(Spatial child)
          detachChild removes a given child from the node's list.
 Spatial detachChildAt(int index)
          detachChildAt removes a child at a given index.
 int detachChildNamed(java.lang.String childName)
          detachChild removes a given child from the node's list.
 Spatial getChild(int i)
          getChild returns a child at a given index.
 Spatial getChild(java.lang.String name)
          getChild returns the first child found with exactly the given name (case sensitive.)
 int getChildIndex(Spatial sp)
          getChildIndex returns the index of the given spatial in this node's list of children.
 java.util.List<Spatial> getChildren()
          Returns all children to this node.
 int getQuantity()
          getQuantity returns the number of children this node maintains.
 int getTriangleCount()
          getTriangleCount returns the number of triangles contained in all sub-branches of this node that contain geometry.
 int getVertexCount()
          getVertexCount returns the number of vertices contained in all sub-branches of this node that contain geometry.
 boolean hasChild(Spatial spat)
          determines if the provided Spatial is contained in the children list of this node.
 void read(JmeImporter e)
           
 void setLodLevel(int lod)
          Sets the level of detail to use when rendering this Spatial, this call propagates to all geometries under this Spatial.
 void setMaterial(Material mat)
          Applies the given material to the Spatial, this will propagate the material down to the geometries in the scene graph.
 void setModelBound(BoundingVolume modelBound)
          setModelBound sets the bounding object for this Spatial.
 void swapChildren(int index1, int index2)
          More efficient than e.g detaching and attaching as no updates are needed.
 void updateGeometricState()
          updateGeometricState updates the lightlist, computes the world transforms, and computes the world bounds for this Spatial.
 void updateLogicalState(float tpf)
          updateLogicalState calls the update() method for all controls attached to this Spatial.
 void updateModelBound()
          updateModelBound recalculates the bounding object for this Spatial.
 void write(JmeExporter e)
           
 
クラス com.jme3.scene.Spatial から継承されたメソッド
addControl, addLight, breadthFirstTraversal, center, checkCulling, clone, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setShadowMode, setUserData, toString, worldToLocal
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Node

public Node()
Serialization only. Do not use.


Node

public Node(java.lang.String name)
Constructor instantiates a new Node with a default empty list for containing children.

パラメータ:
name - the name of the scene element. This is required for identification and comparision purposes.
メソッドの詳細

getQuantity

public int getQuantity()
getQuantity returns the number of children this node maintains.

戻り値:
the number of children this node maintains.

updateLogicalState

public void updateLogicalState(float tpf)
クラス Spatial の記述:
updateLogicalState calls the update() method for all controls attached to this Spatial.

オーバーライド:
クラス Spatial 内の updateLogicalState
パラメータ:
tpf - Time per frame.
関連項目:
Spatial.addControl(com.jme3.scene.control.Control)

updateGeometricState

public void updateGeometricState()
クラス Spatial の記述:
updateGeometricState updates the lightlist, computes the world transforms, and computes the world bounds for this Spatial. Calling this when the Spatial is attached to a node will cause undefined results. User code should only call this method on Spatials having no parent.

オーバーライド:
クラス Spatial 内の updateGeometricState
関連項目:
Spatial.getWorldLightList(), Spatial.getWorldTransform(), Spatial.getWorldBound()

getTriangleCount

public int getTriangleCount()
getTriangleCount returns the number of triangles contained in all sub-branches of this node that contain geometry.

定義:
クラス Spatial 内の getTriangleCount
戻り値:
the triangle count of this branch.

getVertexCount

public int getVertexCount()
getVertexCount returns the number of vertices contained in all sub-branches of this node that contain geometry.

定義:
クラス Spatial 内の getVertexCount
戻り値:
the vertex count of this branch.

attachChild

public int attachChild(Spatial child)
attachChild attaches a child to this node. This node becomes the child's parent. The current number of children maintained is returned.
If the child already had a parent it is detached from that former parent.

パラメータ:
child - the child to attach to this node.
戻り値:
the number of children maintained by this node.
例外:
java.lang.NullPointerException - If child is null.

attachChildAt

public int attachChildAt(Spatial child,
                         int index)
attachChildAt attaches a child to this node at an index. This node becomes the child's parent. The current number of children maintained is returned.
If the child already had a parent it is detached from that former parent.

パラメータ:
child - the child to attach to this node.
戻り値:
the number of children maintained by this node.
例外:
java.lang.NullPointerException - if child is null.

detachChild

public int detachChild(Spatial child)
detachChild removes a given child from the node's list. This child will no longer be maintained.

パラメータ:
child - the child to remove.
戻り値:
the index the child was at. -1 if the child was not in the list.

detachChildNamed

public int detachChildNamed(java.lang.String childName)
detachChild removes a given child from the node's list. This child will no longe be maintained. Only the first child with a matching name is removed.

パラメータ:
childName - the child to remove.
戻り値:
the index the child was at. -1 if the child was not in the list.

detachChildAt

public Spatial detachChildAt(int index)
detachChildAt removes a child at a given index. That child is returned for saving purposes.

パラメータ:
index - the index of the child to be removed.
戻り値:
the child at the supplied index.

detachAllChildren

public void detachAllChildren()
detachAllChildren removes all children attached to this node.


getChildIndex

public int getChildIndex(Spatial sp)
getChildIndex returns the index of the given spatial in this node's list of children.

パラメータ:
sp - The spatial to look up
戻り値:
The index of the spatial in the node's children, or -1 if the spatial is not attached to this node

swapChildren

public void swapChildren(int index1,
                         int index2)
More efficient than e.g detaching and attaching as no updates are needed.

パラメータ:
index1 - The index of the first child to swap
index2 - The index of the second child to swap

getChild

public Spatial getChild(int i)
getChild returns a child at a given index.

パラメータ:
i - the index to retrieve the child from.
戻り値:
the child at a specified index.

getChild

public Spatial getChild(java.lang.String name)
getChild returns the first child found with exactly the given name (case sensitive.)

パラメータ:
name - the name of the child to retrieve. If null, we'll return null.
戻り値:
the child if found, or null.

hasChild

public boolean hasChild(Spatial spat)
determines if the provided Spatial is contained in the children list of this node.

パラメータ:
spat - the child object to look for.
戻り値:
true if the object is contained, false otherwise.

getChildren

public java.util.List<Spatial> getChildren()
Returns all children to this node. Note that modifying that given list is not allowed.

戻り値:
a list containing all children to this node

setMaterial

public void setMaterial(Material mat)
クラス Spatial の記述:
Applies the given material to the Spatial, this will propagate the material down to the geometries in the scene graph.

オーバーライド:
クラス Spatial 内の setMaterial
パラメータ:
mat - The material to set.

setLodLevel

public void setLodLevel(int lod)
クラス Spatial の記述:
Sets the level of detail to use when rendering this Spatial, this call propagates to all geometries under this Spatial.

オーバーライド:
クラス Spatial 内の setLodLevel
パラメータ:
lod - The lod level to set.

collideWith

public int collideWith(Collidable other,
                       CollisionResults results)
インタフェース Collidable の記述:
Check collision with another Collidable.

定義:
インタフェース Collidable 内の collideWith
パラメータ:
other - The object to check collision against
results - Will contain the list of CollisionResults.
戻り値:
how many collisions were found between this and other

descendantMatches

public <T extends Spatial> java.util.List<T> descendantMatches(java.lang.Class<T> spatialSubclass,
                                                               java.lang.String nameRegex)
Returns flat list of Spatials implementing the specified class AND with name matching the specified pattern.

Note that we are matching the pattern, therefore the pattern must match the entire pattern (i.e. it behaves as if it is sandwiched between "^" and "$"). You can set regex modes, like case insensitivity, by using the (?X) or (?X:Y) constructs.

By design, it is always safe to code loops like:

     for (Spatial spatial : node.descendantMatches(AClass.class, "regex"))
 

"Descendants" does not include self, per the definition of the word. To test for descendants AND self, you must do a node.matches(aClass, aRegex) + node.descendantMatches(aClass, aRegex).

パラメータ:
spatialSubclass - Subclass which matching Spatials must implement. Null causes all Spatials to qualify.
nameRegex - Regular expression to match Spatial name against. Null causes all Names to qualify.
戻り値:
Non-null, but possibly 0-element, list of matching Spatials (also Instances extending Spatials).
関連項目:
Pattern, Spatial.matches(java.lang.Class, java.lang.String)

descendantMatches

public <T extends Spatial> java.util.List<T> descendantMatches(java.lang.Class<T> spatialSubclass)
Convenience wrapper.

関連項目:
descendantMatches(java.lang.Class, java.lang.String)

descendantMatches

public <T extends Spatial> java.util.List<T> descendantMatches(java.lang.String nameRegex)
Convenience wrapper.

関連項目:
descendantMatches(java.lang.Class, java.lang.String)

clone

public Node clone(boolean cloneMaterials)
オーバーライド:
クラス Spatial 内の clone
戻り値:
A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated. All controls will be cloned using the Control.cloneForSpatial method on the clone.
関連項目:
Mesh.cloneForAnim()

deepClone

public Spatial deepClone()
定義:
クラス Spatial 内の deepClone
戻り値:
Similar to Spatial.clone() except will create a deep clone of all geometry's meshes, normally this method shouldn't be used instead use Spatial.clone()
関連項目:
Spatial.clone()

write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス Spatial 内の write
例外:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス Spatial 内の read
例外:
java.io.IOException

setModelBound

public void setModelBound(BoundingVolume modelBound)
クラス Spatial の記述:
setModelBound sets the bounding object for this Spatial.

定義:
クラス Spatial 内の setModelBound
パラメータ:
modelBound - the bounding object for this spatial.

updateModelBound

public void updateModelBound()
クラス Spatial の記述:
updateModelBound recalculates the bounding object for this Spatial.

定義:
クラス Spatial 内の updateModelBound

depthFirstTraversal

public void depthFirstTraversal(SceneGraphVisitor visitor)
クラス Spatial の記述:
Visit each scene graph element ordered by DFS

定義:
クラス Spatial 内の depthFirstTraversal