HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImathFrame.h File Reference
#include "ImathNamespace.h"
+ Include dependency graph for ImathFrame.h:

Go to the source code of this file.

Functions

Functions for computing reference frames

These methods compute a set of reference frames, defined by their transformation matrix, along a curve. It is designed so that the array of points and the array of matrices used to fetch these routines don't need to be ordered as the curve.

A typical usage would be :

 m[0] = IMATH_INTERNAL_NAMESPACE::firstFrame( p[0], p[1], p[2] );
 for( int i = 1; i < n - 1; i++ )
 {
     m[i] = IMATH_INTERNAL_NAMESPACE::nextFrame( m[i-1], p[i-1], p[i], t[i-1], t[i] );
 }
 m[n-1] = IMATH_INTERNAL_NAMESPACE::lastFrame( m[n-2], p[n-2], p[n-1] );

See Graphics Gems I for the underlying algorithm.

template<class T >
Matrix44< T > constexpr firstFrame (const Vec3< T > &, const Vec3< T > &, const Vec3< T > &) IMATH_NOEXCEPT
 
template<class T >
Matrix44< T > constexpr nextFrame (const Matrix44< T > &, const Vec3< T > &, const Vec3< T > &, Vec3< T > &, Vec3< T > &) IMATH_NOEXCEPT
 
template<class T >
Matrix44< T > constexpr lastFrame (const Matrix44< T > &, const Vec3< T > &, const Vec3< T > &) IMATH_NOEXCEPT
 

Function Documentation

template<class T >
Matrix44< T > constexpr firstFrame ( const Vec3< T > &  pi,
const Vec3< T > &  pj,
const Vec3< T > &  pk 
)

Compute the first reference frame along a curve.

This function returns the transformation matrix to the reference frame defined by the three points pi, pj and pk. Note that if the two vectors <pi,pj> and <pi,pk> are colinears, an arbitrary twist value will be choosen.

Throw std::domain_error if pi and pj are equal.

Parameters
piFirst point
pjSecond point
pkThird point

Definition at line 78 of file ImathFrame.h.

template<class T >
Matrix44< T > constexpr lastFrame ( const Matrix44< T > &  Mi,
const Vec3< T > &  pi,
const Vec3< T > &  pj 
)

Compute the last reference frame along a curve.

This function returns the transformation matrix to the last reference frame defined by the previously computed transformation matrix and the last point along the curve.

Parameters
MiThe previous matrix
piThe previous point
pjThe last point

Definition at line 202 of file ImathFrame.h.

template<class T >
Matrix44< T > constexpr nextFrame ( const Matrix44< T > &  Mi,
const Vec3< T > &  pi,
const Vec3< T > &  pj,
Vec3< T > &  ti,
Vec3< T > &  tj 
)

Compute the next reference frame along a curve.

This function returns the transformation matrix to the next reference frame defined by the previously computed transformation matrix and the new point and tangent vector along the curve.

Parameters
MiThe previous matrix
piThe previous point
pjThe current point
tiThe previous tangent vector
tjThe current tangent vector

Rotation axis.

Definition at line 139 of file ImathFrame.h.