Allolib
1.0
C++ Components For Interactive Multimedia
|
Frenet frame generator. More...
Public Member Functions | |
Frenet (const Vec3 &p2=Vec3(0, -0.01, 0), const Vec3 &p1=Vec3(0, 0, 0)) | |
const Vec3 & | point () const |
Get point one ahead of currently stored frame. | |
const Vec3 & | db () const |
Get backward first difference. | |
const Vec3 & | df () const |
Get forward first difference. | |
Vec3 | d2 () const |
Get (central) second difference. | |
void | operator() (const Vec3 &p0) |
Compute Frenet frame one point back from input point. | |
template<bool NormalizeT, bool NormalizeN, bool NormalizeB, bool ComputeN, bool ComputeB> | |
void | next (const Vec3 &p0) |
Compute Frenet frame one point back from input point. More... | |
void | init (const Vec3 &p2, const Vec3 &p1) |
(Re)initialize with previous two points | |
Public Attributes | |
Vec3 | T |
Tangent vector of current frame. | |
Vec3 | N |
Normal vector of current frame. | |
Vec3 | B |
Binormal vector of current frame. | |
Protected Attributes | |
Vec3 | mp1 |
Vec3 | mdb |
Vec3 | mdf |
Frenet frame generator.
This class generates a sequence of Frenet frames given a corresponding sequence of discrete points along a curve. A Frenet frame is computed from a run of three consecutive points and corresponds to the middle point. A Frenet frame is an orthonormal reference frame describing the local tangent (T), normal (N), and binormal (B) unit vectors of a curve. The frame is based on a right-handed coordinate system so that T = N x B, N = B x T, and B = T x N.
Vec3 | 3-vector type |
Definition at line 75 of file al_Curve.hpp.
|
inline |
[in] | p2 | two points back |
[in] | p1 | one point back |
Definition at line 82 of file al_Curve.hpp.
|
inline |
Compute Frenet frame one point back from input point.
For best results, avoid runs of 3 or more colinear points and 2 or more duplicate points. Colinear points result in ambiguous normal and binormal vectors. Duplicated points make the first derivative undefined. Both of these situations are guaranteed to wreak numerical havok.
Definition at line 109 of file al_Curve.hpp.