Path
A complex curved path constructed from various Curve subtypes.
- A Path can be constructed from these Curve subtypes: SplineCurve, CubicBezierCurve and QuadraticBezierCurve.
- You can sample a Path#point and a Curve#tangent vector on a Path for any given value of Path#t in the range
[0..1]
. - When you set Path#t on a Path, its Path#point and Curve#tangent properties will update accordingly.
Constructor Summary
Public Constructor | ||
public |
constructor(owner: Component, cfg: *) |
Member Summary
Public Members | ||
public set |
Sets the Curves in this Path. |
|
public get |
curves: *: * Gets the Curves in this Path. |
|
public get |
Length of this Path, which is the cumulative length of all Curves currently in Path#curves. |
|
public get |
Gets point on this Path corresponding to the current value of Path#t. |
|
public set |
Sets the current point of progress along this Path. |
|
public get |
Gets the current point of progress along this Path. |
Method Summary
Public Methods | ||
public |
Adds a Curve to this Path. |
|
public |
destroy() Destroys this Path. |
|
public |
Gets a point on this Path corresponding to the given progress position. |
Inherited Summary
From class Component | ||
public get |
The Component that owns the lifecycle of this Component, if any. |
|
public |
True as soon as this Component has been destroyed |
|
public |
ID of this Component, unique within the Scene. |
|
public |
meta: * Arbitrary, user-defined metadata on this component. |
|
public |
The parent Scene that contains this Component. |
|
public |
The viewer that contains this Scene. |
|
public |
clear() Destroys all Components that are owned by this. |
|
public |
destroy() Destroys this component. |
|
public |
Logs an error for this component to the JavaScript console. |
|
public |
Fires an event on this component. |
|
public |
Returns true if there are any subscribers to the given event on this component. |
|
public |
Tests if this component is of the given type, or is a subclass of the given type. |
|
public |
Logs a console debugging message for this component. |
|
public |
Cancels an event subscription that was previously made with Component#on or Component#once. |
|
public |
Subscribes to an event on this component. |
|
public |
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd. |
|
public |
scheduleTask(task: *) Schedule a task to perform on the next browser interval |
|
public |
Logs a warning for this component to the JavaScript console. |
From class Curve | ||
public get |
Gets the length of this Curve. |
|
public get |
Gets the progress along this Curve. |
|
public set |
Sets the progress along this Curve. |
|
public get |
Gets the tangent on this Curve at position Curve#t. |
|
public |
|
|
public |
|
|
public |
getPointAt(u: *): * |
|
public |
Samples points on this Curve, at the given number of equally-spaced divisions. |
|
public |
getTangent(t: Number): Number[] Returns a normalized tangent vector on this Curve at the given position. |
|
public |
getUToTMapping(u: *, distance: *): * |
Public Constructors
public constructor(owner: Component, cfg: *) source
Override:
Curve#constructorParams:
Name | Type | Attribute | Description |
owner | Component |
|
Owner component. When destroyed, the owner will destroy this SectionPlane as well. |
cfg | * |
|
Path configuration |
cfg.id | String |
|
Optional ID, unique among all components in the parent Scene, generated automatically when omitted. |
cfg.paths | String [] |
|
IDs or instances of {{#crossLink "path"}}{{/crossLink}} subtypes to add to this Path. |
cfg.t | Number |
|
Current position on this Path, in range between 0..1. |
Public Members
public get length: Number: * source
Length of this Path, which is the cumulative length of all Curves currently in Path#curves.
Override:
Curve#lengthpublic get point: Number[]: * source
Gets point on this Path corresponding to the current value of Path#t.