Skip to main content

Class: LivelinkCore

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:29

The LivelinkCore is the main entry point to the Livelink API.

It implements the communication protocol with the 3dverse server.

It has two main responsibilities:

  • It manages the connection to the 3dverse server.
  • It provides methods to interact with the 3dverse server as defined in the Livelink protocol.

An activity watcher is embedded to monitor the activity of the client. If the client is inactive for a certain amount of time, the connection is closed. See ActivityWatcher.

Events​

See CoreEvents.

Extends​

Constructors​

Constructor​

new LivelinkCore(): LivelinkCore;

Returns​

LivelinkCore

Inherited from​

TypedEventTarget<CoreEvents>.constructor

Accessors​

activity_watcher​

Get Signature​

get activity_watcher(): ActivityWatcher;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:34

Get the gateway activity watcher.

Returns​

ActivityWatcher


latency​

Get Signature​

get latency(): number;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:38

Get the latency of the connection in milliseconds.

Returns​

number

Methods​

connect()​

connect(params: {
session: SessionInterface;
}): Promise<void>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:45

Connect to the session

Parameters​

ParameterTypeDescription
params{ session: SessionInterface; }-
params.sessionSessionInterfaceThe session to connect to. MUST be joinable.

Returns​

Promise<void>


disconnect()​

disconnect(): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:51

Closes the connections to the 3dverse server.

Returns​

void


sanitizeComponentValue()​

sanitizeComponentValue<_ComponentName>(__namedParameters: {
component_name: _ComponentName;
value: | Partial<ComponentType<_ComponentName>>
| undefined;
}): ComponentType<_ComponentName>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:55

Type Parameters​

Type Parameter
_ComponentName extends keyof ComponentsRecord

Parameters​

ParameterType
__namedParameters{ component_name: _ComponentName; value: | Partial<ComponentType<_ComponentName>> | undefined; }
__namedParameters.component_name_ComponentName
__namedParameters.value| Partial<ComponentType<_ComponentName>> | undefined

Returns​

ComponentType<_ComponentName>


setSimulationState()​

setSimulationState(params: {
state: "start_simulation" | "pause_simulation" | "stop_simulation";
}): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:65

Set the simulation state.

Parameters​

ParameterTypeDescription
params{ state: "start_simulation" | "pause_simulation" | "stop_simulation"; }-
params.state"start_simulation" | "pause_simulation" | "stop_simulation"The state of the simulation.

Returns​

void


createEntities()​

createEntities(params: {
components: ComponentsManifest[];
delete_on_client_disconnection: boolean;
is_transient: boolean;
}): Promise<EntityCore[]>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:79

Create entities.

Parameters​

ParameterTypeDescription
params{ components: ComponentsManifest[]; delete_on_client_disconnection: boolean; is_transient: boolean; }-
params.componentsComponentsManifest[]The components to use to create the entities.
params.delete_on_client_disconnectionbooleanWhether to delete the entities when the client disconnects.
params.is_transientbooleanWhether the entities are transient.

Returns​

Promise<EntityCore[]>

A promise that resolves to the created entities.

Throws​

If any entity could not be created.


updateEntities()​

updateEntities(params: {
update_commands: UpdateEntityCommand[];
persist: boolean;
}): Promise<void>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:91

Update entities.

Parameters​

ParameterTypeDescription
params{ update_commands: UpdateEntityCommand[]; persist: boolean; }-
params.update_commandsUpdateEntityCommand[]The update commands to apply to the entities.
params.persistbooleanWhether to persist the changes.

Returns​

Promise<void>


findEntities()​

findEntities(__namedParameters: {
query: FindEntityQuery;
options?: {
include_ancestors?: boolean;
};
}): Promise<EntityResponse[]>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:98

Find entities based on a query.

Parameters​

