CameraLodSelector Class Reference

This class assigns the levels of detail based on the distance of the VolumeBricks to the current camera position. More...

#include <cameralodselector.h>

Inheritance diagram for CameraLodSelector:
BrickLodSelector

List of all members.

Public Member Functions

 CameraLodSelector (BrickingInformation &brickingInformation)
virtual void selectLods ()
 Assigns a level of detail to all VolumeBricks in the brickingInformation_.volumeBricks vector, based on their distance to the camera position and whether or not they are in a BrickingRegion.

Protected Member Functions

bool checkAssignPriority (Brick *brick)
 Checks if the brick has already been assigned a level of detail.

Protected Attributes

std::multimap< float, int > distanceMap_
 A map holding the distances of every brick to the camera position.
std::set< float > distanceSet_
 A set holding the distances of all bricks to the camera position.
std::vector< Brick * > bricksWithoutLod_
 Vector containing all bricks that haven't been assigned a level of detail yet.

Detailed Description

This class assigns the levels of detail based on the distance of the VolumeBricks to the current camera position.

The farther away the bricks are, the lower their resolution will be. BrickingRegions are also taken into account. The bricks in the region with the highest priority will be assigned a level of detail first, meaning that region priority is more important than camera distance. The available resolutions that this class can assign must be determined by a BrickResolutionCalculator before.

Definition at line 45 of file cameralodselector.h.


Member Function Documentation

bool checkAssignPriority ( Brick brick  )  [protected]

Checks if the brick has already been assigned a level of detail.

This can happen if a brick is in more than one region. The region with higher priority takes precedence.

Definition at line 165 of file cameralodselector.cpp.

void selectLods (  )  [virtual]

Assigns a level of detail to all VolumeBricks in the brickingInformation_.volumeBricks vector, based on their distance to the camera position and whether or not they are in a BrickingRegion.

First, all bricks inside the region with the highest priority are sorted based on their distance and are assigned a level of detail. This repeats until all regions have been passed, and after that, bricks outside the regions are sorted on their distance to the camera.

Implements BrickLodSelector.

Definition at line 42 of file cameralodselector.cpp.


Member Data Documentation

std::multimap<float, int> distanceMap_ [protected]

A map holding the distances of every brick to the camera position.

The float value is the distance, the int value the position of the brick in the brickingInformation_.volumeBricks vector.

Definition at line 76 of file cameralodselector.h.

std::set<float> distanceSet_ [protected]

A set holding the distances of all bricks to the camera position.

This set is then sorted and the smallest distances are looked up in the distanceMap_, thereby getting the bricks closest to the camera.

Definition at line 83 of file cameralodselector.h.