Drag[en]gine Game Engine
1.21
|
Bezier Curve. More...
#include <decCurveBezier.h>
Public Types | |
enum | eInterpolationModes { eimConstant , eimLinear , eimBezier } |
Interpolation modes. More... | |
Public Member Functions | |
Constructors and Destructors | |
decCurveBezier () | |
Create a new bezier curve. More... | |
decCurveBezier (const decCurveBezier &curve) | |
Create copy of bezier curve. More... | |
~decCurveBezier () | |
Clean up the bezier curve. More... | |
Management | |
int | GetPointCount () const |
Number of points. More... | |
const decCurveBezierPoint & | GetPointAt (int position) const |
Point at position. More... | |
int | FindPointPriorTo (float coordinate) const |
Index of the point with matching x coordinates or the point closest on the smaller side. More... | |
int | AddPoint (const decCurveBezierPoint &point) |
Add point returning the index where it has been added. More... | |
void | RemovePointFrom (int position) |
Remove point from the given position. More... | |
void | RemoveAllPoints () |
Remove all points. More... | |
eInterpolationModes | GetInterpolationMode () const |
Interpolation mode. More... | |
void | SetInterpolationMode (eInterpolationModes mode) |
Set interpolation mode. More... | |
void | SetDefaultLinear () |
Set curve to linear mapping from (0,0) to (1,1). More... | |
void | SetDefaultBezier () |
Set curve to default bezier curve from (0,0) to (1,1). More... | |
Operators | |
bool | operator== (const decCurveBezier &curve) const |
Curves are equal. More... | |
bool | operator!= (const decCurveBezier &curve) const |
Curves are not equal. More... | |
decCurveBezier & | operator= (const decCurveBezier &curve) |
Copy another curve to this curve. More... | |
Bezier Curve.
decCurveBezier::decCurveBezier | ( | ) |
Create a new bezier curve.
decCurveBezier::decCurveBezier | ( | const decCurveBezier & | curve | ) |
Create copy of bezier curve.
decCurveBezier::~decCurveBezier | ( | ) |
Clean up the bezier curve.
int decCurveBezier::AddPoint | ( | const decCurveBezierPoint & | point | ) |
Add point returning the index where it has been added.
int decCurveBezier::FindPointPriorTo | ( | float | coordinate | ) | const |
Index of the point with matching x coordinates or the point closest on the smaller side.
This method can be used to find the interval a point is located in by returning the most prior point. Retrieves -1 if there are no points satisfying this criteria.
|
inline |
Interpolation mode.
const decCurveBezierPoint& decCurveBezier::GetPointAt | ( | int | position | ) | const |
Point at position.
deeInvalidParam | position is less than 0. |
deeInvalidParam | position is larger or equal to GetPointCount()-1. |
|
inline |
Number of points.
bool decCurveBezier::operator!= | ( | const decCurveBezier & | curve | ) | const |
Curves are not equal.
decCurveBezier& decCurveBezier::operator= | ( | const decCurveBezier & | curve | ) |
Copy another curve to this curve.
bool decCurveBezier::operator== | ( | const decCurveBezier & | curve | ) | const |
Curves are equal.
void decCurveBezier::RemoveAllPoints | ( | ) |
Remove all points.
void decCurveBezier::RemovePointFrom | ( | int | position | ) |
Remove point from the given position.
deeInvalidParam | position is less than 0. |
deeInvalidParam | position is larger or equal to GetPointCount()-1. |
void decCurveBezier::SetDefaultBezier | ( | ) |
Set curve to default bezier curve from (0,0) to (1,1).
void decCurveBezier::SetDefaultLinear | ( | ) |
Set curve to linear mapping from (0,0) to (1,1).
void decCurveBezier::SetInterpolationMode | ( | eInterpolationModes | mode | ) |
Set interpolation mode.
deeInvalidParam | mode is not a member of decCurveBezier::eInterpolationModes. |