Logo Search packages:      
Sourcecode: ogre version File versions

Ogre::Camera Class Reference

#include <OgreCamera.h>

Inheritance diagram for Ogre::Camera:

Ogre::Frustum Ogre::MovableObject Ogre::Renderable Ogre::ShadowCaster Ogre::AnimableObject Ogre::OctreeCamera

List of all members.

Detailed Description

A viewpoint from which the scene will be rendered.
OGRE renders scenes from a camera viewpoint into a buffer of some sort, normally a window or a texture (a subclass of RenderTarget). OGRE cameras support both perspective projection (the default, meaning objects get smaller the further away they are) and orthographic projection (blueprint-style, no decrease in size with distance). Each camera carries with it a style of rendering, e.g. full textured, flat shaded, wireframe), field of view, rendering distances etc, allowing you to use OGRE to create complex multi-window views if required. In addition, more than one camera can point at a single render target if required, each rendering to a subset of the target, allowing split screen and picture-in-picture views.
Cameras maintain their own aspect ratios, field of view, and frustrum, and project co-ordinates into a space measured from -1 to 1 in x and y, and 0 to 1 in z. At render time, the camera will be rendering to a Viewport which will translate these parametric co-ordinates into real screen co-ordinates. Obviously it is advisable that the viewport has the same aspect ratio as the camera to avoid distortion (unless you want it!).
Note that a Camera can be attached to a SceneNode, using the method SceneNode::attachObject. If this is done the Camera will combine it's own position/orientation settings with it's parent SceneNode. This is useful for implementing more complex Camera / object relationships i.e. having a camera attached to a world object.

Definition at line 80 of file OgreCamera.h.

Public Types

typedef std::vector
< ShadowRenderable * > 
typedef VectorIterator
< ShadowRenderableList > 

Public Member Functions

void _autoTrack (void)
virtual MovableObjectFactory_getCreator (void) const
Real _getLodBiasInverse (void) const
virtual SceneManager_getManager (void) const
unsigned int _getNumRenderedBatches (void) const
unsigned int _getNumRenderedFaces (void) const
virtual const Matrix4_getParentNodeFullTransform (void) const
 return the full transformation of the parent sceneNode or the attachingPoint node
virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
virtual void _notifyCreator (MovableObjectFactory *fact)
void _notifyCurrentCamera (Camera *cam)
virtual void _notifyManager (SceneManager *man)
virtual void _notifyMoved (void)
void _notifyRenderedBatches (unsigned int numbatches)
void _notifyRenderedFaces (unsigned int numfaces)
void _notifyViewport (Viewport *viewport)
void _renderScene (Viewport *vp, bool includeOverlays)
virtual void _updateCustomGpuParameter (const GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params) const
void _updateRenderQueue (RenderQueue *queue)
virtual void addQueryFlags (uint32 flags)
virtual void addVisibilityFlags (uint32 flags)
 Camera (const String &name, SceneManager *sm)
virtual AnimableValuePtr createAnimableValue (const String &valueName)
virtual void disableCustomNearClipPlane (void)
virtual void disableReflection (void)
virtual void enableCustomNearClipPlane (const Plane &plane)
virtual void enableCustomNearClipPlane (const MovablePlane *plane)
virtual void enableReflection (const MovablePlane *p)
virtual void enableReflection (const Plane &p)
virtual void forwardIntersect (const Plane &worldPlane, std::vector< Vector4 > *intersect3d) const
const StringVector & getAnimableValueNames (void) const
virtual Real getAspectRatio (void) const
bool getAutoAspectRatio (void) const
const Vector3getAutoTrackOffset (void) const
SceneNodegetAutoTrackTarget (void) const
const AxisAlignedBoxgetBoundingBox (void) const
Real getBoundingRadius (void) const
Ray getCameraToViewportRay (Real screenx, Real screeny) const
bool getCastShadows (void) const
virtual bool getCastsShadows (void) const
virtual const PlaneList & getClipPlanes () const
FrustumgetCullingFrustum (void)
const Vector4getCustomParameter (size_t index) const
const AxisAlignedBoxgetDarkCapBounds (const Light &light, Real dirLightExtrusionDist) const
Vector3 getDerivedDirection (void) const
const QuaterniongetDerivedOrientation (void) const
const Vector3getDerivedPosition (void) const
Vector3 getDerivedRight (void) const
Vector3 getDerivedUp (void) const
Vector3 getDirection (void) const
EdgeDatagetEdgeList (void)
 Define a default implementation of method from ShadowCaster which implements no shadows.
