|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Node
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.
| Field Summary | |
protected java.util.ArrayList |
children
This node's children. |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
Node()
Empty Constructor to be used internally only. |
|
Node(java.lang.String name)
Constructor instantiates a new Node with a default empty
list for containing children. |
|
| Method Summary | |
protected void |
applyRenderState(java.util.Stack[] states)
Applies the stack of render states to each child by calling updateRenderState(states) on each child. |
int |
attachChild(Spatial child)
attachChild attaches a child to this node. |
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. |
void |
draw(Renderer r)
draw calls the onDraw method for each child maintained by
this node. |
void |
drawBounds(Renderer r)
drawBounds calls super to set the render state then passes
itself to the renderer. |
void |
findCollisions(Spatial scene,
CollisionResults results)
checks this spatial against a second spatial, any collisions are stored in the results object. |
void |
findPick(Ray toTest,
PickResults results)
|
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.) |
java.util.ArrayList |
getChildren()
|
int |
getQuantity()
getQuantity returns the number of children this node
maintains. |
boolean |
hasChild(Spatial spat)
determines if the provide Spatial is contained in the children list of this node. |
boolean |
hasCollision(Spatial scene,
boolean checkTriangles)
|
Spatial |
putClone(Spatial store,
CloneCreator properties)
|
Spatial |
setChild(int i,
Spatial child)
setChild places a child at a given index. |
void |
setForceView(boolean value)
setForceView will force the node to be rendered whether
it's in the camera frustum or not. |
void |
updateCollisionTree()
This method updates the exact bounding tree of any this Spatial. |
void |
updateWorldBound()
updateWorldBound merges the bounds of all the children
maintained by this node. |
void |
updateWorldData(float time)
updateWorldData updates all the children maintained by
this node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.ArrayList children
| Constructor Detail |
public Node()
public Node(java.lang.String name)
Node with a default empty
list for containing children.
name - the name of the scene element. This is required for
identification and comparision purposes.| Method Detail |
public int getQuantity()
getQuantity returns the number of children this node
maintains.
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.
child - the child to attach to this node.
public int detachChild(Spatial child)
detachChild removes a given child from the node's list.
This child will no longe be maintained.
child - the child to remove.
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.
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.
public void detachAllChildren()
detachAllChildren removes all children attached to this
node.
public Spatial setChild(int i,
Spatial child)
setChild places a child at a given index. If a child is
already set to that index the old child is returned.
i - the index to set the child to.child - the child to attach.
public Spatial getChild(int i)
getChild returns a child at a given index.
i - the index to retrieve the child from.
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.
public void setForceView(boolean value)
SpatialsetForceView will force the node to be rendered whether
it's in the camera frustum or not.
setForceView in class Spatialvalue - true to force viewing, false otherwise.public boolean hasChild(Spatial spat)
spat - the spatial object to check.
public void updateWorldData(float time)
updateWorldData updates all the children maintained by
this node.
updateWorldData in class Spatialtime - the frame time.public void draw(Renderer r)
draw calls the onDraw method for each child maintained by
this node.
draw in class Spatialr - the renderer to draw to.Spatial.draw(com.jme.renderer.Renderer)public void drawBounds(Renderer r)
drawBounds calls super to set the render state then passes
itself to the renderer.
drawBounds in class Spatialr - the renderer to displayprotected void applyRenderState(java.util.Stack[] states)
applyRenderState in class Spatialstates - The Stack[] of render states to apply to each child.public void updateWorldBound()
updateWorldBound merges the bounds of all the children
maintained by this node. This will allow for faster culling operations.
updateWorldBound in class SpatialSpatial.updateWorldBound()public void updateCollisionTree()
Spatial
updateCollisionTree in class SpatialSpatial.updateCollisionTree()
public void findCollisions(Spatial scene,
CollisionResults results)
Spatial
findCollisions in class Spatialscene - the scene to test against.results - the results of the collisions.
public boolean hasCollision(Spatial scene,
boolean checkTriangles)
hasCollision in class Spatial
public void findPick(Ray toTest,
PickResults results)
findPick in class Spatial
public Spatial putClone(Spatial store,
CloneCreator properties)
putClone in class Spatialpublic java.util.ArrayList getChildren()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||