Package com.ardor3d.scenegraph.extension
Class BillboardNode
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.scenegraph.extension.BillboardNode
BillboardNode
defines a node that will attempt to orient itself in relation to the current camera. The
way it does this depends on the alignment type set via setAlignment(BillboardAlignment)
.
BillboardNode
is often a useful way fake complex distant geometry using a single quad that has an image
applied to it. This quad, with the texture, will appear to be a full model at great distances, and save on rendering
and memory.
It is also worth noting that you can use any geometry with this node, not just quads.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Method of alignment to use. -
Field Summary
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
updates the billboards orientation then renders the billboard's children.Returns the alignment this BillboardNode is set to.boolean
void
read
(InputCapsule capsule) void
Rotate the billboard based on the type set and the currently set camera.void
setAlignment
(BillboardNode.BillboardAlignment alignment) Sets the type of rotation this BillboardNode will have.void
setLocalRotation
(Matrix3 rot) void
setUpdateBounds
(boolean doUpdate) Normally a billboard triggers transform and bounds updates on its children.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.Node
acceptVisitor, attachChild, attachChildAt, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, sortLights, swapChildren, updateChildren, updateWorldBound, updateWorldRenderStates, updateWorldTransform
Methods inherited from class com.ardor3d.scenegraph.Spatial
addController, addTranslation, addTranslation, applyWorldRenderStates, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, worldToLocal
-
Constructor Details
-
BillboardNode
public BillboardNode() -
BillboardNode
Constructor instantiates a newBillboardNode
. The name of the node is supplied during construction.- Parameters:
name
- the name of the node.
-
-
Method Details
-
draw
draw
updates the billboards orientation then renders the billboard's children. -
setUpdateBounds
public void setUpdateBounds(boolean doUpdate) Normally a billboard triggers transform and bounds updates on its children. Setting this to false will only trigger dirty flags for transform, potentially saving some expensive bounds calculations if those are deemed unnecessary (for example, when using sphere bounds and quad billboards. Setting to false may cause odd culling behavior.- Parameters:
doUpdate
- true (the default) if we should request bounds updates for children, false if not.
-
isUpdateBounds
public boolean isUpdateBounds()- Returns:
- true if bounds are dirtied for children each frame.
- See Also:
-
setLocalRotation
-
getLocalRotation
-
rotateBillboard
public void rotateBillboard()Rotate the billboard based on the type set and the currently set camera.- See Also:
-
getAlignment
Returns the alignment this BillboardNode is set to.- Returns:
- The alignment of rotation.
-
setAlignment
Sets the type of rotation this BillboardNode will have. The alignment can be ScreenAligned, CameraAligned, AxialY or AxialZ. Invalid alignments will assume no billboard rotation.- Parameters:
alignment
- The alignment of rotation
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classNode
- Parameters:
capsule
- the capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classNode
- Parameters:
capsule
- the input capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-