Class dnx.lr.node.LODNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.LODNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.GroupingNode
                           |
                           +----dnx.lr.SwitchingNode
                                   |
                                   +----dnx.lr.node.LODNode

public class LODNode
extends SwitchingNode
 LOD {
    exposedField MFNode       level           []
    field        SFVec3f      center          0 0 0
    field        MFFloat      range           []
 }

The LOD node specifies various levels of detail or complexity for a given object, and provides hints for browsers to automatically choose the appropriate version of the object based on the distance from the user. The level field contains a list of nodes that represent the same object or objects at varying levels of detail, from highest to the lowest level of detail, and the range field specifies the ideal distances at which to switch between the levels. See the "Concepts - Grouping and Children Nodes" section for a details on the types of nodes that are legal values for level.

The center field is a translation offset in the local coordinate system that specifies the center of the LOD object for distance calculations. In order to calculate which level to display, first the distance is calculated from the viewpoint, transformed into the local coordinate space of the LOD node, (including any scaling transformations), to the center point of the LOD. If the distance is less than the first value in the range field, then the first level of the LOD is drawn. If between the first and second values in the range field, the second level is drawn, and so on.

If there are N values in the range field, the LOD shall have N+1 nodes in its level field. Specifying too few levels will result in the last level being used repeatedly for the lowest levels of detail; if more levels than ranges are specified, the extra levels will be ignored. The exception to this rule is to leave the range field empty, which is a hint to the browser that it should choose a level automatically to maintain a constant display rate. Each value in the range field should be greater than the previous value; otherwise results are undefined.

Authors should set LOD ranges so that the transitions from one level of detail to the next are smooth. Browsers may adjust which level of detail is displayed to maintain interactive frame rates, to display an already-fetched level of detail while a higher level of detail (contained in an Inline node) is fetched, or might disregard the author-specified ranges for any other implementation-dependent reason. For best results, specify ranges only where necessary, and nest LOD nodes with and without ranges. Browsers should try to honor the hints given by authors, and authors should try to give browsers as much freedom as they can to choose levels of detail based on performance.

LOD nodes are evaluated top-down in the scene graph. Only the descendants of the currently selected level are rendered. Note that all nodes under an LOD node continue to receive and send events (i.e. routes) regardless of which LOD level is active. For example, if an active TimeSensor is contained within an inactive level of an LOD, the TimeSensor sends events regardless of the LOD's state.


Variable Index

 o center
 o level
 o range

Constructor Index

 o LODNode()

Method Index

 o boundingBoxHasChanged(Field)
Meant to be overridden by subclasses.
 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getChildren()
 o getSubtreePropertyNodes(Camera, Matrix4)
Return the list of subtree property nodes in the children of this node, only including those along the traversal path that would be traversed if CAM were the current camera and OBJECTTOVIEWERMATRIX the object-to-viewer matrix of this node.
 o getSwitchedInNode(Camera, Matrix4)
 o initFields()
Initialize field values.
 o mapTraversalPathInstanceChildren(NodeInstance, ChildInstanceMapper, Camera, Matrix4, Object)
 o mapTraversalPathNodeChildren(ChildNodeMapper, Camera, Matrix4, Object)
 o pushSubtreeProperties(SubtreePropertyTraversal)
This method is called by traversals when they visit the node.
 o recomputeBoundingBox(BoundingBox3)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
 o updateSubtreePropertyNodes(MFNode)
Update the list of subtree property nodes in the children of this node.

Variables

 o level
  public MFNode level
 o center
  public SFVec3f center
 o range
  public MFFloat range

Constructors

 o LODNode
  public LODNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o getChildren
  public MFNode getChildren()
Overrides:
getChildren in class GroupingNode
 o getSwitchedInNode
  public synchronized int getSwitchedInNode(Camera cam,
                                            Matrix4 objectToViewerMatrix)
 o mapTraversalPathNodeChildren
  public boolean mapTraversalPathNodeChildren(ChildNodeMapper fun,
                                              Camera cam,
                                              Matrix4 objectToViewerMatrix,
                                              Object mapData)
Overrides:
mapTraversalPathNodeChildren in class Node
 o mapTraversalPathInstanceChildren
  public NodeInstance mapTraversalPathInstanceChildren(NodeInstance inst,
                                                       ChildInstanceMapper fun,
                                                       Camera cam,
                                                       Matrix4 objectToViewerMatrix,
                                                       Object mapData)
Overrides:
mapTraversalPathInstanceChildren in class Node
 o pushSubtreeProperties
  public void pushSubtreeProperties(SubtreePropertyTraversal traversal)
This method is called by traversals when they visit the node.
Overrides:
pushSubtreeProperties in class GroupingNode
 o getSubtreePropertyNodes
  public NodeList getSubtreePropertyNodes(Camera cam,
                                          Matrix4 objectToViewerMatrix)
Return the list of subtree property nodes in the children of this node, only including those along the traversal path that would be traversed if CAM were the current camera and OBJECTTOVIEWERMATRIX the object-to-viewer matrix of this node.
Overrides:
getSubtreePropertyNodes in class GroupingNode
 o updateSubtreePropertyNodes
  protected void updateSubtreePropertyNodes(MFNode children)
Update the list of subtree property nodes in the children of this node.
Overrides:
updateSubtreePropertyNodes in class GroupingNode
 o recomputeBoundingBox
  public void recomputeBoundingBox(BoundingBox3 box)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
Overrides:
recomputeBoundingBox in class Node
 o boundingBoxHasChanged
  protected boolean boundingBoxHasChanged(Field f)
Meant to be overridden by subclasses.
Overrides:
boundingBoxHasChanged in class Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index