Real getFarClipDistance (void) const
virtual Real getFocalLength () const
virtual const RadiangetFOVy (void) const
virtual const Vector2getFrustumOffset () const
const PlanegetFrustumPlane (unsigned short plane) const
virtual const PlanegetFrustumPlanes (void) const
const AxisAlignedBoxgetLightCapBounds (void) const
const LightList & getLights (void) const
virtual ListenergetListener (void) const
Real getLodBias (void) const
const MaterialPtrgetMaterial (void) const
const String & getMovableType (void) const
virtual const String & getName (void) const
Real getNearClipDistance (void) const
virtual bool getNormaliseNormals (void) const
virtual unsigned short getNumWorldTransforms (void) const
const QuaterniongetOrientation (void) const
virtual NodegetParentNode (void) const
virtual SceneNodegetParentSceneNode (void) const
Real getPointExtrusionDistance (const Light *l) const
PolygonMode getPolygonMode (void) const
virtual bool getPolygonModeOverrideable (void) const
const Vector3getPosition (void) const
virtual const Matrix4getProjectionMatrix (void) const
virtual const Matrix4getProjectionMatrixRS (void) const
virtual const Matrix4getProjectionMatrixWithRSDepth (void) const
virtual ProjectionType getProjectionType (void) const
virtual uint32 getQueryFlags (void) const
 Returns the query flags relevant for this object.
Vector3 getRealDirection (void) const
const QuaterniongetRealOrientation (void) const
const Vector3getRealPosition (void) const
Vector3 getRealRight (void) const
Vector3 getRealUp (void) const
virtual const Matrix4getReflectionMatrix (void) const
 Returns the reflection matrix of the frustum if appropriate.
virtual const PlanegetReflectionPlane (void) const
 Returns the reflection plane of the frustum if appropriate.
virtual Real getRenderingDistance (void) const
void getRenderOperation (RenderOperation &op)
virtual uint8 getRenderQueueGroup (void) const
Vector3 getRight (void) const
SceneManagergetSceneManager (void) const
ShadowRenderableListIterator getShadowVolumeRenderableIterator (ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, bool extrudeVertices, Real extrusionDist, unsigned long flags=0)
 Define a default implementation of method from ShadowCaster which implements no shadows.
Real getSquaredViewDepth (const Camera *cam) const
virtual TechniquegetTechnique (void) const
virtual uint32 getTypeFlags (void) const
Vector3 getUp (void) const
bool getUseIdentityProjection (void) const
bool getUseIdentityView (void) const
virtual const AnygetUserAny (void) const
virtual bool getUseRenderingDistance (void) const
virtual UserDefinedObjectgetUserObject (void)
const Matrix4getViewMatrix (bool ownFrustumOnly) const
const Matrix4getViewMatrix (void) const
ViewportgetViewport (void) const
virtual uint32 getVisibilityFlags (void) const
 Returns the visibility flags relevant for this object.
virtual bool getVisible (void) const
const std::vector< Plane > & getWindowPlanes (void) const
 Gets the window clip planes, only applicable if isWindowSet == true.
virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
virtual const SpheregetWorldBoundingSphere (bool derive=false) const
const QuaterniongetWorldOrientation (void) const
const Vector3getWorldPosition (void) const
const Vector3getWorldSpaceCorners (void) const
void getWorldTransforms (Matrix4 *xform) const
bool hasEdgeList (void)
 Define a default implementation of method from ShadowCaster which implements no shadows.
virtual bool isAttached (void) const
virtual bool isCustomNearClipPlaneEnabled (void) const
virtual bool isCustomProjectionMatrixEnabled (void) const
 Returns whether a custom projection matrix is in use.
