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
TypedEventTarget
<CoreEvents
>
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
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
Parameter | Type | Description |
---|---|---|
params | { session : SessionInterface ; editor_url : string ; } | |
params.session | SessionInterface | The session to connect to. MUST be joinable. |
params.editor_url | string | The 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
Parameter | Type |
---|---|
__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
Parameter | Type | Description |
---|---|---|
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
Parameter | Type | Description |
---|---|---|
params | { components : ComponentsManifest []; delete_on_client_disconnection : boolean ; is_transient : boolean ; } | |
params.components | ComponentsManifest [] | The components to use to create the entities. |
params.delete_on_client_disconnection | boolean | Whether to delete the entities when the client disconnects. |
params.is_transient | boolean | Whether 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
Parameter | Type |
---|---|
__namedParameters | { update_commands : UpdateEntityCommand []; persist : boolean ; } |
__namedParameters.update_commands | UpdateEntityCommand [] |
__namedParameters.persist | boolean |
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
Parameter | Type | Description |
---|---|---|
__namedParameters | { query : FindEntityQuery ; options : { include_ancestors : boolean ; }; } | - |
__namedParameters.query | FindEntityQuery | - |
__namedParameters.options ? | { include_ancestors : boolean ; } | - |
__namedParameters.options.include_ancestors ? | boolean | Whether 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
Parameter | Type | Description |
---|---|---|
params | { client_config : ClientConfig ; } | |
params.client_config | ClientConfig | The 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
Parameter | Type | Description |
---|---|---|
params | { input_state : InputStateData ; } | |
params.input_state | InputStateData | The 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
Parameter | Type | Description |
---|---|---|
params | { size : Vec2 ; } | |
params.size | Vec2 | The 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
Parameter | Type | Description |
---|---|---|
params | { viewport_configs : ViewportConfig []; } | |
params.viewport_configs | ViewportConfig [] | 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
Parameter | Type | Description |
---|---|---|
params | { screenSpaceRayQuery : ScreenSpaceRayQuery ; } | |
params.screenSpaceRayQuery | ScreenSpaceRayQuery | The 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
Parameter | Type | Description |
---|---|---|
params | { highlightEntitiesMessage : HighlightEntitiesData ; } | |
params.highlightEntitiesMessage | HighlightEntitiesData | The 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
Parameter | Type | Description |
---|---|---|
fireEventMessage | FireEventData | The 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
Parameter | Type | Description |
---|---|---|
setFilterMessage | SetFilterData | The 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
Parameter | Type | Description |
---|---|---|
removeFilterMessage | RemoveFilterData | The 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
Parameter | Type | Description |
---|---|---|
toggleFilterMessage | ToggleFilterData | The 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
Parameter | Type | Description |
---|---|---|
assignClientToScriptMessage | AssignClientToScriptData | The 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
Parameter | Type | Description |
---|---|---|
skeletonPoseMessage | SkeletonPoseData | The 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
Parameter | Type | Description |
---|---|---|
params | { entity_uuids : UUID []; } | |
params.entity_uuids | UUID [] | 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
Parameter | Type | Description |
---|---|---|
params | { entity_rtid : RTID ; is_visible : boolean ; } | |
params.entity_rtid | RTID | The RTID of the entity to set the visibility. |
params.is_visible | boolean | The 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
Parameter | Type | Description |
---|---|---|
params | { entity_rtid : RTID ; } | |
params.entity_rtid | RTID | The 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.