Handle Cameras.
Methods
getActiveViewports() → {Array.<SDK3DVerse_Viewport>}
Retrieve an array of active viewports
Returns:
viewports - array of active viewports
- Type
- Array.<SDK3DVerse_Viewport>
getClientCameras(clientUUID) → {Array.<SDK3DVerse_Entity>}
Get client's cameras.
Parameters:
Name | Type | Description |
---|---|---|
clientUUID |
SDK3DVerse_Entity | Client unique identifier |
Returns:
cameras
- Type
- Array.<SDK3DVerse_Entity>
getViewportByID() → {SDK3DVerse_Viewport}
Retrieve an existing viewport with his ID.
Returns:
viewport object
- Type
- SDK3DVerse_Viewport
onMouseEvent(eventName, listener)
Register the listener function to the event named eventName. The listener will be called with the viewport concerned by the event.
Parameters:
Name | Type | Description |
---|---|---|
eventName |
string | The name of the event |
listener |
function | The callback function |
refresh()
Trigger a server-side frame re-draw.
stopTravel()
Stop the current camera traveling and re-enable inputs.
teleport(clientUUID, speed, viewportopt) → {Promise}
Animate camera traveling from current point of view to first viewport of the specified client uuid.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
clientUUID |
string | Client unique identifier |
|
speed |
number | traveling duration will be computed as distance / speed |
|
viewport |
SDK3DVerse_Viewport |
<optional> |
on which camera travelling will occur, default to the current viewport. |
Returns:
A Promise that resolves when the travel is over.
- Type
- Promise
travel(viewport, destinationPosition, destinationOrientation, speed, startPositionopt, startOrientationopt) → {Promise}
Animate camera traveling from current point of view to specified destination and orientation at specified speed. Disable inputs during travel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
viewport |
SDK3DVerse_Viewport | on which camera travelling will occur |
|
destinationPosition |
vec3 | final destination of camera |
|
destinationOrientation |
quaternion | final destination of camera |
|
speed |
number | traveling duration will be computed as distance / speed |
|
startPosition |
vec3 |
<optional> |
initial position of camera, defaults to current position |
startOrientation |
quaternion |
<optional> |
initial orientation of camera, defaults to current orientation |
Returns:
A Promise that resolves when the travel is over.
- Type
- Promise