C# Class PixelFarm.VectorMath.BezierCurveCubic

Represents a cubic bezier curve with two anchor and two control points.
Afficher le fichier Open project: prepare/HTML-Renderer

Méthodes publiques

Свойство Type Description
EndAnchor Vector2
FirstControlPoint Vector2
Parallel float
SecondControlPoint Vector2
StartAnchor Vector2

Méthodes publiques

Méthode Description
BezierCurveCubic ( Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint )

Constructs a new BezierCurveCubic.

BezierCurveCubic ( float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint )

Constructs a new BezierCurveCubic.

CalculateLength ( float precision ) : float

Calculates the length of this bezier curve.

The precision gets better when the precision value gets smaller.

CalculatePoint ( float t ) : Vector2

Calculates the point with the specified t.

Private Methods

Méthode Description
CalculatePointOfDerivative ( float t ) : Vector2

Calculates the point with the specified t of the derivative of this function.

Method Details

BezierCurveCubic() public méthode

Constructs a new BezierCurveCubic.
public BezierCurveCubic ( Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint )
startAnchor Vector2 The start anchor point.
endAnchor Vector2 The end anchor point.
firstControlPoint Vector2 The first control point.
secondControlPoint Vector2 The second control point.

BezierCurveCubic() public méthode

Constructs a new BezierCurveCubic.
public BezierCurveCubic ( float parallel, Vector2 startAnchor, Vector2 endAnchor, Vector2 firstControlPoint, Vector2 secondControlPoint )
parallel float The parallel value.
startAnchor Vector2 The start anchor point.
endAnchor Vector2 The end anchor point.
firstControlPoint Vector2 The first control point.
secondControlPoint Vector2 The second control point.

CalculateLength() public méthode

Calculates the length of this bezier curve.
The precision gets better when the precision value gets smaller.
public CalculateLength ( float precision ) : float
precision float The precision.
Résultat float

CalculatePoint() public méthode

Calculates the point with the specified t.
public CalculatePoint ( float t ) : Vector2
t float The t value, between 0.0f and 1.0f.
Résultat Vector2

Property Details

EndAnchor public_oe property

End anchor point.
public Vector2 EndAnchor
Résultat Vector2

FirstControlPoint public_oe property

First control point, controls the direction of the curve start.
public Vector2 FirstControlPoint
Résultat Vector2

Parallel public_oe property

Gets or sets 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.f to the orignal curve at any point.
public float Parallel
Résultat float

SecondControlPoint public_oe property

Second control point, controls the direction of the curve end.
public Vector2 SecondControlPoint
Résultat Vector2

StartAnchor public_oe property

Start anchor point.
public Vector2 StartAnchor
Résultat Vector2