fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Misc / OSGDistanceLOD.fcd
blobfca741a7c0ee86a5d9ec29c0594edb89c1f9f5b5
1 <?xml version="1.0"?>
3 <FieldContainer
4 name="DistanceLOD"
5 parent="Group"
6 library="Group"
7 pointerfieldtypes="none"
8 structure="concrete"
9 systemcomponent="true"
10 parentsystemcomponent="true"
11 isNodeCore="true"
12 docGroupBase="GrpGroupMisc"
13 ><![CDATA[
14 This Node manages the different levels of detail available for a Geometry
15 and decides which one should be rendered, according to the distance from the
16 current camera. The details of the selection process are taken from VRML97
17 standard.
19 The node chooses which child to render based on the range values in the Range
20 multi-field and the current distance of the camera from the object.
21 The children should be ordered from the highest level of detail to the
22 lowest level of detail. The range values specify the distances at which to
23 switch between the different children.
25 The center field is a translation offset in the local coordinate system that
26 specifies the center of the object for distance calculations. In order to
27 calculate which level to display, first the distance from the
28 viewpoint to the center point of the LOD node (with corresponding
29 transformations) is computed. If the distance is less than the first range
30 value, then the first LOD is drawn. If it is between the first and the second
31 values, then the second LOD is drawn, and so on.
33 \example Setting up a OSG::DistanceLOD
35 Here is an example of setting up an lod core with a center and a range.
36 You would also need to add children for the 4 LODs.
38 \code
39 DistanceLOD lod = DistanceLOD::create();
41 // this is supposed to be the center of the LOD model,
42 // that is, this is the point the distance is measured from
43 lod->setCenter(12,1,5);
44 // now we add the distances when models will change
45 lod->editMFRange()->push_back(6.0);
46 lod->editMFRange()->push_back(12.0);
47 lod->editMFRange()->push_back(24.0);
48 \endcode
49 \endexample]]>
50 <Field
51 name="center"
52 type="Pnt3f"
53 cardinality="single"
54 visibility="external"
55 access="public"
57 The center for distance calculation.
58 </Field>
59 <Field
60 name="range"
61 type="Real32"
62 cardinality="multi"
63 visibility="external"
64 access="public"
66 The range intervals.
67 </Field>
68 </FieldContainer>