H3D::LOD Class Reference
[X3D node classes.]

The LOD node specifies various levels of detail or complexity for a given object, and provides hints allowing browsers to automatically choose the appropriate version of the object based on the distance from the user. More...

#include <H3D/LOD.h>

Inheritance diagram for H3D::LOD:

Inheritance graph

List of all members.

Public Member Functions

 LOD (Inst< MFChild > _addChildren=0, Inst< MFChild > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFInt32 > _level_changed=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFVec3f > _center=0, Inst< SFBool > _forceTransitions=0, Inst< MFFloat > _range=0)
 Constructor.
virtual void render ()
 Render the children.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.

Public Attributes

auto_ptr< SFInt32level_changed
 The LOD node generates a level_changed event with value i where the value of i identifies which level was activated for display.
auto_ptr< SFVec3fcenter
 The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations.
auto_ptr< SFBoolforceTransitions
 The forceTransitions field specifies whether browsers are allowed to disregard level distances in order to provide better performance.
auto_ptr< MFFloatrange
 The range field specifies the ideal distances at which to switch between the levels.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The LOD node specifies various levels of detail or complexity for a given object, and provides hints allowing browsers to automatically choose the appropriate version of the object based on the distance from the user.

The children field contains a list of nodes that represent the same object or objects at varying levels of detail, ordered from highest level of detail to the lowest level of detail.

The range field specifies the ideal distances at which to switch between the levels. The forceTransitions field specifies whether browsers are allowed to disregard level distances in order to provide better performance. A forceTransitions value of TRUE specifies that every transition should be performed regardless of any internal optimizations that might be available. A forceTransitions value of FALSE specifies that browsers are allowed to disregard level distances in order to provide better performance.

The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations.

The number of nodes in the children field shall exceed the number of values in the range field by one (i.e., N+1 children nodes for N range values). The range field contains monotonic increasing values that shall be greater than zero. In order to calculate which level to display, first the distance is calculated from the viewer's location, transformed into the local coordinate system of the LOD node (including any scaling transformations), to the center point of the LOD node. Then, the LOD node evaluates the step function L(d) to choose a level for a given value of d (where d is the distance from the viewer position to the centre of the LOD node).


Member Function Documentation

void LOD::traverseSG ( TraverseInfo ti  )  [virtual]

Traverse the scenegraph.

Calculates distance to viewer and decides which level in the LOD should be used for rendering.

Parameters:
ti The TraverseInfo object containing information about the traversal.

Reimplemented from H3D::MatrixTransform.

References H3D::X3DViewpointNode::accForwardMatrix, center, H3D::X3DGroupingNode::children, forceTransitions, H3D::TraverseInfo::getAccInverseMatrix(), H3D::X3DViewpointNode::getActive(), range, and H3D::X3DViewpointNode::totalPosition.


Member Data Documentation

The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations.

Default value: SFVec3f = 0 0 0

LOD_center.dot

Referenced by traverseSG().

The forceTransitions field specifies whether browsers are allowed to disregard level distances in order to provide better performance.

Default value: SFBool = FALSE

LOD_forceTransitions.dot

Referenced by traverseSG().

The LOD node generates a level_changed event with value i where the value of i identifies which level was activated for display.

Access type: outputOnly
Default value: SFInt32 = 0

LOD_level_changed.dot

auto_ptr< MFFloat > H3D::LOD::range

The range field specifies the ideal distances at which to switch between the levels.

Each value in the range field shall be greater than the previous value.

LOD_range.dot

Referenced by traverseSG().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:30:33 2008 for H3D API by  doxygen 1.5.7