virtual bool isCustomViewMatrixEnabled (void) const
 Returns whether a custom view matrix is in use.
virtual bool isInScene (void) const
virtual bool isReflected (void) const
 Returns whether this frustum is being reflected.
virtual bool isVisible (void) const
bool isVisible (const Vector3 &vert, FrustumPlane *culledBy=0) const
bool isVisible (const Sphere &bound, FrustumPlane *culledBy=0) const
bool isVisible (const AxisAlignedBox &bound, FrustumPlane *culledBy=0) const
virtual bool isWindowSet (void) const
 Returns if a viewport window is being used.
void lookAt (Real x, Real y, Real z)
void lookAt (const Vector3 &targetPoint)
void move (const Vector3 &vec)
void moveRelative (const Vector3 &vec)
void pitch (const Radian &angle)
bool projectSphere (const Sphere &sphere, Real *left, Real *top, Real *right, Real *bottom) const
virtual const LightList & queryLights (void) const
virtual void removeQueryFlags (unsigned long flags)
virtual void removeVisibilityFlags (uint32 flags)
virtual void resetWindow (void)
 Cancel view window.
void roll (const Radian &angle)
void rotate (const Quaternion &q)
void rotate (const Vector3 &axis, const Radian &angle)
virtual void setAspectRatio (Real ratio)
void setAutoAspectRatio (bool autoratio)
void setAutoTracking (bool enabled, SceneNode *target=0, const Vector3 &offset=Vector3::ZERO)
void setCastShadows (bool enabled)
void setCullingFrustum (Frustum *frustum)
void setCustomParameter (size_t index, const Vector4 &value)
virtual void setCustomProjectionMatrix (bool enable, const Matrix4 &projectionMatrix=Matrix4::IDENTITY)
virtual void setCustomViewMatrix (bool enable, const Matrix4 &viewMatrix=Matrix4::IDENTITY)
void setDirection (const Vector3 &vec)
void setDirection (Real x, Real y, Real z)
virtual void setFarClipDistance (Real farDist)
void setFixedYawAxis (bool useFixed, const Vector3 &fixedAxis=Vector3::UNIT_Y)
virtual void setFocalLength (Real focalLength=1.0)
virtual void setFOVy (const Radian &fovy)
virtual void setFrustumOffset (Real horizontal=0.0, Real vertical=0.0)
virtual void setFrustumOffset (const Vector2 &offset)
virtual void setListener (Listener *listener)
void setLodBias (Real factor=1.0)
virtual void setNearClipDistance (Real nearDist)
void setOrientation (const Quaternion &q)
void setPolygonMode (PolygonMode sd)
virtual void setPolygonModeOverrideable (bool override)
void setPosition (const Vector3 &vec)
void setPosition (Real x, Real y, Real z)
virtual void setProjectionType (ProjectionType pt)
virtual void setQueryFlags (uint32 flags)
virtual void setRenderingDistance (Real dist)
virtual void setRenderQueueGroup (uint8 queueID)
void setUseIdentityProjection (bool useIdentityProjection)
void setUseIdentityView (bool useIdentityView)
virtual void setUserAny (const Any &anything)
virtual void setUseRenderingDistance (bool use)
virtual void setUserObject (UserDefinedObject *obj)
virtual void setVisibilityFlags (uint32 flags)
virtual void setVisible (bool visible)
virtual void setWindow (Real Left, Real Top, Real Right, Real Bottom)
void yaw (const Radian &angle)
virtual ~Camera ()

Static Public Member Functions

static void extrudeVertices (const HardwareVertexBufferSharedPtr &vertexBuffer, size_t originalVertexCount, const Vector4 &lightPos, Real extrudeDist)
static uint32 getDefaultQueryFlags ()
static uint32 getDefaultVisibilityFlags ()
static void setDefaultQueryFlags (uint32 flags)
static void setDefaultVisibilityFlags (uint32 flags)

Static Public Attributes

static const Real INFINITE_FAR_PLANE_ADJUST = 0.00001
 Small constant used to reduce far plane projection to avoid inaccuracies.

