KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
GeneralizedCubicBezierCurve Class Reference

A generalized Bezier curve that uses the CSpace's Interpolate routine to generate the smooth interpolation. More...

#include <GeneralizedBezierCurve.h>

Public Member Functions

 GeneralizedCubicBezierCurve (CSpace *space=NULL, GeodesicSpace *manifold=NULL)
 
void Eval (Real u, Config &x) const
 Evaluate the bezizer curve at point u.
 
void Deriv (Real u, Config &dx) const
 Only works properly if the space is cartesian or manifold is set.
 
void Accel (Real u, Config &ddx) const
 Only works properly if the space is cartesian.
 
Real OuterLength () const
 Evaluates the length of the "frame" from x0->x1->x2->x3.
 
void GetBounds (Vector &xmin, Vector &xmax) const
 These work only with cartesian spaces.
 
void GetDerivBounds (Vector &vmin, Vector &vmax, Vector &amin, Vector &amax) const
 
void GetDerivBounds (Real u1, Real u2, Vector &vmin, Vector &vmax, Vector &amin, Vector &amax) const
 
void SetSmoothTangents (const Config *prev=NULL, const Config *next=NULL)
 Helper: sets x1 and x2 to smoothly interpolate from previous/next configs.
 
void SetSmoothTangents (const Config *prev, const Config *next, Real dtprev, Real dtnext)
 
void SetNaturalTangents (const Vector &dx0, const Vector &dx1)
 
void Midpoint (Vector &x) const
 These may be slightly cheaper than Eval(0.5) and Deriv(0.5) for cartesian spaces.
 
void MidpointDeriv (Vector &v) const
 
void MidpointTimeDeriv (Real duration, Vector &v) const
 
void Bisect (GeneralizedCubicBezierCurve &c1, GeneralizedCubicBezierCurve &c2) const
 

Public Attributes

CSpacespace
 
GeodesicSpacemanifold
 
Config x0
 
Config x1
 
Config x2
 
Config x3
 

Detailed Description

A generalized Bezier curve that uses the CSpace's Interpolate routine to generate the smooth interpolation.

The members x0,...,x3 need to be set up as valid configs in the given space. The De Casteljau algorithm is used to generate the output.

Member Function Documentation

void GeneralizedCubicBezierCurve::Bisect ( GeneralizedCubicBezierCurve c1,
GeneralizedCubicBezierCurve c2 
) const

Generates two bezier curves that meet at the midpoint with the same midpoint tangent (although with half the magnitude)

void GeneralizedCubicBezierCurve::SetNaturalTangents ( const Vector dx0,
const Vector dx1 
)

Helper: sets x1 and x2 to "naturally" interpolate the given tangents. To specify a non-constrained tangent, set the vector to be empty

Referenced by HermiteCSpace::Distance(), and HermiteCSpace::Properties().

void GeneralizedCubicBezierCurve::SetSmoothTangents ( const Config prev,
const Config next,
Real  dtprev,
Real  dtnext 
)

Helper: sets x1 and x2 to smoothly interpolate from previous/next configs, where dtprev is the amount of time elapsed from prev to x0, 1 is the duration of this curve, and dtnext is the amount of time elapsed from x3 to next


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