Show / Hide Table of Contents

Struct BezierCurve

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

Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
[Serializable]
public struct BezierCurve

Constructors

BezierCurve(Vector2[])

Constructs a new BezierCurve.

Declaration
public BezierCurve(params Vector2[] points)
Parameters
Type Name Description
Vector2[] points

The points.

BezierCurve(IEnumerable<Vector2>)

Constructs a new BezierCurve.

Declaration
public BezierCurve(IEnumerable<Vector2> points)
Parameters
Type Name Description
IEnumerable<Vector2> points

The points.

BezierCurve(Single, Vector2[])

Constructs a new BezierCurve.

Declaration
public BezierCurve(float parallel, params Vector2[] points)
Parameters
Type Name Description
Single parallel

The parallel value.

Vector2[] points

The points.

BezierCurve(Single, IEnumerable<Vector2>)

Constructs a new BezierCurve.

Declaration
public BezierCurve(float parallel, IEnumerable<Vector2> points)
Parameters
Type Name Description
Single parallel

The parallel value.

IEnumerable<Vector2> points

The points.

Fields

Parallel

The parallel value.

Declaration
public float Parallel
Field Value
Type Description
Single
Remarks

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.

Properties

Points

Gets the points of this curve.

Declaration
public readonly IList<Vector2> Points { get; }
Property Value
Type Description
IList<Vector2>
Remarks

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

Methods

CalculateLength(IList<Vector2>, Single)

Calculates the length of the specified bezier curve.

Declaration
public static float CalculateLength(IList<Vector2> points, float precision)
Parameters
Type Name Description
IList<Vector2> points

The points.

Single precision

The precision value.

Returns
Type Description
Single

The precision gets better as the precision value gets smaller.

CalculateLength(IList<Vector2>, Single, Single)

Calculates the length of the specified bezier curve.

Declaration
public static float CalculateLength(IList<Vector2> points, float precision, float parallel)
Parameters
Type Name Description
IList<Vector2> points

The points.

Single precision

The precision value.

Single parallel

The parallel value.

Returns
Type Description
Single

Length of curve.

Remarks

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.

CalculateLength(Single)

Calculates the length of this bezier curve.

Declaration
public float CalculateLength(float precision)
Parameters
Type Name Description
Single precision

The precision.

Returns
Type Description
Single

Length of curve.

Remarks

The precision gets better as the precision value gets smaller.

CalculatePoint(IList<Vector2>, Single)

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

Declaration
public static Vector2 CalculatePoint(IList<Vector2> points, float t)
Parameters
Type Name Description
IList<Vector2> points

The points.

Single t

The t parameter, a value between 0.0f and 1.0f.

Returns
Type Description
Vector2

Resulting point.

CalculatePoint(IList<Vector2>, Single, Single)

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

Declaration
public static Vector2 CalculatePoint(IList<Vector2> points, float t, float parallel)
Parameters
Type Name Description
IList<Vector2> points

The points.

Single t

The t parameter, a value between 0.0f and 1.0f.

Single parallel

The parallel value.

Returns
Type Description
Vector2

Resulting point.

Remarks

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.

CalculatePoint(Single)

Calculates the point with the specified t.

Declaration
public Vector2 CalculatePoint(float t)
Parameters
Type Name Description
Single t

The t value, between 0.0f and 1.0f.

Returns
Type Description
Vector2

Resulting point.

In This Article
Back to top Generated by DocFX