Protected Types

typedef std::map< String,
StringVector > 
typedef std::map< size_t, Vector4CustomParameterMap

Protected Member Functions

StringVector & _getAnimableValueNames (void)
 Get an updateable reference to animable value list.
virtual void calcProjectionParameters (Real &left, Real &right, Real &bottom, Real &top) const
void createAnimableDictionary (void) const
virtual void extrudeBounds (AxisAlignedBox &box, const Vector4 &lightPos, Real extrudeDist) const
virtual void generateShadowVolume (EdgeData *edgeData, const HardwareIndexBufferSharedPtr &indexBuffer, const Light *light, ShadowRenderableList &shadowRenderables, unsigned long flags)
virtual const String & getAnimableDictionaryName (void) const
Real getExtrusionDistance (const Vector3 &objectPos, const Light *light) const
 Helper moethod for calculating extrusion distance.
const QuaterniongetOrientationForViewUpdate (void) const
const Vector3getPositionForViewUpdate (void) const
virtual std::vector< Vector4getRayForwardIntersect (const Vector3 &anchor, const Vector3 *dir, Real planeOffset) const
virtual void initialiseAnimableDictionary (StringVector &) const
void invalidateFrustum (void) const
 Signal to update frustum information.
void invalidateView (void) const
 Signal to update view information.
virtual bool isFrustumOutOfDate (void) const
bool isViewOutOfDate (void) const
virtual void setWindowImpl (void) const
virtual void updateEdgeListLightFacing (EdgeData *edgeData, const Vector4 &lightPos)
virtual void updateFrustum (void) const
 Update frustum if out of date.
virtual void updateFrustumImpl (void) const
 Implementation of updateFrustum (called if out of date).
virtual void updateFrustumPlanes (void) const
virtual void updateFrustumPlanesImpl (void) const
 Implementation of updateFrustumPlanes (called if out of date).
virtual void updateVertexData (void) const
virtual void updateView (void) const
 Update view if out of date.
virtual void updateViewImpl (void) const
 Implementation of updateView (called if out of date).
virtual void updateWorldSpaceCorners (void) const
virtual void updateWorldSpaceCornersImpl (void) const
 Implementation of updateWorldSpaceCorners (called if out of date).

Protected Attributes

Real mAspect
 x/y viewport ratio - default 1.3333
bool mAutoAspectRatio
Vector3 mAutoTrackOffset
 Tracking offset for fine tuning.
 SceneNode which this Camera will automatically track.
bool mBeyondFarDistance
 Hidden because of distance?
AxisAlignedBox mBoundingBox
bool mCastShadows
 Does this object cast shadows?
 Creator of this object (if created by a factory).
 Custom culling frustum.
CustomParameterMap mCustomParameters
bool mCustomProjMatrix
 Are we using a custom projection matrix?
bool mCustomViewMatrix
 Are we using a custom view matrix?
Quaternion mDerivedOrientation
 Derived orientation/position of the camera, including reflection.
Vector3 mDerivedPosition
Real mFarDist
 Far clip distance - default 10000.
Real mFocalLength
 Focal length of frustum (for stereo rendering, defaults to 1.0).
Radian mFOVy
 y-direction field-of-view (default 45)
Vector2 mFrustumOffset
 Off-axis frustum center offset - default (0.0, 0.0).
Plane mFrustumPlanes [6]
 The 6 main clipping planes.
Plane mLastLinkedObliqueProjPlane
 Record of the last world-space oblique depth projection plane info used.
Plane mLastLinkedReflectionPlane
 Record of the last world-space reflection plane info used.
Quaternion mLastParentOrientation
 Stored versions of parent orientation / position.
Vector3 mLastParentPosition
 The last viewport to be added using this camera.
LightList mLightList
 List of lights for this object.
ulong mLightListUpdated
 The last frame that this light list was updated in.
const MovablePlanemLinkedObliqueProjPlane
 Pointer to oblique projection plane (automatically updated).
