public class Billboard extends BaseGroup implements CustomCullable, CustomPickTarget, PickableObject
This class is design to operate in a shared scene graph structure. It works with the Cullable interface to make sure that regardless of the traversal path, it will have the children pointing towards the camera location. This makes it safe to share between layers as well as normal scene graph usage. Correctness is ensured regardless of culling traversal.
Bounds of this object is represented as a spherical object that is based on the largest dimension of all the children combined.
In order to use this node effectively, you will need to use the
FrustumCullStage to process the
children. It uses custom culling routines internally and that is the only cull
stage that will do something useful with ths node.
Internationalisation Resource Names
childList, dirtyBoundsCount, lastChildbounds, implicitBounds, parentalive, LISTENER_SET_TIMING_ERR_PROP, updateHandlerCUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPECOLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT| Constructor and Description |
|---|
Billboard()
Construct a default billboard that uses point mode for the default axis.
|
Billboard(boolean pointMode)
Create a new billboard with the option of rotating around a point in space or
any nominal axis.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPickMask(int mask)
Check the given pick mask against the node's internal pick mask representation.
|
void |
cullChildren(CullInstructions output,
org.j3d.maths.vector.Matrix4d vworldTx,
org.j3d.maths.vector.Matrix4d viewTransform,
org.j3d.maths.vector.Vector4d[] frustumPlanes,
float angularRes)
Check this node for children to traverse.
|
void |
getAxisOfRotation(float[] axis)
Fetch the currently set axis of rotation.
|
BoundingVolume |
getPickableBounds()
Get the bounds of this picking target so that testing can be performed on the
object.
|
int |
getPickMask()
Get the current pickable state mask of this object.
|
int |
getPickTargetType()
Return the type constant that represents the type of pick target this
is.
|
boolean |
isPointMode()
Check to see whether this billboard is operating as a point in space or along
an axis.
|
void |
pickBatch(PickRequest[] reqs,
int numRequests)
Check for all intersections against this geometry and it's children to
see if there is an intersection with the given set of requests.
|
void |
pickChildren(PickInstructions output,
org.j3d.maths.vector.Matrix4d vworldTx,
PickRequest req)
This node is being subjected to picking, so process the provided data and return
the instructions on the list of available children and any transformation
information to the system.
|
void |
pickSingle(PickRequest req)
Check for all intersections against this geometry and it's children to
see if there is an intersection with the given set of requests.
|
protected void |
recomputeBounds()
Implementation of recompute bounds.
|
void |
setAxisOfRotation(float[] axis)
Set the axis of rotation used when the billboard is not operating in point
mode.
|
void |
setPickMask(int state)
Set the node as being pickable currently using the given bit mask.
|
addChild, checkForCyclicChild, getAllChildren, getChild, indexOfChild, markBoundsDirty, numChildren, removeAllChildren, removeChild, removeChild, requestBoundsUpdate, setBounds, setChild, setLive, setUpdateHandler, updateBoundscheckForCyclicChild, checkForCyclicParent, clearUpdateHandler, removeParent, setLive, setParent, setUpdateHandlerboundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBoundsdataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserDatapublic Billboard()
public Billboard(boolean pointMode)
pointMode - true if this should be rotating around a point in spacepublic void cullChildren(CullInstructions output, org.j3d.maths.vector.Matrix4d vworldTx, org.j3d.maths.vector.Matrix4d viewTransform, org.j3d.maths.vector.Vector4d[] frustumPlanes, float angularRes)
cullChildren in interface CustomCullableoutput - Fill in the child information herevworldTx - The transformation from the root of the scene to
this node according to the current traversal pathviewTransform - The transformation from the root of the scene
graph to the active viewpointfrustumPlanes - Listing of frustum planes in the order: right,
left, bottom, top, far, nearangularRes - Angular resolution of the screen, or 0 if not
calculable from the available data.public void pickChildren(PickInstructions output, org.j3d.maths.vector.Matrix4d vworldTx, PickRequest req)
pickChildren in interface CustomPickTargetoutput - Fill in the picking results herevworldTx - The transformation from the root of the scene to this node
according to the current traversal pathreq - The details of the picking request that are to be processedpublic boolean checkPickMask(int mask)
checkPickMask in interface PickTargetmask - The bit mask to check againstpublic BoundingVolume getPickableBounds()
getPickableBounds in interface PickTargetpublic int getPickTargetType()
getPickTargetType in interface PickTargetpublic void setPickMask(int state)
setPickMask in interface PickableObjectstate - A bit mask of available options to pick forpublic int getPickMask()
getPickMask in interface PickableObjectpublic void pickBatch(PickRequest[] reqs, int numRequests) throws NotPickableException, InvalidPickTimingException
pickBatch in interface PickableObjectreqs - The list of picks to be made, starting at this objectnumRequests - The number of valid pick requests to processNotPickableException - This object has been marked as non pickable,
but you decided to try to call the method anywayInvalidPickTimingException - An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodpublic void pickSingle(PickRequest req) throws NotPickableException, InvalidPickTimingException
pickSingle in interface PickableObjectreq - The details of the pick to be madeNotPickableException - This object has been marked as non pickable,
but you decided to try to call the method anywayInvalidPickTimingException - An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodprotected void recomputeBounds()
recomputeBounds in class BaseGrouppublic boolean isPointMode()
public void setAxisOfRotation(float[] axis)
axis - An array containing the 3 axis coordinatespublic void getAxisOfRotation(float[] axis)
axis - An array of at least length 3 to copy the rotation axis into
Copyright © 2001 - 2015 j3d.org