Accessors

enabled

abstract get enabled(): boolean
abstract set enabled(value: boolean)
Gets/sets the enabled state of the controls Returns: boolean

options

abstract get options(): Partial<Record<string, unknown>>
abstract set options(value: Partial<Record<string, unknown>>)
Gets/sets any options the controls implementation might need Returns: Partial<Record<string, unknown>>

targetCamera

abstract set targetCamera(target: PerspectiveCamera | OrthographicCamera)
Sets the camera that will be controls by this controls instance. It only accepts PerspectiveCamera or OrthographicCamera instances Returns: void

up

public get up()
public set up(value: Vector3)
Sets the up vector this controls instance will use to compute the camera position and rotation. Default value is (0, 1, 0), however speckle data is represented in a coordinate system where up is (0, 0, 1) Returns: Vector3

Methods

dispose

abstract dispose(): void
Disposes of the controls implementation Returns: void

fitToSphere

abstract fitToSphere(sphere: Sphere): void
All controls implementations need to be able to position and orient themselves according to an input Sphere
The sphere argument is provided in a coordinate system where up is (0, 1, 0)
Parameters Returns: void

fromPositionAndTarget

abstract fromPositionAndTarget(position: Vector3, target: Vector3): void
Sets the controller’s goal position and rotation based on a given location and another location to ‘lookAt’. All controls implementation need to be able to position and orient themselves according to these two vectors. Parameters
  • position: The desired camera position as Vector3
  • target: A position in space where the camera should ‘lookAt’ as Vector3 Returns: void

getPosition

abstract getPosition(): Vector3
Gets the current goal position of the control’s target camera Returns: Vector3

getTarget

abstract getTarget(): Vector3
Gets the current goal look position of the control’s target camera Returns: Vector3

isStationary

abstract isStationary(): boolean
Determines whether the control’s camera target is stationary or not. Returns: boolean

jumpToGoal

abstract jumpToGoal(): void
Immediately sets the control’s target camera position and rotation to their goal values. Effectively skipping over any potential camera animation Returns: void

update

abstract update(delta?: number): boolean
The control’s update loop Parameters
  • delta(optional): Frame delta time
Returns: void