Core 1.0
CameraAnimatedFrame Class Reference

Key frame camera animation. More...

#include <camera.h>

Inheritance diagram for CameraAnimatedFrame:
Camera

Public Member Functions

 CameraAnimatedFrame ()
 Create an animated frame.
 ~CameraAnimatedFrame ()
 Empty.
void Append (const Camera &, int, bool=false)
 Append a frame to the animation.
void Delete (int)
 Delete a frame to the animation.
int start () const
 Return the time of the first key-frame.
int end () const
 Return the time of the last key-frame.
int size () const
 Returns the number of key-frames.
void Clear ()
 Clear all key-frames.
bool setTime (int)
 Update the current time and compute the new key-frame.
bool setTimeSmooth (int)
 Update the current time and compute the new key-frame.
void setNbFrames (int)
 Set the number of frames for the animation.
int GetTime (int) const
 Get the time of a keyframe.
Camera GetCamera (int) const
 Get the camera frame at a specific index.
bool GetAcc (int) const
 Get the acceleration of a keyframe.
bool ExistKey (int) const
 Check if a keyframe exists at a specific frame.
Camera AtKey (int) const
 Get the camera frame at a specific keyframe.
CameraFrame AtFrame (int i) const
 Returns the camera frame at the specified index.
Public Member Functions inherited from Camera
 Camera ()
 Create a default camera.
 Camera (const Vector &, const Vector &=Vector::Null, const Vector &=Vector::Z, const double &=1.0, const double &=1.0, const double &=1.0, const double &=100000.0)
 Create a camera given its location and look-at point.
 Camera (const Vector &, const Vector &, const Vector &, const double &, const double &=1.0, const double &=100000.0)
 Create a camera given its location and look at point.
void Translate (const Vector &)
 Translates a camera by a given vector.
void Rotate (const Matrix &)
 Rotates the camera with a rotation matrix.
void CircleAnim (const double &angle, const Vector &start_eye)
 Rotates the camera around the look-at point by a given angle, starting from a given eye position.
Vector At () const
 Returns the look-at point.
Vector Eye () const
 Returns the eye point.
Vector Up () const
 Returns the up vector.
Vector View () const
 Returns the viewing direction (not normalized).
Frame GetFrame () const
 Get the frame of the camera.
double GetNear () const
 Get the near distance.
double GetFar () const
 Get the far distance.
double GetCameraApertureH () const
 Returns the horizontal camera aperture (film gate width) in inches.
double GetCameraApertureV () const
 Returns the vertical camera aperture (film gate height) in inches.
double GetFocalLength () const
 Returns the focal length in millimetres.
double GetAngleOfViewH () const
 Returns the horizontal angle of view.
double GetAngleOfViewV (double, double) const
 Returns the vertical angle of view.
void Step (const double &)
 Steps forward or backward by a given distance.
bool InsideFrustum (const Vector &) const
 Check if the point lies in the view frustum.
bool InsideFrustum (const Box &) const
 Check if the argument box lies in the view frustum.
void LeftRight (const double &)
 Rotates the camera around the up vector by a given angle.
void Vertical ()
 Reset the camera so that the up vector should point to the sky.
void UpDown (const double &)
 Rotates the view direction up or down around the eye, the look-at point moves while the eye remains fixed.
void SideWay (const double &)
 Moves the camera sideway.
void BackForth (const double &, bool=false)
 Moves the eye point towards or away from the look at point.
void LeftRightRound (const double &)
 Rotates the eye around the vertical axis passing through the look-at point.
void UpDownRound (const double &)
 Rotates the eye up or down around the look-at point.
void LeftRightFPS (const double &)
 Rotates the look-at point around the vertical axis passing through the eye, as in a first person view.
void UpDownRoundFPS (const double &)
 Rotates the look-at point up or down around the eye, as in a first person view.
void SlideHorizontal (const double &)
 Moves the camera left or right in the horizontal plane.
void SetAt (const Vector &)
 Sets the camera target vector.
void SetEye (const Vector &)
 Sets the camera eye point.
void SetPlanes (const double &, const double &)
 Set the near and far planes.
void SetCameraApertureH (const double &)
 Set the horizontal camera aperture.
void SetCameraApertureV (const double &)
 Set the vertical camera aperture.
void SetFocalLength (const double &)
 Set the focal length.
void UpDownVertical (const double &)
 Moves the camera vertically.
void LeftRightHorizontal (const double &)
 Moves the camera left or right, preserving its height.
QString ToString (int=6) const
 Create a QString form a camera.
Ray PixelToRay (int, int, int, int) const
 Compute the equation of a ray given a pixel in the camera plane.
Ray PixelToRay (int, int, int, int, int, int, int) const
 Compute the equation of a ray given a pixel in the camera plane.
bool VectorToPixel (const Vector &, double &, double &, int, int) const
 Compute coordinates of a point in the camera plane.

Protected Attributes

QVector< CameraFrame > mafs
 List of key-frames.
Protected Attributes inherited from Camera
Vector eye = -Vector::X
 Eye.
Vector at = Vector::Null
 Look at point.
Vector up = Vector::Z
 Up vector.
Vector view = Vector::X
 View unit vector.
double cah = 0.980
 Camera aperture horizontal.
double cav = 0.735
 Camera aperture vertical.
double fl = 35.0
 Focal length.
double nearplane = 1.0
 Near plane.
double farplane = 100000.0
 Far plane.

Friends

std::ostream & operator<< (std::ostream &s, const CameraAnimatedFrame &c)
 Overloaded.

Additional Inherited Members

Static Public Member Functions inherited from Camera
static Camera Lerp (const Camera &, const Camera &, const double &)
 Linearly interpolates between two cameras.
static Camera View (const Box &)
 Create a default camera focusing on a given box.

Detailed Description

Key frame camera animation.

Member Function Documentation

◆ Append()

void CameraAnimatedFrame::Append ( const Camera & cam,
int t,
bool acc = false )

Append a frame to the animation.

Parameters
camCamera frame.
tTime.
accAcceleration.

◆ AtFrame()

CameraFrame CameraAnimatedFrame::AtFrame ( int i) const
inline

Returns the camera frame at the specified index.

Parameters
ithe index of the frame to return
Returns
the camera frame at the specified index

◆ AtKey()

Camera CameraAnimatedFrame::AtKey ( int frame) const

Get the camera frame at a specific keyframe.

Parameters
frameThe frame index.
Returns
The camera frame.

◆ Delete()

void CameraAnimatedFrame::Delete ( int t)

Delete a frame to the animation.

Parameters
tTime.

◆ ExistKey()

bool CameraAnimatedFrame::ExistKey ( int frame) const

Check if a keyframe exists at a specific frame.

Parameters
frameThe frame index.
Returns
True if the keyframe exists, false otherwise.

◆ GetAcc()

bool CameraAnimatedFrame::GetAcc ( int frame) const

Get the acceleration of a keyframe.

Parameters
frameThe frame index.
Returns
The acceleration of the keyframe.

◆ GetCamera()

Camera CameraAnimatedFrame::GetCamera ( int frame) const

Get the camera frame at a specific index.

Parameters
frameThe frame index.
Returns
The camera frame.

◆ GetTime()

int CameraAnimatedFrame::GetTime ( int frame) const

Get the time of a keyframe.

Parameters
frameThe frame index.
Returns
The time of the keyframe.

◆ setNbFrames()

void CameraAnimatedFrame::setNbFrames ( int nbFrames)

Set the number of frames for the animation.

Parameters
nbFramesThe new number of frames.

◆ setTime()

bool CameraAnimatedFrame::setTime ( int t)

Update the current time and compute the new key-frame.

Parameters
tNew current time

◆ setTimeSmooth()

bool CameraAnimatedFrame::setTimeSmooth ( int t)

Update the current time and compute the new key-frame.

Parameters
tNew current time

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const CameraAnimatedFrame & c )
friend

Overloaded.

Parameters
sStream.
cThe camera animated frame.