Reference Source
public class | source

Path

Extends:

ComponentCurve → Path

A complex curved path constructed from various Curve subtypes.

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

point: Number[]: *

Gets point on this Path corresponding to the current value of Path#t.

public set

t(value: Number)

Sets the current point of progress along this Path.

public get

t: Number: *

Gets the current point of progress along this Path.

Method Summary

Public Methods
public

addCurve(curve: Curve)

Adds a Curve to this Path.

public

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

Destroys this component.

public

error(message: String)

Logs an error for this component to the JavaScript console.

public

fire(event: String, value: Object, forget: Boolean)

Fires an event on this component.

public

Returns true if there are any subscribers to the given event on this component.

public

isType(type: *): *: Boolean

Tests if this component is of the given type, or is a subclass of the given type.

public

log(message: String)

Logs a console debugging message for this component.

public

off(subId: String)

Cancels an event subscription that was previously made with Component#on or Component#once.

public

on(event: String, callback: Function, scope: Object): String

Subscribes to an event on this component.

public

once(event: String, callback: Function, scope: Object)

Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

public

warn(message: String)

Logs a warning for this component to the JavaScript console.

From class Curve
public get

Gets the length of this Curve.

public get

t: Number: *

Gets the progress along this Curve.

public set

t(value: Number)

Sets the progress along this Curve.

public get

tangent: Number[]: *

Gets the tangent on this Curve at position Curve#t.

public
public
public

getPointAt(u: *): *

public

getPoints(divisions: Number): *

Samples points on this Curve, at the given number of equally-spaced divisions.

public

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#constructor

Params:

NameTypeAttributeDescription
owner Component
  • optional

Owner component. When destroyed, the owner will destroy this SectionPlane as well.

cfg *
  • optional

Path configuration

cfg.id String
  • optional

Optional ID, unique among all components in the parent Scene, generated automatically when omitted.

cfg.paths String []
  • optional
  • default: []

IDs or instances of {{#crossLink "path"}}{{/crossLink}} subtypes to add to this Path.

cfg.t Number
  • optional
  • default: 0

Current position on this Path, in range between 0..1.

Public Members

public set curves source

Sets the Curves in this Path.

Default value is [].

public get curves: *: * source

Gets the Curves in this Path.

Return:

*

the Curves in this path.

public get length: Number: * source

Length of this Path, which is the cumulative length of all Curves currently in Path#curves.

Override:

Curve#length

Return:

Number

Length of this path.

public get point: Number[]: * source

Gets point on this Path corresponding to the current value of Path#t.

Return:

Number[]

The point.

public set t(value: Number) source

Sets the current point of progress along this Path.

Automatically clamps to range [0..1].

Default value is 0.

Override:

Curve#t

public get t: Number: * source

Gets the current point of progress along this Path.

Default value is 0.

Override:

Curve#t

Return:

Number

The current point of progress.

Public Methods

public addCurve(curve: Curve) source

Adds a Curve to this Path.

Params:

NameTypeAttributeDescription
curve Curve

The Curve to add.

public destroy() source

Destroys this Path.

Override:

Component#destroy

public getPoint(t: Number): Number[] source

Gets a point on this Path corresponding to the given progress position.

Params:

NameTypeAttributeDescription
t Number

Indicates point of progress along this curve, in the range [0..1].

Return:

Number[]