Struct BezierCurve
Represents a bezier curve with as many points as you want.
Inherited Members
Namespace: OpenTK
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public struct BezierCurve
Constructors
BezierCurve(IEnumerable<Vector2>)
Constructs a new BezierCurve.
Declaration
public BezierCurve(IEnumerable<Vector2> points)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector2> | points | The points. |
BezierCurve(Vector2[])
Constructs a new BezierCurve.
Declaration
public BezierCurve(params Vector2[] points)
Parameters
Type | Name | Description |
---|---|---|
Vector2[] | points | The points. |
BezierCurve(Single, IEnumerable<Vector2>)
Constructs a new BezierCurve.
Declaration
public BezierCurve(float parallel, IEnumerable<Vector2> points)
Parameters
Type | Name | Description |
---|---|---|
System.Single | parallel | The parallel value. |
IEnumerable<Vector2> | points | The points. |
BezierCurve(Single, Vector2[])
Constructs a new BezierCurve.
Declaration
public BezierCurve(float parallel, params Vector2[] points)
Parameters
Type | Name | Description |
---|---|---|
System.Single | parallel | The parallel value. |
Vector2[] | points | The points. |
Fields
Parallel
The parallel value.
Declaration
public float Parallel
Field Value
Type | Description |
---|---|
System.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 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. |
System.Single | precision | The precision value. |
Returns
Type | Description |
---|---|
System.Single | The precision gets better as the |
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. |
System.Single | precision | The precision value. |
System.Single | parallel | The parallel value. |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Single | precision | The precision. |
Returns
Type | Description |
---|---|
System.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. |
System.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. |
System.Single | t | The t parameter, a value between 0.0f and 1.0f. |
System.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 |
---|---|---|
System.Single | t | The t value, between 0.0f and 1.0f. |
Returns
Type | Description |
---|---|
Vector2 | Resulting point. |