Public Member Functions |
| GBezier (int nControlPoints) |
| GBezier (GBezier *pThat) |
| ~GBezier () |
int | controlPointCount () |
| Returns the number of control points in this curve (which is always one more than the degree of the curve).
|
void | point (double t, G3DVector *pOutPoint) |
| Returns a point on the curve.
|
void | controlPoint (G3DVector *pOutPoint, double *pOutWeight, int n) |
| Returns a control point.
|
void | setControlPoint (int n, G3DVector *pPoint, double weight) |
| Sets a control point.
|
GBezier * | copy () |
void | elevateDegree () |
| Increases the degree (and number of control points) of the curve by one without changing the curve. (Only the control points are changed.)
|
void | segment (double t, bool bTail) |
| Crops the curve. If bTail is true, only the end of the curve remains. If bTail is false, only the beginning of the curve remains.
|
void | derivativeAtZero (G3DVector *pOutPoint) |
| Returns the tangeant to the curve at t=0.
|
double | curvatureAtZero () |
| todo: this method is not reliable--there's a bug in this method somewhere
|
void | toPolynomial (G3DVector *pOutCoefficients) |
| This expects you to pass in a pointer to an array of G3DVector of size m_nControlPoints.
|
Static Public Member Functions |
static void | test () |
| Performs unit tests for this class. Throws an exception if there is a failure.
|
static GBezier * | fromPolynomial (G3DVector *pCoefficients, int nCoefficients) |
| Example: If you have the three equations: x=1+2t+3t*t, y=4+5t+6t*t, z=7+8t+9t*t then you would pass in this array of points: { (1, 4, 7), (2, 5, 8), (3, 6, 9) } to get the equivalent Bezier curve.
|
Protected Member Functions |
struct GBezierPoint * | deCasteljau (double t, bool bTail) |
Protected Attributes |
int | m_nControlPoints |
struct GBezierPoint * | m_pPoints |
Represents a Bezier curve.
static GBezier* GClasses::GBezier::fromPolynomial |
( |
G3DVector * |
pCoefficients, |
|
|
int |
nCoefficients |
|
) |
| [static] |
Example: If you have the three equations: x=1+2t+3t*t, y=4+5t+6t*t, z=7+8t+9t*t then you would pass in this array of points: { (1, 4, 7), (2, 5, 8), (3, 6, 9) } to get the equivalent Bezier curve.