Curve

Module: engine.geometry
new game.Curve(sx, sy, ex, ey, h1x, h1y, h2x, h2y)

Parameters:

  • sx Number
  • sy Number
  • ex Number
  • ey Number
  • h1x Number
  • h1y Number
  • h2x Number
  • h2y Number

Properties

end Vector

End position of curve.

handle1 Vector

Position of first control point.

handle2 Vector

Position of second control point.

start Vector

Start position of curve.

Methods

_calcEnd(t, p) Number

(No description yet)

Parameters:

  • t Number
  • p Number
_calcHandle1(t, p) Number

(No description yet)

Parameters:

  • t Number
  • p Number
_calcHandle2(t, p) Number

(No description yet)

Parameters:

  • t Number
  • p Number
_calcStart(t, p) Number

(No description yet)

Parameters:

  • t Number
  • p Number
_interpolate(percent, s, h1, h2, e) Number

Get point from curve.

Parameters:

  • percent Number
  • s Number
  • h1 Number
  • h2 Number
  • e Number
point(percent, [out]) Vector

Get point from curve.

Parameters:

  • percent Number

    Location of the point. 0 is start and 1 is the end of the curve.

  • out Vector (optional)

    Optional vector, where the values are set.