![]() |
CamSim
0.0.0
A rasterization-based simulator for various types of cameras
|
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... | |
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:
| CamSim::Animation::Animation | ( | ) |
Constructor.
Constructs a default animation (one keyframe at t=0 with default transformation).
| CamSim::Animation::Animation | ( | const QList< Keyframe > & | keyframes | ) |
Constructor.
Constructs an animation from the given list of keyframes
| 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.
|
inline |
Convenience wrapper for addKeyFrame().
|
inline |
Get end time of animation.
Returns the time of the first keyframe.
| Transformation CamSim::Animation::interpolate | ( | long long | t | ) |
Interpolate transformation.
| t | Point in time, in microseconds |
Returns the transformation at the given point in time.
|
inline |
Get the current list of keyframes, sorted by time in ascending order.
| bool CamSim::Animation::load | ( | const QString & | filename | ) |
Load animation description from a file.
Returns true on success, false on error.
|
inline |
Get start time of animation.
Returns the time of the first keyframe.
1.8.16