Struct BezierCurveCubic
Represents a cubic bezier curve with two anchor and two control points.
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct BezierCurveCubic
Constructors
BezierCurveCubic(Vector2, Vector2, Vector2, Vector2)
Initializes a new instance of the BezierCurveCubic struct.
Declaration
public BezierCurveCubic(Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | startAnchor | The start anchor point. |
Vector2 | endAnchor | The end anchor point. |
Vector2 | firstControlPoint | The first control point. |
Vector2 | secondControlPoint | The second control point. |
BezierCurveCubic(float, Vector2, Vector2, Vector2, Vector2)
Initializes a new instance of the BezierCurveCubic struct.
Declaration
public BezierCurveCubic(float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint)
Parameters
Type | Name | Description |
---|---|---|
float | parallel | The parallel value. |
Vector2 | startAnchor | The start anchor point. |
Vector2 | endAnchor | The end anchor point. |
Vector2 | firstControlPoint | The first control point. |
Vector2 | secondControlPoint | The second control point. |
Fields
EndAnchor
End anchor point.
Declaration
public Vector2 EndAnchor
Field Value
Type | Description |
---|---|
Vector2 |
FirstControlPoint
First control point, controls the direction of the curve start.
Declaration
public Vector2 FirstControlPoint
Field Value
Type | Description |
---|---|
Vector2 |
Parallel
Gets or sets the parallel value.
Declaration
public float Parallel
Field Value
Type | Description |
---|---|
float |
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.f to the orignal curve at any point.
SecondControlPoint
Second control point, controls the direction of the curve end.
Declaration
public Vector2 SecondControlPoint
Field Value
Type | Description |
---|---|
Vector2 |
StartAnchor
Start anchor point.
Declaration
public Vector2 StartAnchor
Field Value
Type | Description |
---|---|
Vector2 |
Methods
CalculateLength(float)
Calculates the length of this bezier curve.
Declaration
[Pure]
public float CalculateLength(float precision)
Parameters
Type | Name | Description |
---|---|---|
float | precision | The precision. |
Returns
Type | Description |
---|---|
float | Length of the curve. |
Remarks
The precision gets better when the precision
value gets smaller.
CalculatePoint(float)
Calculates the point with the specified t.
Declaration
[Pure]
public Vector2 CalculatePoint(float t)
Parameters
Type | Name | Description |
---|---|---|
float | t | The t value, between 0.0f and 1.0f. |
Returns
Type | Description |
---|---|
Vector2 | Resulting point. |