CameraManager
Methods
centerOn
async centerOn(object: AdsumObject3D, animated = true: boolean, options = null: CameraCenterOnOptions|object|null): Promise<boolean, Error>
Center the camera an AdsumObject3D
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
object | AdsumObject3D | Yes | - | The AdsumObject3D to center on, or null if you want the default site view |
animated | boolean | No | true | |
options | CameraCenterOnOptions | object | null | No | null | Define the CameraCenterOnOptions to use, if null it will use the one provided while instanciating AdsumWebMap |
Returns:
Resolve with a boolean indicating if the animation has been completed, or false if it has been interrupted and forcing the animation to complete in one frame.
Type: Promise<boolean, Error>
centerOnFloor
async centerOnFloor(floor: ?FloorObject, animated = true: boolean): Promise<boolean, Error>
Center the camera on the Floor using the defined Calibration on the Studio.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
floor | ?FloorObject | Yes | - | The floor to center on, or null if you want the default site view |
animated | boolean | No | true |
Returns:
Resolve with a boolean indicating if the animation has been completed, or false if it has been interrupted and forcing the animation to complete in one frame.
Type: Promise<boolean, Error>
centerOnObjects
async centerOn(objects: AdsumObject3D[], animated = true: boolean, options = null: CameraCenterOnOptions|object|null): Promise<boolean, Error>
Center the camera on AdsumObject3Ds
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
objects | AdsumObject3D[] | Yes | - | AdsumObject3Ds to center on |
animated | boolean | No | true | |
options | CameraCenterOnOptions | object | null | No | null | Define the CameraCenterOnOptions to use, if null it will use the one provided while instanciating AdsumWebMap |
Returns:
Resolve with a boolean indicating if the animation has been completed, or false if it has been interrupted and forcing the animation to complete in one frame.
Type: Promise<boolean, Error>
getState
async getState(): Promise<{ target: { x: number, y: number, z: number }, altitude: number, azimuth: number, distance: number }, Error>
Get the current camera state
Returns:
Type: Promise < { target: { x: number, y: number, z: number }, altitude: number, azimuth: number, distance: number }, Error >
move
async move(state: object, animated = true: boolean, time = 700: number): Promise<boolean, Error>
Move the camera to another state
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
state | object | Yes | - | The new state |
state.altitude | ?number | No | - | Altitude angle in degrees that the camera should take, if null or undefined will be preserved |
state.azimuth | ?number | No | - | Azimuth angle in degrees that the camera should take, if null or undefined the azimuth will be preserved |
state.distance | ?number | No | - | Camera distance to current focus in meters |
animated | boolean | No | true | |
time | number | No | 700 | Animation duration in milliseconds |
Returns:
Resolve with a boolean indicating if the animation has been completed, or false if it has been interrupted and forcing the animation to complete in one frame.
Type: Promise<boolean, Error>