Caelum
0.6.4
|
A camera-bound element. More...
#include <CameraBoundElement.h>
Public Member Functions | |
CameraBoundElement () | |
Constructor. More... | |
virtual | ~CameraBoundElement () |
Virtual Destructor. | |
virtual void | notifyCameraChanged (Ogre::Camera *cam)=0 |
Notify new camera conditions. More... | |
void | forceFarRadius (Ogre::Real radius) |
Forces the "far" size of the element to a specific radius. More... | |
bool | getAutoRadius () const |
Checks if this element is in auto-radius mode. More... | |
void | setAutoRadius () |
Re-enable auto-radius; if disabled. More... | |
Static Public Attributes | |
static const Ogre::Real | CAMERA_FAR_DISTANCE_MULTIPLIER |
Camera distances multiplier for the far clipping distance. More... | |
static const Ogre::Real | CAMERA_NEAR_DISTANCE_MULTIPLIER |
Camera distances multiplier for the near clipping distance. More... | |
Protected Member Functions | |
virtual void | setFarRadius (Ogre::Real radius) |
Abstract method to set the radius for this elements Derived classes should override this and resize their domes. More... | |
A camera-bound element.
This should be used as a base class for domes which follow the camera. It is only meant to be used inside Caelum.
By default this class work in autoradius mode; where it automatically resizes itself for camera near/far clipping radius. It will correctly handle infinite far clip planes.
This is meant to be used with depth_check and depth_write off. Trying to place an object "as far as possible" causes precision troubles; and was removed in version 0.4.
If far clip distance is finite the radius will be (near + far) / 2. If far clip distance is infinite (0) the radius will be 10 * near/
Caelum::CameraBoundElement::CameraBoundElement | ( | ) |
Constructor.
Sets auto radius to true.
|
pure virtual |
Notify new camera conditions.
This method notifies that a new camera is about to be used, so this element can follow it or perform other operations. The default implementation calls setRadius if in autoRadius mode.
cam | The new camera. |
Implemented in Caelum::SpriteSun, Caelum::SphereSun, Caelum::SkyDome, Caelum::PointStarfield, Caelum::Moon, Caelum::ImageStarfield, and Caelum::GroundFog.
void Caelum::CameraBoundElement::forceFarRadius | ( | Ogre::Real | radius | ) |
Forces the "far" size of the element to a specific radius.
If greater than zero this disables AutoRadius mode and forces a fixed radius. If this is negative or zero the radius is set automatically in notifyCameraChanged.
AutoRadius is turned on by default.
radius | The positive radius of the element, or a negative/zero value for AutoRadius mode. |
bool Caelum::CameraBoundElement::getAutoRadius | ( | ) | const |
Checks if this element is in auto-radius mode.
While in autoradius mode the element is automatically resized fit between the near and far radius.
void Caelum::CameraBoundElement::setAutoRadius | ( | ) |
Re-enable auto-radius; if disabled.
Auto-radius is on by default; but can be disabled. This function can turn it back on.
|
protectedvirtual |
Abstract method to set the radius for this elements Derived classes should override this and resize their domes.
The actual radius for the dome is controlled in the base class.
Reimplemented in Caelum::BaseSkyLight, Caelum::SkyDome, Caelum::PointStarfield, Caelum::ImageStarfield, and Caelum::GroundFog.
|
static |
Camera distances multiplier for the far clipping distance.
This threshold will be multiplied with the far clipping distance, if the camera doesn't use an infinite far clipping plane.
|
static |
Camera distances multiplier for the near clipping distance.
This threshold will be multiplied with the near clipping distance, if the camera does use an infinite far clipping plane.