ParameterTypeDescription
__namedParameters{ query: FindEntityQuery; options?: { include_ancestors?: boolean; }; }-
__namedParameters.queryFindEntityQuery-
__namedParameters.options?{ include_ancestors?: boolean; }-
__namedParameters.options.include_ancestors?booleanWhether to include the ancestors of the found entities. This will incur an additional query to fetch the ancestors for each entity found.

Returns​

Promise<EntityResponse[]>


configureClient()​

configureClient(params: {
client_config: ClientConfig;
}): Promise<ClientConfigResponse>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:111

Send the configuration requested by the client.

Parameters​

ParameterTypeDescription
params{ client_config: ClientConfig; }-
params.client_configClientConfigThe configuration requested by the client.

Returns​

Promise<ClientConfigResponse>


sendInputState()​

sendInputState(params: {
input_state: InputStateData;
}): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:123

Send the input state of an input device.

Parameters​

ParameterTypeDescription
params{ input_state: InputStateData; }-
params.input_stateInputStateDataThe input state of the input device.

Returns​

void


resize()​

resize(params: {
size: Vec2;
}): Promise<ResizeResponse>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:135

Resize the remote rendering surface.

Parameters​

ParameterTypeDescription
params{ size: Vec2; }-
params.sizeVec2The new size of the remote rendering surface.

Returns​

Promise<ResizeResponse>


suspend()​

suspend(): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:141

Suspend the rendering client. The server won't send any more frames until the client is resumed.

Returns​

void


resume()​

resume(): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:145

Resume the rendering client.

Returns​

void


setViewports()​

setViewports(params: {
viewport_configs: ViewportConfig[];
}): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:152

Set the viewports configuration of the current client.

Parameters​

ParameterTypeDescription
params{ viewport_configs: ViewportConfig[]; }-
params.viewport_configsViewportConfig[]The viewports configuration.

Returns​

void


castScreenSpaceRay()​

castScreenSpaceRay(params: {
screenSpaceRayQuery: ScreenSpaceRayQuery;
}): Promise<ScreenSpaceRayResponse>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:165

Cast a screen space ray.

Parameters​

ParameterTypeDescription
params{ screenSpaceRayQuery: ScreenSpaceRayQuery; }-
params.screenSpaceRayQueryScreenSpaceRayQueryThe screen space ray query.

Returns​

Promise<ScreenSpaceRayResponse>

A promise that resolves to the screen space ray response.


highlightEntities()​

highlightEntities(params: {
highlightEntitiesMessage: HighlightEntitiesData;
}): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:174

Mark entities as selected.

Parameters​

ParameterTypeDescription
params{ highlightEntitiesMessage: HighlightEntitiesData; }-
params.highlightEntitiesMessageHighlightEntitiesDataThe message to highlight entities.

Returns​

void


fireEvent()​

