Capítulo 342 de 859

Chapter 342: CurvePath

Core Idea

A base class extending Curve. CurvePath is simply an array of connected curves, but retains the API of a curve.

Key Concepts

  • autoClose : boolean: Whether the path should automatically be closed by a line curve.
  • curves : Array.<Curve>: An array of curves defining the path.

Reference Tables

Constructor

Signature
new CurvePath()

Properties

PropertyDescription
.autoClose : booleanWhether the path should automatically be closed by a line curve.
.curves : Array.<Curve>An array of curves defining the path.

Methods

MethodDescription
.add( curve : Curve )Adds a curve to this curve path.
.closePath() : CurvePathAdds a line curve to close the path.
.getCurveLengths() : Array.<number>Returns list of cumulative curve lengths of the defined curves.
`.getPoint( t : number, optionalTarget : Vector2Vector3 ) : Vector2

Key Takeaways

  1. CurvePath extends: Curve
  2. Most relevant properties: autoClose, curves.
  3. Key methods: add, closePath, getCurveLengths, getPoint.

Connects To