const MovablePlanemLinkedReflectPlane
 Pointer to a reflection plane (automatically updated).
 MovableObject listener - only one allowed (no list) for size & performance reasons. */.
 SceneManager holding this object (if applicable).
MaterialPtr mMaterial
String mName
 Camera name.
Real mNearDist
 Near clip distance - default 100.
bool mObliqueDepthProjection
 Is this frustum using an oblique depth projection?
Plane mObliqueProjPlane
 Fixed oblique projection plane.
Quaternion mOrientation
 Camera orientation, quaternion style.
bool mParentIsTagPoint
 node to which this object is attached
bool mPolygonModeOverrideable
Vector3 mPosition
 Camera position - default (0,0,0).
Matrix4 mProjMatrix
 Pre-calced standard projection matrix.
Matrix4 mProjMatrixRS
 Pre-calced projection matrix for the specific render system.
Matrix4 mProjMatrixRSDepth
 Pre-calced standard projection matrix but with render system depth range.
ProjectionType mProjType
 Orthographic or perspective?
uint32 mQueryFlags
 Flags determining whether this object is included / excluded from scene queries.
Quaternion mRealOrientation
 Real world orientation/position of the camera.
Vector3 mRealPosition
bool mRecalcFrustum
 Something's changed in the frustrum shape?
bool mRecalcFrustumPlanes
 Something re the frustum planes has changed.
bool mRecalcVertexData
 Something re the vertex data has changed.
bool mRecalcView
 Something re the view pos has changed.
bool mRecalcWindow
bool mRecalcWorldSpaceCorners
 Something re the world space corners has changed.
bool mReflect
 Is this frustum to act as a reflection of itself?
Matrix4 mReflectMatrix
 Derived reflection matrix.
Plane mReflectPlane
 Fixed reflection plane.
bool mRenderingDisabled
 Does rendering this object disabled by listener?
uint8 mRenderQueueID
 The render queue to use when rendering this object.
bool mRenderQueueIDSet
 Flags whether the RenderQueue's default should be used.
PolygonMode mSceneDetail
 Rendering type.
Real mSceneLodFactor
Real mSceneLodFactorInv
 Inverted scene LOD factor, can be used by Renderables to adjust their LOD.
 Scene manager responsible for the scene.
Real mSquaredUpperDistance
Real mUpperDistance
 Upper distance to still render.
bool mUseIdentityProjection
bool mUseIdentityView
Any mUserAny
 User defined link to another object / value / whatever.
bool mUseRenderingDistance
 Whether or not the rendering distance of objects should take effect for this camera.
VertexData mVertexData
Matrix4 mViewMatrix
 Pre-calced view matrix.
unsigned int mVisBatchesLastRender
 Stored number of visible faces in the last render.
unsigned int mVisFacesLastRender
 Stored number of visible faces in the last render.
uint32 mVisibilityFlags
 Flags determining whether this object is visible (compared to SceneManager mask).
bool mVisible
 Is this object visible?
Real mWBottom
std::vector< PlanemWindowClipPlanes
 Windowed viewport clip planes.
bool mWindowSet
 Is viewing window used.
Real mWLeft
AxisAlignedBox mWorldAABB
 Cached world AABB of this object.
Sphere mWorldBoundingSphere
AxisAlignedBox mWorldDarkCapBounds
 World space AABB of this object's dark cap.
Vector3 mWorldSpaceCorners [8]
Real mWRight
Real mWTop
bool mYawFixed
 Whether to yaw around a fixed axis.
Vector3 mYawFixedAxis
 Fixed axis to yaw around.

Static Protected Attributes

static AnimableDictionaryMap msAnimableDictionary
 Static map of class name to list of animable value names.
static uint32 msDefaultQueryFlags = 0xFFFFFFFF
 Default query flags.
static uint32 msDefaultVisibilityFlags = 0xFFFFFFFF
 Default visibility flags.
static const PlaneList msDummyPlaneList
static String msMovableType = "Camera"
 Shared class-level name for Movable type.


_OgreExport friend std::ostream & operator<< (std::ostream &o, const Camera &c)

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

Generated by  Doxygen 1.6.0   Back to index