| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/directioninterpolator.h>

Public Member Functions | |
| DirectionInterpolator (Vector up=Vector(0, 1, 0)) | |
| void | setUp (const Vector &up) |
| const Vector & | getUp () |
| void | initInterpolation (const Vector &startDirection, const Vector &endDirection) |
| bool | degeneracyTest (const Vector &startDir, const Vector &endDir) |
| initInterpolation fails with an assertion if a direction is inappropriate, i.e, if it is approximately collinear with the up-direction. | |
| Vector | getInterpolatedDirection (double lambda) const |
| const Vector & | getStartDirection () |
| const Vector & | getEndDirection () |
| void | changeEndDirection (const Vector &v) |
| double | getAngleDistance () const |
| VRS_TYPEINFO (DirectionInterpolator, SharedObj) | |
| VRS_SERIALIZABLE (DirectionInterpolator) | |
Static Public Member Functions | |
| static double | transformParameter (double t) |
| Increasing a parameter t of getInterpolatedDirection() smoothly from 0 to 1 leads to a smooth rotation with constant speed (constant degrees/second). | |
| void VRS::DirectionInterpolator::setUp | ( | const Vector & | up | ) |
| const Vector& VRS::DirectionInterpolator::getUp | ( | ) |
| void VRS::DirectionInterpolator::initInterpolation | ( | const Vector & | startDirection, | |
| const Vector & | endDirection | |||
| ) |
Note that startDirection and endDirection must not be collinear with up
initInterpolation fails with an assertion if a direction is inappropriate, i.e, if it is approximately collinear with the up-direction.
This can be avoided by a pre-check using this method: If degeneracyTest() return true for two directions, initInterpolation() will not fail.
| Vector VRS::DirectionInterpolator::getInterpolatedDirection | ( | double | lambda | ) | const |
lambda is a value between 0 and 1. Other values are ignored, i.e. values greater than 1 are treated as 1, negative values as 0.
| const Vector & VRS::DirectionInterpolator::getStartDirection | ( | ) | [inline] |
| const Vector & VRS::DirectionInterpolator::getEndDirection | ( | ) | [inline] |
The end direction can be changed after the interpolation has been initialized. It is ensured, that continuous changes of the end direction lead always to continuous changes of the interpolated direction. Note that this is not neccesarily given if you initialize a new interpolation, because the rotation path could be flipped to a completely other one that is more appropriate to interpolate between start and new end direction.
| void VRS::DirectionInterpolator::changeEndDirection | ( | const Vector & | v | ) |
| double VRS::DirectionInterpolator::getAngleDistance | ( | ) | const |
To provide control of the rotation speed, getAngleDistance() returns a value that measures the rotation neccesary to change from startDirection to endDirection. It is calculated by sqrt(azimuthchange^2, alittudechange^2).
| static double VRS::DirectionInterpolator::transformParameter | ( | double | t | ) | [static] |
Increasing a parameter t of getInterpolatedDirection() smoothly from 0 to 1 leads to a smooth rotation with constant speed (constant degrees/second).
Using this parameter transformation for t before using it for getInterpolatedDirection() leads to a smooth rotation speed acceleration at the beginning and a smooth slow-down at the end.
| VRS::DirectionInterpolator::VRS_TYPEINFO | ( | DirectionInterpolator | , | |
| SharedObj | ||||
| ) |
| VRS::DirectionInterpolator::VRS_SERIALIZABLE | ( | DirectionInterpolator | ) |