#include <CameraBoundElement.h>
Public Member Functions | |
CameraBoundElement () | |
virtual | ~CameraBoundElement () |
virtual void | notifyCameraChanged (Ogre::Camera *cam)=0 |
void | forceFarRadius (Ogre::Real radius) |
bool | getAutoRadius () const |
Static Public Attributes | |
static const Ogre::Real | CAMERA_FAR_DISTANCE_MULTIPLIER = 0.99 |
static const Ogre::Real | CAMERA_NEAR_DISTANCE_MULTIPLIER = 50 |
Protected Member Functions | |
virtual void | setFarRadius (Ogre::Real radius) |
This should be used as a base class for domes which follow the camera.
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.
Definition at line 36 of file CameraBoundElement.h.
caelum::CameraBoundElement::CameraBoundElement | ( | ) |
Constructor. Sets auto radius to true.
Definition at line 29 of file CameraBoundElement.cpp.
virtual caelum::CameraBoundElement::~CameraBoundElement | ( | ) | [inline, virtual] |
Virtual Destructor.
Definition at line 50 of file CameraBoundElement.h.
void caelum::CameraBoundElement::notifyCameraChanged | ( | Ogre::Camera * | cam | ) | [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::GroundFog, caelum::ImageStarfield, caelum::LayeredClouds, caelum::Moon, caelum::PointStarfield, caelum::SkyDome, caelum::SphereSun, and caelum::SpriteSun.
Definition at line 32 of file CameraBoundElement.cpp.
References CAMERA_FAR_DISTANCE_MULTIPLIER, CAMERA_NEAR_DISTANCE_MULTIPLIER, and setFarRadius().
Referenced by caelum::SpriteSun::notifyCameraChanged(), caelum::SphereSun::notifyCameraChanged(), caelum::SkyDome::notifyCameraChanged(), caelum::PointStarfield::notifyCameraChanged(), caelum::Moon::notifyCameraChanged(), caelum::LayeredClouds::notifyCameraChanged(), caelum::ImageStarfield::notifyCameraChanged(), caelum::GroundFog::notifyCameraChanged(), and caelum::CaelumSystem::preViewportUpdate().
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. |
Definition at line 42 of file CameraBoundElement.cpp.
References setFarRadius().
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.
Definition at line 51 of file CameraBoundElement.cpp.
void caelum::CameraBoundElement::setFarRadius | ( | Ogre::Real | radius | ) | [protected, virtual] |
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::GroundFog, caelum::ImageStarfield, caelum::LayeredClouds, caelum::PointStarfield, caelum::SkyDome, and caelum::BaseSkyLight.
Definition at line 55 of file CameraBoundElement.cpp.
Referenced by forceFarRadius(), notifyCameraChanged(), caelum::BaseSkyLight::setFarRadius(), caelum::SkyDome::setFarRadius(), caelum::PointStarfield::setFarRadius(), caelum::LayeredClouds::setFarRadius(), caelum::ImageStarfield::setFarRadius(), and caelum::GroundFog::setFarRadius().
const Ogre::Real caelum::CameraBoundElement::CAMERA_FAR_DISTANCE_MULTIPLIER = 0.99 [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.
Definition at line 83 of file CameraBoundElement.h.
Referenced by notifyCameraChanged().
const Ogre::Real caelum::CameraBoundElement::CAMERA_NEAR_DISTANCE_MULTIPLIER = 50 [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.
Definition at line 89 of file CameraBoundElement.h.
Referenced by notifyCameraChanged().