Constructor Summary
| Public Constructor | ||
| public |
constructor(owner: Component, cfg: *, cfg: Object) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public get |
Gets the approximate length of this Curve. |
|
| public |
|
|
| public set |
Sets the progress along this Curve. |
|
| public get |
Gets the progress along this Curve. |
|
| public get |
Gets the tangent on this Curve at position Curve#t. |
|
Method Summary
| Public Methods | ||
| 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: *): * |
|
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 |
viewer: Viewer 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. |
|
Public Constructors
public constructor(owner: Component, cfg: *, cfg: Object) source
Override:
Component#constructorParams:
| Name | Type | Attribute | Description |
| owner | Component |
|
Owner component. When destroyed, the owner will destroy this Curve as well. |
| cfg | * |
|
Configs |
| cfg.id | String |
|
Optional ID, unique among all components in the parent Curve, generated automatically when omitted. |
| cfg | Object |
|
Configs for this Curve. |
| cfg.t | Number |
|
Current position on this Curve, in range between |
Public Members
public cacheArcLengths: * source
public get length: Number: * source
Gets the approximate length of this Curve.
This method calculates the length by discretizing Curve into hardcoded number of straight segments. Then it sums lengths of these straight segments.
If you need more control over the precision of the length calculation, we strongly encourage you to build your own custom function.
public set t(value: Number) source
Sets the progress along this Curve.
Automatically clamps to range [0..1].
Default value is 0.
Public Methods
public getPoints(divisions: Number): * source
Samples points on this Curve, at the given number of equally-spaced divisions.
Params:
| Name | Type | Attribute | Description |
| divisions | Number | The number of divisions. |
Return:
| * | Array of sampled 3D points. |
public getTangent(t: Number): Number[] source
Returns a normalized tangent vector on this Curve at the given position.
Params:
| Name | Type | Attribute | Description |
| t | Number | Position to get tangent at. |
public getUToTMapping(u: *, distance: *): * source
Params:
| Name | Type | Attribute | Description |
| u | * | ||
| distance | * |
Return:
| * |
Reference
Source
