Struct BezierCurveQuadric
Represents a quadric bezier curve with two anchor and one control point.
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct BezierCurveQuadric
Constructors
BezierCurveQuadric(Vector2, Vector2, Vector2)
Initializes a new instance of the BezierCurveQuadric struct.
Declaration
public BezierCurveQuadric(Vector2 startAnchor, Vector2 endAnchor, Vector2 controlPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | startAnchor | The start anchor. |
Vector2 | endAnchor | The end anchor. |
Vector2 | controlPoint | The control point. |
BezierCurveQuadric(float, Vector2, Vector2, Vector2)
Initializes a new instance of the BezierCurveQuadric struct.
Declaration
public BezierCurveQuadric(float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 controlPoint)
Parameters
Type | Name | Description |
---|---|---|
float | parallel | The parallel value. |
Vector2 | startAnchor | The start anchor. |
Vector2 | endAnchor | The end anchor. |
Vector2 | controlPoint | The control point. |
Fields
ControlPoint
Control point, controls the direction of both endings of the curve.
Declaration
public Vector2 ControlPoint
Field Value
Type | Description |
---|---|
Vector2 |
EndAnchor
End anchor point.
Declaration
public Vector2 EndAnchor
Field Value
Type | Description |
---|---|
Vector2 |
Parallel
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.
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 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. |