Reference Source
public class | source

CameraPath

Extends:

Component → CameraPath

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

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

Gets the SplineCurve along which Camera#look travels.

public get

Gets the SplineCurve along which Camera#up travels.

Method Summary

Public Methods
public

addFrame(t: Number, eye: Number[], look: Number[], up: Number[])

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.

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: *

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.

Public Constructors

public constructor(owner: Component, cfg: *) source

Override:

Component#constructor

Params:

NameTypeAttributeDescription
owner Component
  • optional

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

cfg *
  • optional

{*} Configuration

cfg.id String
  • optional

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

cfg.frames {t:Number, eye:Object, look:Object, up: Object}[]
  • optional

Initial sequence of frames.

Public Members

public get eyeCurve: SplineCurve: * source

Gets the SplineCurve along which Camera#eye travels.

Return:

SplineCurve

The SplineCurve for Camera#eye.

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 get lookCurve: SplineCurve: * source

Gets the SplineCurve along which Camera#look travels.

Return:

SplineCurve

The SplineCurve for Camera#look.

public get upCurve: SplineCurve: * source

Gets the SplineCurve along which Camera#up travels.

Return:

SplineCurve

The SplineCurve for Camera#up.

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
frames {t:Number, eye:Object, look:Object, up: Object}[]

Frames to add to this CameraPath.

public clearFrames() source

Removes all frames from 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:

NameTypeAttributeDescription
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.

Params:

NameTypeAttributeDescription
t Number

Time instant.

eye Number[]

The eye position to update.

look Number[]

The look position to update.

up Number[]

The up vector to update.

public saveFrame(t: Number) source

Adds a frame to this CameraPath, given as the current position of the Camera.

Params:

NameTypeAttributeDescription
t Number

Time instant for the new frame.