import {CameraPath} from '@xeokit/xeokit-sdk/src/viewer/scene/camera/CameraPath.js'
CameraPath
Extends:
Defines a sequence of frames along which a CameraPathAnimation can animate a Camera.
See CameraPathAnimation for usage.
Constructor Summary
Public Constructor | ||
public |
constructor(owner: Component, cfg: *) |
Member Summary
Public Members | ||
public get |
eyeCurve: SplineCurve: * Gets the SplineCurve along which Camera#eye travels. |
|
public get |
frames: {t:Number, eye:Object, look:Object, up: Object}[]: * Gets the camera frames in this CameraPath. |
|
public get |
lookCurve: SplineCurve: * Gets the SplineCurve along which Camera#look travels. |
|
public get |
upCurve: SplineCurve: * Gets the SplineCurve along which Camera#up travels. |
Method Summary
Public Methods | ||
public |
Adds a frame to this CameraPath, specified as values for eye, look and up vectors at a given time instant. |
|
public |
addFrames(frames: {t:Number, eye:Object, look:Object, up: Object}[]) Adds multiple frames to this CameraPath, each frame specified as a set of values for eye, look and up vectors at a given time instant. |
|
public |
Removes all frames from this CameraPath. |
|
public |
Sets the position of the Camera to a position interpolated within this CameraPath at the given time instant. |
|
public |
sampleFrame(t: Number, eye: Number[], look: Number[], up: Number[]) Gets eye, look and up vectors on this CameraPath at a given instant. |
|
public |
Adds a frame to this CameraPath, given as the current position of the Camera. |
|
public |
smoothFrameTimes(duration: Number) Given a total duration (in seconds) for this CameraPath, recomputes the time instant at each frame so that, when animated by CameraPathAnimation, the Camera will move along the path at a constant rate. |
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. |
Public Constructors
public constructor(owner: Component, cfg: *) source
Override:
Component#constructorParams:
Name | Type | Attribute | Description |
owner | Component |
|
Owner component. When destroyed, the owner will destroy this CameraPath as well. |
cfg | * |
|
{*} Configuration |
cfg.id | String |
|
Optional ID, unique among all components in the parent Scene, generated automatically when omitted. |
cfg.frames | {t:Number, eye:Object, look:Object, up: Object}[] |
|
Initial sequence of frames. |
Public Members
public get frames: {t:Number, eye:Object, look:Object, up: Object}[]: * source
Gets the camera frames in this CameraPath.
Return:
{t:Number, eye:Object, look:Object, up: Object}[] | The frames on this CameraPath. |
Public Methods
public addFrame(t: Number, eye: Number[], look: Number[], up: Number[]) source
Adds a frame to this CameraPath, specified as values for eye, look and up vectors at a given time instant.
Params:
Name | Type | Attribute | Description |
t | Number | Time instant for the new frame. |
|
eye | Number[] | A three-element vector specifying the eye position for the new frame. |
|
look | Number[] | A three-element vector specifying the look position for the new frame. |
|
up | Number[] | A three-element vector specifying the up vector for the new frame. |
public addFrames(frames: {t:Number, eye:Object, look:Object, up: Object}[]) source
Adds multiple frames to this CameraPath, each frame specified as a set of values for eye, look and up vectors at a given time instant.
Params:
Name | Type | Attribute | Description |
frames | {t:Number, eye:Object, look:Object, up: Object}[] | Frames to add to this CameraPath. |
public loadFrame(t: Number) source
Sets the position of the Camera to a position interpolated within this CameraPath at the given time instant.
Params:
Name | Type | Attribute | Description |
t | Number | Time instant. |
public sampleFrame(t: Number, eye: Number[], look: Number[], up: Number[]) source
Gets eye, look and up vectors on this CameraPath at a given instant.
public saveFrame(t: Number) source
Adds a frame to this CameraPath, given as the current position of the Camera.
Params:
Name | Type | Attribute | Description |
t | Number | Time instant for the new frame. |
public smoothFrameTimes(duration: Number) source
Given a total duration (in seconds) for this CameraPath, recomputes the time instant at each frame so that, when animated by CameraPathAnimation, the Camera will move along the path at a constant rate.
Params:
Name | Type | Attribute | Description |
duration | Number | The total duration for this CameraPath. |