|
||||||||||
| 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
com.jme.scene.SwitchNode
public class SwitchNode
SwitchNode defines a node that maintains a single active child
at a time. This allows the instantaneous switching of children depending on
any number of factors. For example, multiple levels of detail models can be
loaded into the switch node and the active model can be set depending on the
distance from the camera.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jme.scene.Spatial |
|---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
| Field Summary | |
|---|---|
static int |
SN_INVALID_CHILD
defines an inactive or invalid child. |
| Fields inherited from class com.jme.scene.Node |
|---|
children |
| Fields inherited from class com.jme.scene.Spatial |
|---|
collisionBits, cullHint, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
|---|---|
SwitchNode()
|
|
SwitchNode(java.lang.String name)
Constructor instantiates a new SwitchNode object. |
|
| Method Summary | |
|---|---|
int |
attachChild(Spatial child)
Attaches a child to this SwitchNode. |
int |
attachChildAt(Spatial child,
int index)
Attaches a child to this SwitchNode at a specified index. |
void |
disableAllChildren()
Marks the node to render nothing on a draw. |
void |
draw(Renderer r)
If a valid active child is set, that child is rendered and none others. |
void |
findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
collisions are checked for the currently active child. |
void |
findPick(Ray toTest,
PickResults results,
int requiredOnBits)
Tests a ray against this spatial, and stores the results in the result object. |
int |
getActiveChild()
Returns the index of the currently rendered child for this Node. |
boolean |
hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
collisions are checked for the currently active child. |
void |
read(JMEImporter e)
|
void |
setActiveChild(int child)
Sets the index of the child of this Node that will be rendered. |
void |
write(JMEExporter e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jme.util.export.Savable |
|---|
getClassTag |
| Field Detail |
|---|
public static final int SN_INVALID_CHILD
| Constructor Detail |
|---|
public SwitchNode()
public SwitchNode(java.lang.String name)
SwitchNode object. The name
of the node is provided during construction.
name - the name of the node.| Method Detail |
|---|
public int getActiveChild()
public void setActiveChild(int child)
child - The child index of this node it should render.public void disableAllChildren()
public int attachChild(Spatial child)
attachChild in class Nodechild - the child to attach to this node.
public int attachChildAt(Spatial child,
int index)
attachChildAt in class Nodechild - the child to attach to this node.
public void draw(Renderer r)
draw in class Noder - The render system to draw the child.Spatial.draw(com.jme.renderer.Renderer)
public void findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
findCollisions in class Nodescene - the scene to test against.results - the results of the collisions.requiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
public boolean hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
hasCollision in class Nodescene - the scene to test against.checkTriangles - check for collisions on triangle accuracy levelrequiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
public void findPick(Ray toTest,
PickResults results,
int requiredOnBits)
Spatial
findPick in class NodetoTest - ray to test picking againstresults - the results of the pickingrequiredOnBits - considered a collision only if these bits are 'on'
in 'this' spatial.
public void write(JMEExporter e)
throws java.io.IOException
write in interface Savablewrite in class Nodejava.io.IOException
public void read(JMEImporter e)
throws java.io.IOException
read in interface Savableread in class Nodejava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||