fireEvent(fireEventMessage: FireEventData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:182

11 - Fire an event.

Parameters​

ParameterTypeDescription
fireEventMessageFireEventDataThe message to fire an event.

Returns​

void


setFilter()​

setFilter(setFilterMessage: SetFilterData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:190

Experimental

16 - Set a filter.

Parameters​

ParameterTypeDescription
setFilterMessageSetFilterDataThe message to set a filter.

Returns​

void


removeFilter()​

removeFilter(removeFilterMessage: RemoveFilterData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:198

Experimental

17 - Remove a filter.

Parameters​

ParameterTypeDescription
removeFilterMessageRemoveFilterDataThe message to remove a filter.

Returns​

void


toggleFilter()​

toggleFilter(toggleFilterMessage: ToggleFilterData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:206

Experimental

18 - Toggle a filter.

Parameters​

ParameterTypeDescription
toggleFilterMessageToggleFilterDataThe message to toggle a filter.

Returns​

void


assignClientToScript()​

assignClientToScript(assignClientToScriptMessage: AssignClientToScriptData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:212

20 - Assign a client to a script. The target script will consume the specified client's inputs.

Parameters​

ParameterTypeDescription
assignClientToScriptMessageAssignClientToScriptDataThe message to assign a client to a script.

Returns​

void


sendSkeletonPose()​

sendSkeletonPose(skeletonPoseMessage: SkeletonPoseData): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:218

24 - Send a skeleton pose.

Parameters​

ParameterTypeDescription
skeletonPoseMessageSkeletonPoseDataThe message to send a skeleton pose.

Returns​

void


deleteEntities()​

deleteEntities(params: {
entity_uuids: UUID[];
}): Promise<void>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:225

Delete entities.

Parameters​

ParameterTypeDescription
params{ entity_uuids: UUID[]; }-
params.entity_uuidsUUID[]The UUIDs of the entities to delete.

Returns​

Promise<void>


setEntityVisibility()​

setEntityVisibility(params: {
entity_rtid: RTID;
is_visible: boolean;
}): Promise<void>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:235

Set the visibility of the specified entity.

Parameters​

ParameterTypeDescription
params{ entity_rtid: RTID; is_visible: boolean; }-
params.entity_rtidRTIDThe RTID of the entity to set the visibility.
params.is_visiblebooleanThe visibility of the entity.

Returns​

Promise<void>


getChildren()​

getChildren(params: {
entity_rtid: RTID;
}): Promise<EntityCore[]>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:247

Resolve the children of the specified entity. Children are the direct children of the entity.

Parameters​

ParameterTypeDescription
params{ entity_rtid: RTID; }-
params.entity_rtidRTIDThe RTID of the entity to resolve the children.

Returns​

Promise<EntityCore[]>

A promise that resolves to the children of the entity or an empty array if the entity has no children.


updateSceneSettings()​

updateSceneSettings(__namedParameters: {
updated_settings: SceneSettingsManifest;
persist: boolean;
}): Promise<void>;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/LivelinkCore.d.ts:253

Parameters​

ParameterType
__namedParameters{ updated_settings: SceneSettingsManifest; persist: boolean; }
__namedParameters.updated_settingsSceneSettingsManifest
__namedParameters.persistboolean

Returns​

Promise<void>


addEventListener()​

addEventListener<_EventName>(
event_name: _EventName,
listener: (event: CoreEvents[_EventName]) => void,
options?: boolean | AddEventListenerOptions): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/TypedEventTarget.d.ts:9

Type Parameters​

Type Parameter
_EventName extends | "on-entity-visibility-changed" | "on-entities-created" | "on-entities-deleted" | "on-scene-settings-updated" | "on-disconnected" | "on-inactivity-warning" | "on-activity-detected" | "on-client-connected" | "on-clients-disconnected" | "on-frame-received" | "on-audio-received" | "on-script-event-received" | "on-asset-loading-status-received" | "on-scene-info-loaded" | "on-entities-updated"

Parameters​

ParameterType
event_name_EventName
listener(event: CoreEvents[_EventName]) => void
options?boolean | AddEventListenerOptions

Returns​

void

Inherited from​

TypedEventTarget.addEventListener;

removeEventListener()​

removeEventListener<_EventName>(
event_name: _EventName,
listener: (event: CoreEvents[_EventName]) => void,
options?: boolean | EventListenerOptions): void;

Defined in: node_modules/@3dverse/livelink.core/dist/sources/TypedEventTarget.d.ts:13

Type Parameters​

Type Parameter
_EventName extends | "on-entity-visibility-changed" | "on-entities-created" | "on-entities-deleted" | "on-scene-settings-updated" | "on-disconnected" | "on-inactivity-warning" | "on-activity-detected" | "on-client-connected" | "on-clients-disconnected" | "on-frame-received" | "on-audio-received" | "on-script-event-received" | "on-asset-loading-status-received" | "on-scene-info-loaded" | "on-entities-updated"

Parameters​

ParameterType
event_name_EventName
listener(event: CoreEvents[_EventName]) => void
options?boolean | EventListenerOptions

Returns​

void

Inherited from​

TypedEventTarget.removeEventListener;