SpeckleControls
Abstract base class for all camera controls implementations
Accessors
enabled
Gets/sets the enabled state of the controls
Returns: boolean
options
Gets/sets any options the controls implementation might need
Returns: Partial<Record<string, unknown>>
targetCamera
Sets the camera that will be controls by this controls instance. It only accepts PerspectiveCamera or OrthographicCamera instances
Returns: void
up
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
Disposes of the controls implementation
Returns: void
fitToSphere
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
- sphere: Sphere
Returns: void
fromPositionAndTarget
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
Gets the current goal position of the control’s target camera
Returns: Vector3
getTarget
Gets the current goal look position of the control’s target camera
Returns: Vector3
isStationary
Determines whether the control’s camera target is stationary or not.
Returns: boolean
jumpToGoal
Immediately sets the control’s target camera position and rotation to their goal values. Effectively skipping over any potential camera animation
Returns: void
update
The control’s update loop
Parameters
- delta(optional): Frame delta time
Returns: void