#include <LOD.h>
Inheritance diagram for nvsg::LOD:
Public Methods | |
virtual NVSG_API const LOD * | clone (void) const |
Get a clone of this LOD object. More... | |
NVSG_API void | setRanges (const float *ranges, size_t count) |
Set all range values. More... | |
NVSG_API const float * | getRanges (void) const |
Get all ranges. More... | |
NVSG_API size_t | getNumberOfRanges (void) const |
Get the number of ranges. More... | |
NVSG_API void | setCenter (const nvmath::Vec3f ¢er) |
Set the center. More... | |
NVSG_API const nvmath::Vec3f & | getCenter (void) const |
Determine the LOD to use. More... | |
NVSG_API size_t | getLODToUse (const nvmath::Mat44f &modelViewMatrix) const |
Static Public Methods | |
NVSG_API const LOD * | create (void) |
Create a LOD. More... | |
NVSG_API const LOD * | createFromBase (const Group &rhs) |
Create a LOD by copying from a Group. More... | |
Protected Methods | |
NVSG_API | LOD (void) |
Default Constructor. More... | |
NVSG_API | LOD (const Group &rhs) |
Partial Constructor. More... | |
NVSG_API | LOD (const LOD &rhs) |
Copy Constructor. More... | |
virtual NVSG_API | ~LOD (void) |
Prohibit explicit creation on stack by making the destructor protected. More... |
This class is a special kind of a group containing different representations of the same object as well as some range information. The representations include different levels of detail, meaning that the first child is the best and most precise representation of the object, the second child is of lower resolution, and so on. The current implementation determines the distance between the camera and the given center point of the object (dist). The distance is compared against the ranges and the corresponding range defines the LOD representation to use.
It works like this:
IF (dist < ranges[0]) THEN activeChild = 0 ELSE IF (ranges[i-1] < dist < ranges[i]) THEN activeChild = i ELSE IF (dist > ranges[LASTRANGE]) THEN activeChild = LASTRANGE+1
|
Default Constructor.
|
|
Partial Constructor.
|
|
Copy Constructor.
|
|
Prohibit explicit creation on stack by making the destructor protected.
|
|
Create a LOD.
Reimplemented from nvsg::Group. |
|
Create a LOD by copying from a Group.
|
|
Get a clone of this
Reimplemented from nvsg::Group. |
|
Set all range values.
|
|
Get all ranges.
|
|
Get the number of ranges.
|
|
Set the center. The center is the point used for finding the exact level of detail by calculating its distance to the camera.
|
|
Determine the LOD to use.
|
|
This method is called by the ModelViewTraverser. It calculates the distance between the center point and the camera.
|