version 3.3

VRS::DirectionInterpolator Class Reference

#include <vrs/directioninterpolator.h>

Inheritance diagram for VRS::DirectionInterpolator:

VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 DirectionInterpolator (Vector up=Vector(0, 1, 0))
void setUp (const Vector &up)
const VectorgetUp ()
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 VectorgetStartDirection ()
const VectorgetEndDirection ()
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).


Detailed Description

The DirectionInterpolator enables smooth interpolation of arbitrary view directions. It is always ensured that an interpolated direction vector is not collinear with the up vector specified at construction.

Constructor & Destructor Documentation

VRS::DirectionInterpolator::DirectionInterpolator ( Vector  up = Vector(0, 1, 0)  ) 


Member Function Documentation

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

bool VRS::DirectionInterpolator::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.

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   ) 


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

Generated on Mon May 21 06:00:17 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact