The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
OpenTK.BezierCurve Struct Reference

Represents a bezier curve with as many points as you want. More...

Public Member Functions

 BezierCurve (IEnumerable< Vector2 > points)
 Constructs a new BezierCurve. More...
 
 BezierCurve (params Vector2[] points)
 Constructs a new BezierCurve. More...
 
 BezierCurve (float parallel, params Vector2[] points)
 Constructs a new BezierCurve. More...
 
 BezierCurve (float parallel, IEnumerable< Vector2 > points)
 Constructs a new BezierCurve. 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...
 

Static Public Member Functions

static float CalculateLength (IList< Vector2 > points, float precision)
 Calculates the length of the specified bezier curve. More...
 
static float CalculateLength (IList< Vector2 > points, float precision, float parallel)
 Calculates the length of the specified bezier curve. More...
 
static Vector2 CalculatePoint (IList< Vector2 > points, float t)
 Calculates the point on the given bezier curve with the specified t parameter. More...
 
static Vector2 CalculatePoint (IList< Vector2 > points, float t, float parallel)
 Calculates the point on the given bezier curve with the specified t parameter. More...
 

Public Attributes

float Parallel
 The parallel value. More...
 

Properties

IList< Vector2Points [get]
 Gets the points of this curve. More...
 

Detailed Description

Represents a bezier curve with as many points as you want.

Constructor & Destructor Documentation

OpenTK.BezierCurve.BezierCurve ( IEnumerable< Vector2 points)

Constructs a new BezierCurve.

Parameters
pointsThe points.
OpenTK.BezierCurve.BezierCurve ( params Vector2[]  points)

Constructs a new BezierCurve.

Parameters
pointsThe points.
OpenTK.BezierCurve.BezierCurve ( float  parallel,
params Vector2[]  points 
)

Constructs a new BezierCurve.

Parameters
parallelThe parallel value.
pointsThe points.
OpenTK.BezierCurve.BezierCurve ( float  parallel,
IEnumerable< Vector2 points 
)

Constructs a new BezierCurve.

Parameters
parallelThe parallel value.
pointsThe points.

Member Function Documentation

float OpenTK.BezierCurve.CalculateLength ( float  precision)

Calculates the length of this bezier curve.

Parameters
precisionThe precision.
Returns
Length of curve.

The precision gets better as the precision value gets smaller.

static float OpenTK.BezierCurve.CalculateLength ( IList< Vector2 points,
float  precision 
)
static

Calculates the length of the specified bezier curve.

Parameters
pointsThe points.
precisionThe precision value.
Returns
The precision gets better as the precision value gets smaller.
static float OpenTK.BezierCurve.CalculateLength ( IList< Vector2 points,
float  precision,
float  parallel 
)
static

Calculates the length of the specified bezier curve.

Parameters
pointsThe points.
precisionThe precision value.
parallelThe parallel value.
Returns
Length of curve.

The precision gets better as the precision value gets smaller.

The parallel parameter 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 represents a curve that has always a distance of 5.0f to the orignal curve.

Vector2 OpenTK.BezierCurve.CalculatePoint ( float  t)

Calculates the point with the specified t.

Parameters
tThe t value, between 0.0f and 1.0f.
Returns
Resulting point.
static Vector2 OpenTK.BezierCurve.CalculatePoint ( IList< Vector2 points,
float  t 
)
static

Calculates the point on the given bezier curve with the specified t parameter.

Parameters
pointsThe points.
tThe t parameter, a value between 0.0f and 1.0f.
Returns
Resulting point.
static Vector2 OpenTK.BezierCurve.CalculatePoint ( IList< Vector2 points,
float  t,
float  parallel 
)
static

Calculates the point on the given bezier curve with the specified t parameter.

Parameters
pointsThe points.
tThe t parameter, a value between 0.0f and 1.0f.
parallelThe parallel value.
Returns
Resulting point.

The parallel parameter 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 represents a curve that has always a distance of 5.0f to the orignal curve.

Member Data Documentation

float OpenTK.BezierCurve.Parallel

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.0f to the orignal curve at any point.

Property Documentation

IList<Vector2> OpenTK.BezierCurve.Points
get

Gets the points of this curve.

The first point and the last points represent the anchor points.