caelum::CameraBoundElement Class Reference

#include <CameraBoundElement.h>

Inheritance diagram for caelum::CameraBoundElement:

caelum::BaseSkyLight caelum::GroundFog caelum::ImageStarfield caelum::LayeredClouds caelum::PointStarfield caelum::SkyDome caelum::Moon caelum::SphereSun caelum::SpriteSun

List of all members.

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)


Detailed Description

A camera-bound element.

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

void caelum::CameraBoundElement::notifyCameraChanged ( Ogre::Camera *  cam  )  [pure virtual]

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.

Parameters:
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().


Member Data Documentation

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().

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().


The documentation for this class was generated from the following files:

Generated on Fri Jul 11 09:24:53 2008 for Caelum by  doxygen 1.5.6