Skip to main content

LivelinkCore

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

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

Accessors

activity_watcher

Get Signature

get activity_watcher(): ActivityWatcher

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

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:37

Get the latency of the connection in milliseconds.

Returns

number

Methods

connect()

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

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

Connect to the session

Parameters

ParameterTypeDescription
params{ session: SessionInterface; editor_url: string; }
params.sessionSessionInterfaceThe session to connect to. MUST be joinable.
params.editor_urlstringThe URL of the editor.

Returns

Promise<void>


disconnect()

disconnect(): void

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

Closes the connections to the 3dverse server.

Returns

void


sanitizeComponentValue()

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

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

Type Parameters

Type Parameter
_ComponentName extends keyof ComponentsRecord

Parameters

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

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:66

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:80

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(__namedParameters: {
update_commands: UpdateEntityCommand[];
persist: boolean;
}): Promise<void>

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

Update entities.

Parameters

ParameterType
__namedParameters{ update_commands: UpdateEntityCommand[]; persist: boolean; }
__namedParameters.update_commandsUpdateEntityCommand[]
__namedParameters.persistboolean

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:95

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:108

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:120

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:132

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:138

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:142

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:149

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:162

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:171

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:179

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:187

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:195

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:203

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:209

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:215

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:222

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:232

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:244

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.