Logo Search packages:      
Sourcecode: 3depict version File versions  Download package

CameraPerspective Class Reference

#include <cameras.h>

Inheritance diagram for CameraPerspective:

Camera CameraPerspLookAt

List of all members.


Detailed Description

A class for a perspective "point and view" camera.

Class employes a standard viewing frustrum method using glFrustrum

Definition at line 165 of file cameras.h.


Public Member Functions

virtual void apply (float outputRatio, const BoundCube &b, bool loadIdentity, float leftRestrict, float rightRestrict, float bottomRestrict, float topRestrict) const
 Apply, restricting viewport to subresgion.
void apply (float outAspect, const BoundCube &boundCube, bool loadIdentity=true) const
 Applies the camera transforms to world.
 CameraPerspective ()
 Constructor.
Cameraclone () const
 clone function
virtual void ensureVisible (const BoundCube &b, unsigned int face=3)
 Ensure that the box is visible.
virtual void forwardsDolly (float dollyAmount)
 Do a forwards "dolly",where the camera moves along its viewing axis.
float getFarPlane () const
 get the camera's near clipping plane
float getFOV () const
 Get the camera's FOV angle (full angle across).
float getNearPlane () const
 get the camera's near clipping plane
Point3D getOrigin () const
 Return the origin of the camera.
void getProperties (CameraProperties &p) const
 Return the user-settable properties of the camera.
Point3D getUpDirection () const
 Return the up direction for the camera.
std::string getUserString () const
 Get the user string.
Point3D getViewDirection () const
 Return the view direction for the camera.
virtual void move (float leftRightAmount, float UpDownAmount)
 Move the camera origin.
virtual void pivot (float rollAroundAcross, float rollaroundUp)
 pivot the camera
bool readState (xmlNodePtr nodePtr)
 Read the state of the camera.
void recomputeUpDirection ()
 Ensure that up direction is perpendicular to view direction.
virtual void roll (float roll)
 Roll around the view direction.
void setFOV (float newFov)
 Set the camera's FOV angle.
void setNearPlane (float f)
 Set the camera's near clipping plane.
virtual void setOrigin (const Point3D &)
 Set the camera's position.
bool setProperty (unsigned int key, const std::string &value)
 Set the camera property from a key & string pair.
void setUpDirection (const Point3D &)
 set the direction that the camera considers "up"
void setUserString (const std::string &newString)
 Set the user string.
void setViewDirection (const Point3D &)
 set the direction that the camera looks towards
virtual void translate (float leftRightAmount, float UpDownAmount)
 Move the camera origin.
unsigned int type () const
bool writeState (std::ostream &f, unsigned int format, unsigned int tabs=0) const
 Write the state of the camera.
virtual ~CameraPerspective ()
 Destructor.

Protected Member Functions

void doPerspCalcs (float aspect, const BoundCube &bc, bool loadIdentity, float left, float top) const
void doPerspCalcs (float aspect, const BoundCube &bc, bool loadIdentity) const
 Do the perspective calculations.

Protected Attributes

float farPlane
 Far plane is computed on-the-fly. cannot be set directly. Oh no! mutable. gross!
float fovAngle
 Perspective FOV.
float nearPlane
 Near clipping plane distance.
Point3D origin
 Camera location.
unsigned int typeNum
 Type number.
Point3D upDirection
 Up direction for camera (required to work out "roll").
std::string userString
 user string, e.g. camera name
Point3D viewDirection
 Direction camera is looking in.

Friends

std::ostream & operator<< (std::ostream &stream, const Camera &)
 Streaming output operator, presents human readable text.
std::ostream & operator<< (std::ostream &stream, const CameraPerspective &)
 Streaming output operator, presents human readable text.

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

Generated by  Doxygen 1.6.0   Back to index