|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.BaseNode org.j3d.aviatrix3d.BaseGroup org.j3d.renderer.aviatrix3d.nodes.LODGroup
public class LODGroup
A grouping node structure that controls which children are being rendered based on distance from the user.
Each child of LODGroup should have a value. The value can be interpreted as measure of the the maximum distance between the child and the eye point for the child to be visible. If distanceMode is true the value is interpreted as the distance, if false (the default) the value is the size of characteristic details in the child. The distance is then computed automatically for when the characteristic details should become visible. The children should be added in a most detailed to least detailed order, with monothonically increasing values.
When in distance mode, a center offset can be applied. This allows you to have the LOD offset from the center of the geometry, if needed. If this is the default value, then the center of the combined bounds of all children is used to determine the range.
When setting up the node, you need to have one less range value than the number of children currently supplied. If not, then beyond the last set range value, we will automatically choose the last child as the one to be displayed.
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.BaseGroup |
---|
childList, dirtyBoundsCount, lastChild, wkVec1, wkVec2 |
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget |
---|
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject |
---|
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Constructor Summary | |
---|---|
LODGroup()
Create a new LOD implementation that uses distance as the determining visual factor. |
|
LODGroup(boolean distanceMode)
Construct a LOD group that is selectable whether is uses distance or smallest visual cue. |
Method Summary | |
---|---|
void |
addChild(Node newChild)
Appends the specified child node to this group node's list of children |
boolean |
checkPickMask(int mask)
Check the given pick mask against the node's internal pick mask representation. |
void |
cullChildren(CullInstructions output,
javax.vecmath.Matrix4f vworldTx,
javax.vecmath.Matrix4f viewTransform,
javax.vecmath.Vector4f[] frustumPlanes,
float angularRes)
Check this node for children to traverse. |
void |
getCenter(float[] center)
Get the current center location. |
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. |
float |
getRange(int idx)
Get the range set at the given child index. |
boolean |
isDistanceMode()
Find out which of the two modes are being used by this LOD. |
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,
javax.vecmath.Matrix4f vworldTx,
PickRequest request)
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. |
void |
removeAllChildren()
Removes all children from the group. |
void |
removeChild(int idx)
Remove the child at the specified index from the group. |
void |
setCenter(float[] center)
Set the center that the LOD would use to determine distance from when using distance mode. |
void |
setPickMask(int state)
Set the node as being pickable currently using the given bit mask. |
void |
setRange(int idx,
float value)
Set the range at the given child index. |
Methods inherited from class org.j3d.aviatrix3d.BaseGroup |
---|
checkForCyclicChild, getAllChildren, getChild, indexOfChild, markBoundsDirty, numChildren, recomputeBounds, removeChild, requestBoundsUpdate, setBounds, setChild, setLive, setUpdateHandler, updateBounds |
Methods inherited from class org.j3d.aviatrix3d.BaseNode |
---|
checkForCyclicChild, checkForCyclicParent, clearUpdateHandler, removeParent, setLive, setParent, setUpdateHandler |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LODGroup()
public LODGroup(boolean distanceMode)
distanceMode
- true if this should use user distance, false for
visual sizeMethod Detail |
---|
public void cullChildren(CullInstructions output, javax.vecmath.Matrix4f vworldTx, javax.vecmath.Matrix4f viewTransform, javax.vecmath.Vector4f[] frustumPlanes, float angularRes)
cullChildren
in interface CustomCullable
output
- 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, javax.vecmath.Matrix4f vworldTx, PickRequest request)
pickChildren
in interface CustomPickTarget
output
- Fill in the results of the picking evaluation herevworldTx
- The transformation from the root of the scene to
this node according to the current traversal pathrequest
- The picking request made of this objectpublic final int getPickTargetType()
getPickTargetType
in interface PickTarget
public boolean checkPickMask(int mask)
checkPickMask
in interface PickTarget
mask
- The bit mask to check against
public BoundingVolume getPickableBounds()
getPickableBounds
in interface PickTarget
public void setPickMask(int state)
setPickMask
in interface PickableObject
state
- A bit mask of available options to pick forpublic int getPickMask()
getPickMask
in interface PickableObject
public void pickBatch(PickRequest[] reqs, int numRequests) throws NotPickableException, InvalidPickTimingException
pickBatch
in interface PickableObject
reqs
- The list of picks to be made, starting at this objectnumRequests
- The number of valid pick requests to process
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anyway
InvalidPickTimingException
- An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodpublic void pickSingle(PickRequest req) throws NotPickableException, InvalidPickTimingException
pickSingle
in interface PickableObject
req
- The details of the pick to be made
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anyway
InvalidPickTimingException
- An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodpublic void addChild(Node newChild) throws AlreadyParentedException, InvalidWriteTimingException
addChild
in class BaseGroup
newChild
- The child to add
AlreadyParentedException
- There is a valid parent already set
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void removeChild(int idx) throws InvalidWriteTimingException
removeChild
in class BaseGroup
idx
- The index of the child to remove
IndexOfBoundsException
- When the idx is invalid
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void removeAllChildren() throws InvalidWriteTimingException
removeAllChildren
in class BaseGroup
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic float getRange(int idx)
idx
- The range index to get the value from
java.lang.IndexOutOfBoundsException
- The index is negative or past the
last childpublic void setRange(int idx, float value) throws InvalidWriteTimingException, java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
idx
- The range index to get the value from
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data callback method
java.lang.IndexOutOfBoundsException
- The index is negative or past the
last child
java.lang.IllegalArgumentException
- The value is not monotonically
increasingpublic void getCenter(float[] center)
center
- The array to copy the center value intopublic void setCenter(float[] center) throws InvalidWriteTimingException
center
- The value of the center to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data callback methodpublic boolean isDistanceMode()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |