CamSim  0.0.0
A rasterization-based simulator for various types of cameras
Classes | Public Member Functions | List of all members
CamSim::Animation Class Reference

The Animation class. More...

Classes

class  Keyframe
 The Keyframe class. More...
 

Public Member Functions

 Animation ()
 Constructor. More...
 
 Animation (const QList< Keyframe > &keyframes)
 Constructor. More...
 
const QList< Keyframe > & keyframes ()
 Get the current list of keyframes, sorted by time in ascending order. More...
 
void addKeyframe (const Keyframe &keyframe)
 Add a key frame. If a key frame with the same time stamp already exists, it is overwritten. More...
 
void addKeyframe (long long usecs, const Transformation &transf)
 Convenience wrapper for addKeyFrame(). More...
 
long long startTime () const
 Get start time of animation. More...
 
long long endTime () const
 Get end time of animation. More...
 
Transformation interpolate (long long t)
 Interpolate transformation. More...
 
bool load (const QString &filename)
 Load animation description from a file. More...
 

Detailed Description

The Animation class.

This class describes an animation through a set key frames, which are points in time at which the transformation of an object is known.

Transformations at arbitrary points in time are interpolated from these key frames.

Positions are interpolated linearly, and rotations are interpolated via spherical linear interpolation (slerp).

The translation of a target is measured relative to the origin, and its orientation is given by a rotation angle around a rotation axis.

Example: if you animate an object and your camera is in the origin, looking along -z, with up vector +y, and everything is measured in meters:

Constructor & Destructor Documentation

◆ Animation() [1/2]

CamSim::Animation::Animation ( )

Constructor.

Constructs a default animation (one keyframe at t=0 with default transformation).

◆ Animation() [2/2]

CamSim::Animation::Animation ( const QList< Keyframe > &  keyframes)

Constructor.

Constructs an animation from the given list of keyframes

Member Function Documentation

◆ addKeyframe() [1/2]

void CamSim::Animation::addKeyframe ( const Keyframe keyframe)

Add a key frame. If a key frame with the same time stamp already exists, it is overwritten.

◆ addKeyframe() [2/2]

void CamSim::Animation::addKeyframe ( long long  usecs,
const Transformation transf 
)
inline

Convenience wrapper for addKeyFrame().

◆ endTime()

long long CamSim::Animation::endTime ( ) const
inline

Get end time of animation.

Returns the time of the first keyframe.

◆ interpolate()

Transformation CamSim::Animation::interpolate ( long long  t)

Interpolate transformation.

Parameters
tPoint in time, in microseconds

Returns the transformation at the given point in time.

◆ keyframes()

const QList<Keyframe>& CamSim::Animation::keyframes ( )
inline

Get the current list of keyframes, sorted by time in ascending order.

◆ load()

bool CamSim::Animation::load ( const QString &  filename)

Load animation description from a file.

Returns true on success, false on error.

◆ startTime()

long long CamSim::Animation::startTime ( ) const
inline

Get start time of animation.

Returns the time of the first keyframe.


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