The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.BezierCurveCubic Struct Reference

Represents a cubic bezier curve with two anchor and two control points. More...

Public Member Functions

 BezierCurveCubic (Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
 Constructs a new BezierCurveCubic. More...
 
 BezierCurveCubic (float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
 Constructs a new BezierCurveCubic. More...
 
Vector2 CalculatePoint (float t)
 Calculates the point with the specified t. More...
 
float CalculateLength (float precision)
 Calculates the length of this bezier curve. More...
 

Public Attributes

Vector2 StartAnchor
 Start anchor point. More...
 
Vector2 EndAnchor
 End anchor point. More...
 
Vector2 FirstControlPoint
 First control point, controls the direction of the curve start. More...
 
Vector2 SecondControlPoint
 Second control point, controls the direction of the curve end. More...
 
float Parallel
 Gets or sets the parallel value. More...
 

Detailed Description

Represents a cubic bezier curve with two anchor and two control points.

Constructor & Destructor Documentation

OpenTK.BezierCurveCubic.BezierCurveCubic ( Vector2  startAnchor,
Vector2  endAnchor,
Vector2  firstControlPoint,
Vector2  secondControlPoint 
)

Constructs a new BezierCurveCubic.

Parameters
startAnchorThe start anchor point.
endAnchorThe end anchor point.
firstControlPointThe first control point.
secondControlPointThe second control point.
OpenTK.BezierCurveCubic.BezierCurveCubic ( float  parallel,
Vector2  startAnchor,
Vector2  endAnchor,
Vector2  firstControlPoint,
Vector2  secondControlPoint 
)

Constructs a new BezierCurveCubic.

Parameters
parallelThe parallel value.
startAnchorThe start anchor point.
endAnchorThe end anchor point.
firstControlPointThe first control point.
secondControlPointThe second control point.

Member Function Documentation

float OpenTK.BezierCurveCubic.CalculateLength ( float  precision)

Calculates the length of this bezier curve.

Parameters
precisionThe precision.
Returns
Length of the curve.

The precision gets better when the precision value gets smaller.

Vector2 OpenTK.BezierCurveCubic.CalculatePoint ( float  t)

Calculates the point with the specified t.

Parameters
tThe t value, between 0.0f and 1.0f.
Returns
Resulting point.

Member Data Documentation

Vector2 OpenTK.BezierCurveCubic.EndAnchor

End anchor point.

Vector2 OpenTK.BezierCurveCubic.FirstControlPoint

First control point, controls the direction of the curve start.

float OpenTK.BezierCurveCubic.Parallel

Gets or sets the parallel value.

This value defines whether the curve should be calculated as a parallel curve to the original bezier curve. A value of 0.0f represents the original curve, 5.0f i.e. stands for a curve that has always a distance of 5.f to the orignal curve at any point.

Vector2 OpenTK.BezierCurveCubic.SecondControlPoint

Second control point, controls the direction of the curve end.

Vector2 OpenTK.BezierCurveCubic.StartAnchor

Start anchor point.