| 1 |
NAME SoLevelOfDetail SoLvlOfDtl "" { |
| 2 |
level-of-detail switching group node |
| 3 |
} |
| 4 |
|
| 5 |
INCLUDE nodes/SoLevelOfDetail.h |
| 6 |
|
| 7 |
DESC { |
| 8 |
The children of this |
| 9 |
node typically represent the same object or objects at varying levels |
| 10 |
of detail, from highest detail to lowest. The size of the objects when |
| 11 |
projected into the viewport is used to determine which version to use |
| 12 |
(i.e., which child to traverse). |
| 13 |
\p |
| 14 |
The size is computed as the area of the screen rectangle enclosing the |
| 15 |
projection of the 3D bounding box that encloses all of the children. |
| 16 |
When rendering, this size is compared to the values in the |
| 17 |
\vscreenArea\. field. If the size is greater than the first value, |
| 18 |
child 0 is traversed. If it is smaller than the first, but greater |
| 19 |
than the second, child 1 is traversed, and so on. If there are fewer |
| 20 |
children than are required by this rule, the last child is traversed. |
| 21 |
The \vscreenArea\. field contains just 0 by default, so the first |
| 22 |
child is always traversed. |
| 23 |
\p |
| 24 |
The size calculation takes the current complexity into account. If the |
| 25 |
complexity is 0 or is of type \kBOUNDING_BOX\., the last child is |
| 26 |
always traversed. If the complexity is less than .5, the computed size |
| 27 |
is scaled down appropriately to use (possibly) a less detailed |
| 28 |
representation. If the complexity is greater than .5, the size is |
| 29 |
scaled up. At complexity 1, the first child is always used. |
| 30 |
\p |
| 31 |
Note that the \cSoLOD\. node is similar to \cSoLevelOfDetail\., except |
| 32 |
the switching between levels in the \cSoLOD\. node is based on |
| 33 |
distance from the camera, which is faster than using screen area. |
| 34 |
} |
| 35 |
|
| 36 |
FIELD screenArea { Areas to use for comparison } |
| 37 |
|
| 38 |
METHOD "" SoLevelOfDetail() { |
| 39 |
Creates a level-of-detail node with default settings. |
| 40 |
} |
| 41 |
|
| 42 |
METHOD "" static SoType getClassTypeId() { |
| 43 |
Returns type identifier for this class. |
| 44 |
} |
| 45 |
|
| 46 |
ACTION SoGLRenderAction, SoRayPickAction, SoCallbackAction { |
| 47 |
Only the child with the appropriate level of detail is traversed. |
| 48 |
} |
| 49 |
|
| 50 |
ACTION SoGetBoundingBoxAction { |
| 51 |
The box that encloses all children is computed. (This is the box that is |
| 52 |
needed to compute the projected size.) |
| 53 |
} |
| 54 |
|
| 55 |
ACTION others { |
| 56 |
All implemented as for \cSoGroup\.. |
| 57 |
} |
| 58 |
|
| 59 |
ALSO { SoLOD, SoComplexity, SoSwitch, SoGroup } |