SDK3DVerse

SDK3DVerse

SDK3DVerse entrypoints

Namespaces

actionMap
engineAPI
notifier
webAPI

Methods

close()

Close the current connection to the session

connectToEditor(editorURLopt)

Connect to the editor to offer edition capabilities

Parameters:
Name Type Attributes Description
editorURL string <optional>

Default to 'wss://3dverse.com/editor-backend/'

disableInputs()

Disable input events on canvas (mouse and keyboard).

enableInputs()

Enable input events on the canvas (mouse and keyboard).

getClientUUID() → {string}

Get current clientUUID

Returns:

clientUUID - The client unique identifier.

Type
string

getKey(key) → {object}

Get the down state of the specified keyboard key

Parameters:
Name Type Description
key string

character key

Returns:

value.down - True if key is pressed, false otherwise.

Type
object

getVersion() → {string}

Get the SDK version.

Returns:

version

Type
string

(async) installExtension(extensionClass, parameters) → {SDK3DVerse_ExtensionInterface}

Installs one or more of the available 3dverse sdk extensions

Parameters:
Name Type Description
extensionClass SDK3DVerse_ExtensionInterface

SDK3DVerse_Gizmos_Ext / SDK3DVerse_LabelDisplay_Ext / SDK3DVerse_ClientDisplay_Ext

parameters object

Extensions parameters, see documentation for each extension.

Returns:

instanciated extension

Type
SDK3DVerse_ExtensionInterface

isConnected() → {Boolean}

Check if the client is actually connected or not

Returns:

Connected state

Type
Boolean

onConnected() → {Promise}

Return a promise, which will be resolved once the loading ended.

Returns:

Promise object

Type
Promise

onEditorConnected() → {Promise}

Return a promise, which will be resolved once the editor will be connected.

Returns:

Promise object

Type
Promise

setInactivityCallback(callback)

Set a callback that is called when the client is inactive.

Parameters:
Name Type Description
callback function

setInputRelayFrequency(inputRelayFrequency)

Set frequency at which inputs (keyboards, gamepads, touchscreen...) are relayed to the server

Parameters:
Name Type Description
inputRelayFrequency number

in milliseconds

setResolution(width, height, streamingScaleopt)

Set real time rendering display area resolution

Parameters:
Name Type Attributes Description
width number

Width in pixels

height number

Height in pixels

streamingScale number <optional>

Scale applied on streaming resolution

setupDisplay(canvasElement)

Setup display canvas

Parameters:
Name Type Description
canvasElement domElement

Canvas element used to display real time rendering

setUpperAlignment(value)

Set to true to force the canvas to align on the next largest dimension during a setResolution. In that case a container that will center the canvas and hide the overflow is suggested. For example :

.canvas-container
{
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
Parameters:
Name Type Description
value bool

setViewports(viewports)

Set viewports

Parameters:
Name Type Description
viewports Array.<viewport_info>

Array of viewport_info objects

startStreamer(connectionInfo, hardwareDecodingopt, hevcSupportopt)

Start the streaming engine to receive real time rendering data

Parameters:
Name Type Attributes Description
connectionInfo object

Connection information returned by startSession or joinSession

hardwareDecoding boolean <optional>

Set to true to decode frame through a video tag element, default to false.

hevcSupport boolean <optional>

Set to true to enable HEVC decoding, default to true if hardwareDecoding is set to true.

updateControllerSetting(controllerSettings)

Update controller settings such as speed or sensitivity.

Parameters:
Name Type Description
controllerSettings object