@3dverse/livelink.core 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,7 @@ export type DefaultCameraComponent = {
79
79
  renderGraphRef: AssetRef<Assets.RenderGraph>;
80
80
  /**
81
81
  * Input values as described in the referenced render graph in their original JSON format.
82
- * @defaultValue [object Object]
82
+ * @defaultValue {}
83
83
  */
84
84
  dataJSON: RenderGraphDataObject;
85
85
  /**
@@ -94,12 +94,12 @@ export type DefaultCameraComponent = {
94
94
  export type DefaultCameraTransform = {
95
95
  /**
96
96
  * x, y, z position of the camera
97
- * @defaultValue 0,1,5
97
+ * @defaultValue [0,1,5]
98
98
  */
99
99
  position: Vec3;
100
100
  /**
101
101
  * Orientation of the camera expressed as a quaternion
102
- * @defaultValue 0,0,0,1
102
+ * @defaultValue [0,0,0,1]
103
103
  */
104
104
  orientation: Quat;
105
105
  };
@@ -134,17 +134,17 @@ export type Display = {
134
134
  export type Environment = {
135
135
  /**
136
136
  * Solid color used to clear the screen before drawing.
137
- * @defaultValue 0,0,0
137
+ * @defaultValue [0,0,0]
138
138
  */
139
139
  clearColor: Vec3;
140
140
  /**
141
141
  * Color of the spherical gradient at the top of the sphere.
142
- * @defaultValue 1,1,1
142
+ * @defaultValue [1,1,1]
143
143
  */
144
144
  ambientColorTop: Vec3;
145
145
  /**
146
146
  * Color of the spherical gradient at the bottom of the sphere.
147
- * @defaultValue 1,1,1
147
+ * @defaultValue [1,1,1]
148
148
  */
149
149
  ambientColorBottom: Vec3;
150
150
  };
@@ -168,12 +168,12 @@ export type Misc = {
168
168
  export type Physics = {
169
169
  /**
170
170
  * The engine that is powering the physics of the scene.
171
- * @defaultValue physx
171
+ * @defaultValue "physx"
172
172
  */
173
173
  engine: string;
174
174
  /**
175
175
  * Global gravity applied throughout the scene.
176
- * @defaultValue 0,-9.8,0
176
+ * @defaultValue [0,-9.8,0]
177
177
  */
178
178
  gravity: Vec3;
179
179
  /**
@@ -13,3 +13,4 @@ export * from "./ViewportConfigCommand";
13
13
  export * from "./SetFilterCommand";
14
14
  export * from "./ToggleFilterCommand";
15
15
  export * from "./RemoveFilterCommand";
16
+ export * from "./UpdateSceneSettingsCommand";
package/dist/library.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var r in e)d(o,r,{get:e[r],enumerable:!0})},L=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(o,i)&&i!==r&&d(o,i,{get:()=>e[i],enumerable:!(t=p(e,i))||t.enumerable});return o};var m=o=>L(d({},"__esModule",{value:!0}),o);var I={};u(I,{DynamicLoader:()=>s});module.exports=m(I);var g=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class o{static#e=null;static#o=null;static get Core(){if(!o.#e)throw new Error("Livelink core not initialized");return o.#e}static load(e="prod"){return o.#o||(o.#o=o.#r(e)),o.#o}static async#r(e){let r=await o.#i(e),{LivelinkCore:t}=await r();o.#e=t;let i={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${t.VERSION} %c ${t.COMMIT_SHA} %c${e}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${i[e]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(e){let r="https://cdn.3dverse.com/livelink/core/1.0/"+(e!=="prod"?`core.${e}.mjs`:"core.mjs");if(!g)return new Function("return import('"+r+"')");let i=await(await fetch(r)).text(),a=await new Function("return import('node:vm')")();return a.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new a.SourceTextModule(i,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(i)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.12");
1
+ "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var r in e)d(o,r,{get:e[r],enumerable:!0})},L=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(o,i)&&i!==r&&d(o,i,{get:()=>e[i],enumerable:!(t=p(e,i))||t.enumerable});return o};var m=o=>L(d({},"__esModule",{value:!0}),o);var I={};u(I,{DynamicLoader:()=>s});module.exports=m(I);var g=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class o{static#e=null;static#o=null;static get Core(){if(!o.#e)throw new Error("Livelink core not initialized");return o.#e}static load(e="prod"){return o.#o||(o.#o=o.#r(e)),o.#o}static async#r(e){let r=await o.#i(e),{LivelinkCore:t}=await r();o.#e=t;let i={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${t.VERSION} %c ${t.COMMIT_SHA} %c${e}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${i[e]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(e){let r="https://cdn.3dverse.com/livelink/core/1.0/"+(e!=="prod"?`core.${e}.mjs`:"core.mjs");if(!g)return new Function("return import('"+r+"')");let i=await(await fetch(r)).text(),a=await new Function("return import('node:vm')")();return a.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new a.SourceTextModule(i,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(i)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.14");
2
2
  //# sourceMappingURL=library.cjs.map
package/dist/library.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var a=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class e{static#e=null;static#o=null;static get Core(){if(!e.#e)throw new Error("Livelink core not initialized");return e.#e}static load(o="prod"){return e.#o||(e.#o=e.#r(o)),e.#o}static async#r(o){let r=await e.#i(o),{LivelinkCore:i}=await r();e.#e=i;let t={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${i.VERSION} %c ${i.COMMIT_SHA} %c${o}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${t[o]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(o){let r="https://cdn.3dverse.com/livelink/core/1.0/"+(o!=="prod"?`core.${o}.mjs`:"core.mjs");if(!a)return new Function("return import('"+r+"')");let t=await(await fetch(r)).text(),d=await new Function("return import('node:vm')")();return d.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new d.SourceTextModule(t,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(t)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.12");export{s as DynamicLoader};
1
+ var a=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class e{static#e=null;static#o=null;static get Core(){if(!e.#e)throw new Error("Livelink core not initialized");return e.#e}static load(o="prod"){return e.#o||(e.#o=e.#r(o)),e.#o}static async#r(o){let r=await e.#i(o),{LivelinkCore:i}=await r();e.#e=i;let t={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${i.VERSION} %c ${i.COMMIT_SHA} %c${o}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${t[o]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(o){let r="https://cdn.3dverse.com/livelink/core/1.0/"+(o!=="prod"?`core.${o}.mjs`:"core.mjs");if(!a)return new Function("return import('"+r+"')");let t=await(await fetch(r)).text(),d=await new Function("return import('node:vm')")();return d.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new d.SourceTextModule(t,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(t)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.14");export{s as DynamicLoader};
2
2
  //# sourceMappingURL=library.mjs.map
@@ -1,7 +1,7 @@
1
1
  export * from "./internal/GatewayEvents";
2
2
  export * from "./internal/EditorEvents";
3
3
  import type { AssetLoadingStatusEvent, AudioReceivedEvent, ClientConnectedEvent, ClientsDisconnectedEvent, FrameReceivedEvent, ScriptEventTriggeredEvent } from "./internal/GatewayEvents";
4
- import type { EntitiesCreatedEvent, EntitiesDeletedEvent, EntitiesUpdatedEvent, EntityVisibilityChangedEvent, LoadingCompletedEvent, SceneSettingsUpdatedEvent } from "./internal/EditorEvents";
4
+ import type { EntitiesCreatedEvent, EntitiesDeletedEvent, EntitiesUpdatedEvent, EntityVisibilityChangedEvent, SceneInfoLoadedEvent, SceneSettingsUpdatedEvent } from "./internal/EditorEvents";
5
5
  /**
6
6
  *
7
7
  */
@@ -39,7 +39,7 @@ export type CoreEvents = {
39
39
  "on-audio-received": AudioReceivedEvent;
40
40
  "on-script-event-received": ScriptEventTriggeredEvent;
41
41
  "on-asset-loading-status-received": AssetLoadingStatusEvent;
42
- "on-loading-completed": LoadingCompletedEvent;
42
+ "on-scene-info-loaded": SceneInfoLoadedEvent;
43
43
  "on-entities-created": EntitiesCreatedEvent;
44
44
  "on-entities-updated": EntitiesUpdatedEvent;
45
45
  "on-entities-deleted": EntitiesDeletedEvent;
@@ -6,6 +6,7 @@ import { SessionInterface } from "./SessionInterface";
6
6
  import { TypedEventTarget } from "./TypedEventTarget";
7
7
  import { CoreEvents } from "./CoreEvents";
8
8
  import type { EntityResponse, FindEntityOptions, FindEntityQuery, UpdateEntityCommand } from "./EntityUtils";
9
+ import type { SceneSettingsManifest } from "../_prebuild/engine_types/SceneSettingsRecord";
9
10
  /**
10
11
  * The LivelinkCore is the main entry point to the Livelink API.
11
12
  *
@@ -246,4 +247,11 @@ export declare class LivelinkCore extends TypedEventTarget<CoreEvents> {
246
247
  getChildren({ entity_rtid }: {
247
248
  entity_rtid: RTID;
248
249
  }): Promise<Array<EntityCore>>;
250
+ /**
251
+ *
252
+ */
253
+ updateSceneSettings({ updated_settings, persist, }: {
254
+ updated_settings: SceneSettingsManifest;
255
+ persist: boolean;
256
+ }): Promise<void>;
249
257
  }
@@ -1,6 +1,7 @@
1
1
  import type { ComponentName, ComponentsRecord, EntityCore } from "../../_prebuild/engine_types/ComponentsRecord";
2
2
  import { SceneSettingsManifest } from "../../_prebuild/engine_types/SceneSettingsRecord";
3
- import type { RTID, UUID } from "../types";
3
+ import { EntityResponse } from "../EntityUtils";
4
+ import type { RTID, UUID, Vec3 } from "../types";
4
5
  /**
5
6
  *
6
7
  */
@@ -38,6 +39,46 @@ export type Emitter = {
38
39
  */
39
40
  session_id: UUID;
40
41
  };
42
+ /**
43
+ *
44
+ */
45
+ export type SceneInfo = {
46
+ /**
47
+ * The global AABB of the scene.
48
+ */
49
+ readonly aabb: {
50
+ /**
51
+ * Global AABB minimum corner.
52
+ */
53
+ readonly min: Vec3;
54
+ /**
55
+ * Global AABB maximum corner.
56
+ */
57
+ readonly max: Vec3;
58
+ };
59
+ /**
60
+ * The number of entities in the scene.
61
+ */
62
+ readonly entity_count: number;
63
+ /**
64
+ * An array of entities that are present in the scene at the root level.
65
+ */
66
+ readonly root_entities: Array<EntityResponse>;
67
+ /**
68
+ * The number of triangles in the scene.
69
+ */
70
+ readonly triangle_count: {
71
+ /**
72
+ * Number of triangles in the scene, excluding sub-scenes.
73
+ */
74
+ readonly direct: number;
75
+ /**
76
+ * Total number of triangles in the scene including sub-scenes.
77
+ * Each sub-scene's triangles are counted recursively.
78
+ */
79
+ readonly total: number;
80
+ };
81
+ };
41
82
  /**
42
83
  *
43
84
  */
@@ -50,11 +91,11 @@ export declare class EditionEvent extends Event {
50
91
  /**
51
92
  *
52
93
  */
53
- export declare class LoadingCompletedEvent extends Event {
94
+ export declare class SceneInfoLoadedEvent extends Event {
54
95
  /**
55
- * An array of entities that are present in the scene at the root level.
96
+ * Information about the scene.
56
97
  */
57
- readonly root_entities: Array<EntityCore>;
98
+ readonly scene_info: SceneInfo;
58
99
  }
59
100
  /**
60
101
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dverse/livelink.core",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "3dverse Livelink Core types.",
5
5
  "main": "./dist/library.cjs",
6
6
  "module": "./dist/library.mjs",