#include <PerspectiveCamera.h>
Inherits Camera.
Inheritance diagram for PerspectiveCamera:
Public Member Functions | |
PerspectiveCamera (Vec3f pos, Vec3f dir, Vec3f up, float angle, int resX, int resY) | |
virtual | ~PerspectiveCamera () |
virtual Ray | initRay (float x, float y) |
void | setPos (Vec3f pos) |
void | setDir (Vec3f dir) |
void | setUp (Vec3f up) |
virtual const Vec3f & | dir () const |
const Vec3f & | up () const |
float | angle () const |
float | aspect () const |
int | depthSamples () const |
virtual const float | focusDistance () const |
virtual const float | aperture () const |
void | setDepthSamples (unsigned int) |
void | setFocusDistance (float) |
void | setAperture (float) |
void | setSlowCorrect () |
void | setFastIncorrect () |
Private Attributes | |
Vec3f | mDir |
View direction. | |
Vec3f | mUp |
Up direction. | |
float | mAngle |
Vertical opening angle in radian. | |
float | mFocus |
Focus length. | |
float | mAspect |
Aspect ratio x/y. | |
Vec3f | mXAxis |
Screen width. | |
Vec3f | mYAxis |
Screen height. |
Definition at line 15 of file PerspectiveCamera.h.
PerspectiveCamera::PerspectiveCamera | ( | Vec3f | pos, | |
Vec3f | dir, | |||
Vec3f | up, | |||
float | angle, | |||
int | resX, | |||
int | resY | |||
) | [inline] |
Constructor
pos | Position of the camera | |
dir | View direction | |
up | Up direction | |
angle | Vertical opening angle in degree | |
resX | X resolution | |
resY | Y resolution |
Definition at line 27 of file PerspectiveCamera.h.
References Vec3f::cross(), mAngle, mAspect, mDir, mFocus, mUp, mXAxis, mYAxis, Vec3f::normal(), and Vec3f::normalize().
virtual PerspectiveCamera::~PerspectiveCamera | ( | ) | [inline, virtual] |
Destructor
Definition at line 54 of file PerspectiveCamera.h.
virtual Ray PerspectiveCamera::initRay | ( | float | x, | |
float | y | |||
) | [inline, virtual] |
Initialize a ray for pixel. Fractional coordinates are possible
x | X coordinate of the pixel | |
y | Y coordinate of the pixel |
Implements Camera.
Definition at line 62 of file PerspectiveCamera.h.
References Ray::init(), mAspect, mDir, mFocus, Camera::mPos, Camera::mResX, Camera::mResY, mXAxis, and mYAxis.
void PerspectiveCamera::setPos | ( | Vec3f | pos | ) | [inline, virtual] |
sets the position of the camera
Implements Camera.
Definition at line 74 of file PerspectiveCamera.h.
References Camera::mPos, and Camera::pos().
void PerspectiveCamera::setDir | ( | Vec3f | dir | ) | [inline, virtual] |
sets the viewing direction of the camera and calculates mXAxis and mYAxis
Implements Camera.
Definition at line 81 of file PerspectiveCamera.h.
References Vec3f::cross(), dir(), mAngle, mAspect, mDir, mFocus, Camera::mResX, Camera::mResY, mUp, mXAxis, mYAxis, Vec3f::normal(), and Vec3f::normalize().
void PerspectiveCamera::setUp | ( | Vec3f | up | ) | [inline, virtual] |
sets the up vector of the camera and calculates the mXAxis and mYAxis
Implements Camera.
Definition at line 97 of file PerspectiveCamera.h.
References Vec3f::cross(), mAngle, mAspect, mDir, mFocus, Camera::mResX, Camera::mResY, mUp, mXAxis, mYAxis, Vec3f::normal(), Vec3f::normalize(), and up().
virtual const Vec3f& PerspectiveCamera::dir | ( | ) | const [inline, virtual] |
Get view direction
Implements Camera.
Definition at line 113 of file PerspectiveCamera.h.
References mDir.
Referenced by setDir().
const Vec3f& PerspectiveCamera::up | ( | ) | const [inline, virtual] |
Get up direction
Implements Camera.
Definition at line 120 of file PerspectiveCamera.h.
References mUp.
Referenced by setUp().
float PerspectiveCamera::angle | ( | ) | const [inline] |
Get vertical opening angle in degree
Definition at line 127 of file PerspectiveCamera.h.
References mAngle.
float PerspectiveCamera::aspect | ( | ) | const [inline] |
int PerspectiveCamera::depthSamples | ( | ) | const [inline, virtual] |
number of samples needed (at the moment only>1 for depth of field
Implements Camera.
Definition at line 141 of file PerspectiveCamera.h.
virtual const float PerspectiveCamera::focusDistance | ( | ) | const [inline, virtual] |
Returns an arbitrary value
Implements Camera.
Definition at line 149 of file PerspectiveCamera.h.
virtual const float PerspectiveCamera::aperture | ( | ) | const [inline, virtual] |
Returns an arbitrary value
Implements Camera.
Definition at line 157 of file PerspectiveCamera.h.
void PerspectiveCamera::setDepthSamples | ( | unsigned int | ) | [inline, virtual] |
Does nothing, for further information look at the comment for DepthOfFieldCamera
Implements Camera.
Definition at line 165 of file PerspectiveCamera.h.
void PerspectiveCamera::setFocusDistance | ( | float | ) | [inline, virtual] |
Does nothing, for further information look at the comment for DepthOfFIeldCamera
Implements Camera.
Definition at line 170 of file PerspectiveCamera.h.
void PerspectiveCamera::setAperture | ( | float | ) | [inline, virtual] |
Does nothing, for further information look at the comment for DepthOfFieldCamera
Implements Camera.
Definition at line 175 of file PerspectiveCamera.h.
void PerspectiveCamera::setSlowCorrect | ( | ) | [inline, virtual] |
Does nothing, for further information look at the comment for DepthOfFieldCamera
Implements Camera.
Definition at line 181 of file PerspectiveCamera.h.
void PerspectiveCamera::setFastIncorrect | ( | ) | [inline, virtual] |
Does nothing, for further information look at the comment for DepthOfFieldCamera
Implements Camera.
Definition at line 186 of file PerspectiveCamera.h.
Vec3f PerspectiveCamera::mDir [private] |
View direction.
Definition at line 190 of file PerspectiveCamera.h.
Referenced by dir(), initRay(), PerspectiveCamera(), setDir(), and setUp().
Vec3f PerspectiveCamera::mUp [private] |
Up direction.
Definition at line 193 of file PerspectiveCamera.h.
Referenced by PerspectiveCamera(), setDir(), setUp(), and up().
float PerspectiveCamera::mAngle [private] |
Vertical opening angle in radian.
Definition at line 196 of file PerspectiveCamera.h.
Referenced by angle(), PerspectiveCamera(), setDir(), and setUp().
float PerspectiveCamera::mFocus [private] |
Focus length.
Definition at line 199 of file PerspectiveCamera.h.
Referenced by initRay(), PerspectiveCamera(), setDir(), and setUp().
float PerspectiveCamera::mAspect [private] |
Aspect ratio x/y.
Definition at line 202 of file PerspectiveCamera.h.
Referenced by aspect(), initRay(), PerspectiveCamera(), setDir(), and setUp().
Vec3f PerspectiveCamera::mXAxis [private] |
Screen width.
Definition at line 205 of file PerspectiveCamera.h.
Referenced by initRay(), PerspectiveCamera(), setDir(), and setUp().
Vec3f PerspectiveCamera::mYAxis [private] |
Screen height.
Definition at line 208 of file PerspectiveCamera.h.
Referenced by initRay(), PerspectiveCamera(), setDir(), and setUp().