This class defines a distance-based LOD behavior node that operates on a Switch group node to select one of the children of that Switch node based on the distance of this LOD node from the viewer. An array of
n monotonically increasing distance values is specified, such that distances[0] is associated with the highest level of detail and distances[
n-1] is associated with the lowest level of detail. Based on the actual distance from the viewer to this DistanceLOD node, these
n distance values [0,
n-1] select from among
n+1 levels of detail [0,
n]. If
d is the distance from the viewer to the LOD node, then the equation for determining which level of detail (child of the Switch node) is selected is:
0, if d <= distances[0]
i, if distances[i-1] < d <= distances[i]
n, if d > distances[n-1]
Note that both the position and the array of distances are specified in the local coordinate system of this node.