Arbor 3: FSM & BT Graph Editor  3.7.8
Bezier2D Class Reference

Class to handle the two-dimensional cubic Bezier More...

Public Member Functions

 Bezier2D ()
 new Bezier2D. More...
 
 Bezier2D (Vector2 startPosition, Vector2 startControl, Vector2 endPosition, Vector2 endControl)
 new Bezier2D. More...
 
 Bezier2D (Bezier2D bezier)
 new Bezier2D. More...
 
bool SetStartPoint (Vector2 position, Vector2 control)
 Set Start point. More...
 
bool SetEndPoint (Vector2 position, Vector2 control)
 Set End point. More...
 
Vector2 GetPoint (float t)
 Get a position on the Bezier curve. More...
 
Vector2 GetTangent (float t)
 Get a tangent on the Bezier curve. More...
 
Vector2 GetClosestPoint (Vector2 pos, float thresholdT=0.001f)
 Get a closest point on the Bezier curve. More...
 
float GetClosestParam (Vector2 pos, float thresholdT=0.001f)
 Get a closest point on the Bezier curve. More...
 
float LinearToInterpolationParam (float t)
 Returns normal interpolation value of Bezier curve from linear interpolation value t. More...
 
Vector2 GetLinearPoint (float t)
 Get a position on the Bezier curve linear. More...
 
bool Equals (Bezier2D bezier)
 Returns whether this is equal to Bezier2D. More...
 
override bool Equals (object obj)
 Returns whether this is equal to object. More...
 
override int GetHashCode ()
 Get a hash code. More...
 

Static Public Member Functions

static Vector2 GetPoint (Vector2 startPosition, Vector2 startControl, Vector2 endPosition, Vector2 endControl, float t)
 Get a position on the Bezier curve. More...
 
static Vector2 GetTangent (Vector2 startPosition, Vector2 startControl, Vector2 endPosition, Vector2 endControl, float t)
 Get a tangent on the Bezier curve. More...
 

Properties

Vector2 startPosition [get, set]
 Starting point More...
 
Vector2 startControl [get, set]
 Control point of the starting point More...
 
Vector2 endPosition [get, set]
 End point More...
 
Vector2 endControl [get, set]
 Control point of the end point More...
 
float length [get]
 Length More...
 
bool isChanged [get]
 Whether it has been changed More...
 

Detailed Description

Class to handle the two-dimensional cubic Bezier

Constructor & Destructor Documentation

◆ Bezier2D() [1/3]

Bezier2D ( )

new Bezier2D.

◆ Bezier2D() [2/3]

Bezier2D ( Vector2  startPosition,
Vector2  startControl,
Vector2  endPosition,
Vector2  endControl 
)

new Bezier2D.

Parameters
startPositionStarting point
startControlControl point of the end point
endPositionEnd point
endControlControl point of the end point

◆ Bezier2D() [3/3]

Bezier2D ( Bezier2D  bezier)

new Bezier2D.

Parameters
bezierCopy source Bezier2D

Member Function Documentation

◆ Equals() [1/2]

bool Equals ( Bezier2D  bezier)

Returns whether this is equal to Bezier2D.

Parameters
bezierValue of Bezier2D
Returns
Returns true if they are equal.

◆ Equals() [2/2]

override bool Equals ( object  obj)

Returns whether this is equal to object.

Parameters
objobject value
Returns
Returns true if they are equal.

◆ GetClosestParam()

float GetClosestParam ( Vector2  pos,
float  thresholdT = 0.001f 
)

Get a closest point on the Bezier curve.

Parameters
posposition
thresholdTthreshold of closest param.
Returns
Closest param

◆ GetClosestPoint()

Vector2 GetClosestPoint ( Vector2  pos,
float  thresholdT = 0.001f 
)

Get a closest point on the Bezier curve.

Parameters
posposition
thresholdTthreshold of closest param.
Returns
Closest point

◆ GetHashCode()

override int GetHashCode ( )

Get a hash code.

Returns
Hash code

◆ GetLinearPoint()

Vector2 GetLinearPoint ( float  t)

Get a position on the Bezier curve linear.

Parameters
t0-1 of value

◆ GetPoint() [1/2]

Vector2 GetPoint ( float  t)

Get a position on the Bezier curve.

Parameters
t0-1 of value

◆ GetPoint() [2/2]

static Vector2 GetPoint ( Vector2  startPosition,
Vector2  startControl,
Vector2  endPosition,
Vector2  endControl,
float  t 
)
static

Get a position on the Bezier curve.

Parameters
startPositionStarting point
startControlControl point of the starting point
endPositionEnd point
endControlControl point of the end point
t0-1 of value

◆ GetTangent() [1/2]

Vector2 GetTangent ( float  t)

Get a tangent on the Bezier curve.

Parameters
t0-1 of value

◆ GetTangent() [2/2]

static Vector2 GetTangent ( Vector2  startPosition,
Vector2  startControl,
Vector2  endPosition,
Vector2  endControl,
float  t 
)
static

Get a tangent on the Bezier curve.

Parameters
startPositionStarting point
startControlControl point of the starting point
endPositionEnd point
endControlControl point of the end point
t0-1 of value

◆ LinearToInterpolationParam()

float LinearToInterpolationParam ( float  t)

Returns normal interpolation value of Bezier curve from linear interpolation value t.

Parameters
t0-1 of value

◆ SetEndPoint()

bool SetEndPoint ( Vector2  position,
Vector2  control 
)

Set End point.

Parameters
positionPosition
controlControl point
Returns
true if changed.

◆ SetStartPoint()

bool SetStartPoint ( Vector2  position,
Vector2  control 
)

Set Start point.

Parameters
positionPosition
controlControl point
Returns
true if changed.

Property Documentation

◆ endControl

Vector2 endControl
getset

Control point of the end point

◆ endPosition

Vector2 endPosition
getset

End point

◆ isChanged

bool isChanged
get

Whether it has been changed

◆ length

float length
get

Length

◆ startControl

Vector2 startControl
getset

Control point of the starting point

◆ startPosition

Vector2 startPosition
getset

Starting point