@3dverse/livelink.core 1.1.3 → 1.1.4

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.
@@ -68,6 +68,10 @@ export type ComponentsRecord = {
68
68
  * A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.
69
69
  */
70
70
  constraint: Components.Constraint;
71
+ /**
72
+ *
73
+ */
74
+ constraint_actuator: Components.ConstraintActuator;
71
75
  /**
72
76
  * Culling geometry. Add this component in addition to another geometry component (e.g. box geometry, sphere geometry, etc.) to enable culling geometry.
73
77
  */
@@ -160,6 +164,10 @@ export type ComponentsRecord = {
160
164
  * Rigid body parameters.
161
165
  */
162
166
  rigid_body: Components.RigidBody;
167
+ /**
168
+ * Rigid body actuator. Represent forces and torques that are applied during a simulation step. All values are reset each frame.
169
+ */
170
+ rigid_body_actuator: Components.RigidBodyActuator;
163
171
  /**
164
172
  * Reference to a scene.
165
173
  */
@@ -43,6 +43,10 @@ export type SceneSettingsRecord = {
43
43
  * Renderer settings
44
44
  */
45
45
  renderer?: SceneSettings.Renderer;
46
+ /**
47
+ * Settings to apply whenever simulation is active
48
+ */
49
+ simulation?: SceneSettings.Simulation;
46
50
  /**
47
51
  * Sound settings
48
52
  */
@@ -79,7 +79,7 @@ export type AnimationSequenceController = {
79
79
  * The play state of the animation.
80
80
  * @defaultValue 0
81
81
  */
82
- playState: Int32;
82
+ playState: UInt8;
83
83
  /**
84
84
  * The offset to seek at next frame. Must be in the [0, 1] range.
85
85
  * @defaultValue -1
@@ -192,35 +192,10 @@ export type CollisionGeometryRef = {
192
192
  */
193
193
  export type Constraint = {
194
194
  /**
195
- * Motion along the X axis
195
+ * Unlock motion along/around the specified axis.
196
196
  * @defaultValue 0
197
197
  */
198
- motionAlongX: Int32;
199
- /**
200
- * Motion along the Y axis
201
- * @defaultValue 0
202
- */
203
- motionAlongY: Int32;
204
- /**
205
- * Motion along the Z axis
206
- * @defaultValue 0
207
- */
208
- motionAlongZ: Int32;
209
- /**
210
- * Motion around the X axis
211
- * @defaultValue 0
212
- */
213
- motionAroundX: Int32;
214
- /**
215
- * Motion around the Y axis
216
- * @defaultValue 0
217
- */
218
- motionAroundY: Int32;
219
- /**
220
- * Motion around the Z axis
221
- * @defaultValue 0
222
- */
223
- motionAroundZ: Int32;
198
+ unlockedMotion: UInt32;
224
199
  /**
225
200
  * The lower distance of the limit.
226
201
  * @defaultValue 0,0,0
@@ -242,7 +217,7 @@ export type Constraint = {
242
217
  */
243
218
  motionLimitSpringDamping: Vec3;
244
219
  /**
245
- * The limit angle from the Y-axis and the Z-axis of the constraint frame. The cone limit is used if either or both swing axes are limited. The extents are symmetrical and measured in the frame of the parent. If only one swing degree of freedom is limited, the corresponding value from the cone limit defines the limit range.
220
+ * The limit angle from the Y-axis and the Z-axis of the constraint frame. The cone limit is used if either or both swing axes are limited. The extents are symmetrical and measured in the frame of the parent. If only one swing degree of freedom is limited, the corresponding value from the cone limit defines the limit range. An angle of 0° will not restrict the rotation around the axis. The maximum value for each angle is 180°.
246
221
  * @defaultValue 0,0
247
222
  */
248
223
  swingLimitAngle: Vec2;
@@ -271,51 +246,66 @@ export type Constraint = {
271
246
  * @defaultValue 0
272
247
  */
273
248
  twistSpringDamping: Float;
249
+ };
250
+ /**
251
+ *
252
+ */
253
+ export type ConstraintActuator = {
274
254
  /**
275
255
  * If greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
276
256
  * @defaultValue 0,0,0
277
257
  */
278
- linearDriveStiffness: Vec3;
258
+ linearStiffness: Vec3;
279
259
  /**
280
260
  * If greater than zero, this is the damping of the limit spring.
281
261
  * @defaultValue 0,0,0
282
262
  */
283
- linearDriveDamping: Vec3;
263
+ linearDamping: Vec3;
284
264
  /**
285
265
  * The maximum impulse or force that can be exerted by the drive. -1 for no limit.
286
266
  * @defaultValue -1,-1,-1
287
267
  */
288
- linearDriveForceLimit: Vec3;
268
+ linearForceLimit: Vec3;
289
269
  /**
290
270
  * If greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
291
271
  * @defaultValue 0,0,0
292
272
  */
293
- angularDriveStiffness: Vec3;
273
+ angularStiffness: Vec3;
294
274
  /**
295
275
  * If greater than zero, this is the damping of the limit spring.
296
276
  * @defaultValue 0,0,0
297
277
  */
298
- angularDriveDamping: Vec3;
278
+ angularDamping: Vec3;
299
279
  /**
300
280
  * The maximum impulse or force that can be exerted by the drive. -1 for no limit.
301
281
  * @defaultValue -1,-1,-1
302
282
  */
303
- angularDriveForceLimit: Vec3;
283
+ angularForceLimit: Vec3;
304
284
  /**
305
285
  * The drive type
306
286
  * @defaultValue 1
307
287
  */
308
- driveType: Int8;
288
+ type: Int32;
289
+ /**
290
+ * The goal position for linear drive.
291
+ * @defaultValue 0,0,0
292
+ */
293
+ goalPosition: Vec3;
294
+ /**
295
+ * The goal orientation for angular drive.
296
+ * @defaultValue 0,0,0,1
297
+ */
298
+ goalOrientation: Quat;
309
299
  /**
310
300
  * The goal velocity for linear drive.
311
301
  * @defaultValue 0,0,0
312
302
  */
313
- driveLinearVelocity: Vec3;
303
+ linearVelocity: Vec3;
314
304
  /**
315
305
  * The goal velocity for angular drive.
316
306
  * @defaultValue 0,0,0
317
307
  */
318
- driveAngularVelocity: Vec3;
308
+ angularVelocity: Vec3;
319
309
  };
320
310
  /**
321
311
  * Culling geometry. Add this component in addition to another geometry component (e.g. box geometry, sphere geometry, etc.) to enable culling geometry.
@@ -772,20 +762,25 @@ export type RigidBody = {
772
762
  */
773
763
  angularDamping: Float;
774
764
  /**
775
- *
776
- * @defaultValue 0,0,0
765
+ * The maximum linear velocity permitted for this body in m/s. Must be non-negative.
766
+ * @defaultValue 10000000000000000
777
767
  */
778
- force: Vec3;
768
+ maxLinearVelocity: Float;
779
769
  /**
780
- *
781
- * @defaultValue 0,0,0
770
+ * The maximum angular velocity permitted for this body in rad/s. Must be non-negative.
771
+ * @defaultValue 100
782
772
  */
783
- torque: Vec3;
773
+ maxAngularVelocity: Float;
784
774
  /**
785
775
  * The type of collision detection to use for this rigid body.
786
776
  * @defaultValue 0
787
777
  */
788
- collisionDetection: Int32;
778
+ collisionDetection: UInt8;
779
+ /**
780
+ * Lock motion along/around the specified axis.
781
+ * @defaultValue 0
782
+ */
783
+ lockedAxis: UInt8;
789
784
  /**
790
785
  * Controls whether rigid body is affected by gravity.
791
786
  * @defaultValue true
@@ -797,6 +792,46 @@ export type RigidBody = {
797
792
  */
798
793
  isKinematic: boolean;
799
794
  };
795
+ /**
796
+ * Rigid body actuator. Represent forces and torques that are applied during a simulation step. All values are reset each frame.
797
+ */
798
+ export type RigidBodyActuator = {
799
+ /**
800
+ * Sets the body's linear velocity
801
+ * @defaultValue 0,0,0
802
+ */
803
+ linearVelocity: Vec3;
804
+ /**
805
+ * Sets the body's angular velocity
806
+ * @defaultValue 0,0,0
807
+ */
808
+ angularVelocity: Vec3;
809
+ /**
810
+ * Force to apply to the body (mass * length / time^2, a force)
811
+ * @defaultValue 0,0,0
812
+ */
813
+ force: Vec3;
814
+ /**
815
+ * Impulse to apply to the body (mass * length / time, i.e., force * time)
816
+ * @defaultValue 0,0,0
817
+ */
818
+ impulsiveForce: Vec3;
819
+ /**
820
+ * Torque to apply to the body
821
+ * @defaultValue 0,0,0
822
+ */
823
+ torque: Vec3;
824
+ /**
825
+ * Impulsive torque to apply to the body
826
+ * @defaultValue 0,0,0
827
+ */
828
+ impulsiveTorque: Vec3;
829
+ /**
830
+ * Which attributes are set for the next frame. 1 = linearVelocity, 2 = angularVelocity, 4 = force, 8 = impulsiveForce, 16 = torque, 32 = impulsiveTorque
831
+ * @defaultValue 0
832
+ */
833
+ flags: UInt8;
834
+ };
800
835
  /**
801
836
  * Reference to a scene.
802
837
  */
@@ -891,30 +926,65 @@ export type SoundRef = {
891
926
  */
892
927
  value: AssetRef<Assets.Sound>;
893
928
  /**
894
- * Volume from 0.0f to 1.0f.
929
+ * Volume from 0.0f to 1.0.
895
930
  * @defaultValue 1
896
931
  */
897
932
  volume: Float;
898
933
  /**
899
- * Pan. -1.0f is left, 1.0f is right.
934
+ * Pan. -1.0 is left, 1.0 is right.
900
935
  * @defaultValue 0
901
936
  */
902
937
  pan: Float;
903
938
  /**
904
- * The speed at which the sound will play. 1.0f is normal.
939
+ * The speed at which the sound will play. 1.0 is normal.
905
940
  * @defaultValue 1
906
941
  */
907
942
  playSpeed: Float;
943
+ /**
944
+ * If distance from audio souce is < minDistance, audio is at max volume.
945
+ * @defaultValue 5
946
+ */
947
+ minDistance: Float;
948
+ /**
949
+ * If distance from audio souce is >= maxDistance, audio is inaudible.
950
+ * @defaultValue 50
951
+ */
952
+ maxDistance: Float;
953
+ /**
954
+ * Reduce or enhance the doppler effect.
955
+ * @defaultValue 1
956
+ */
957
+ dopplerFactor: Float;
958
+ /**
959
+ * Attenuation rolloff factor.
960
+ * @defaultValue 1
961
+ */
962
+ attenuationRolloffFactor: Float;
963
+ /**
964
+ * Attenuation Model.
965
+ * @defaultValue 0
966
+ */
967
+ attenuationModel: UInt8;
968
+ /**
969
+ * Behavior of a sound when it becomes inaudible.
970
+ * @defaultValue 0
971
+ */
972
+ inaudibleBehavior: UInt8;
973
+ /**
974
+ * The play state of the sound.
975
+ * @defaultValue 0
976
+ */
977
+ playState: UInt8;
908
978
  /**
909
979
  * Whether or not the sound loops.
910
980
  * @defaultValue false
911
981
  */
912
982
  looping: boolean;
913
983
  /**
914
- * The play state of the sound.
915
- * @defaultValue 0
984
+ * Whether or not the sound plays automatically when the simulation starts.
985
+ * @defaultValue false
916
986
  */
917
- playState: Int32;
987
+ autoPlayOnStart: boolean;
918
988
  };
919
989
  /**
920
990
  * Sphere geometry.
@@ -3,7 +3,7 @@
3
3
  * This file has been generated automatically from ftl-schemas
4
4
  */
5
5
  import type { Assets } from "../../sources/core";
6
- import type { Vec3, UInt32, Float, Int32, Quat, AssetRef } from "../../sources/types";
6
+ import type { Vec3, UInt32, Float, Int32, Quat, AssetRef, EntityRef } from "../../sources/types";
7
7
  /**
8
8
  * Settings for debug lines
9
9
  */
@@ -232,6 +232,19 @@ export type Renderer = {
232
232
  */
233
233
  enableRayTracing?: boolean;
234
234
  };
235
+ /**
236
+ * Settings to apply whenever simulation is active
237
+ */
238
+ export type Simulation = {
239
+ /**
240
+ * Camera used when starting the simulation
241
+ */
242
+ mainCamera?: EntityRef;
243
+ /**
244
+ * Scripts which the client will be automatically attached
245
+ */
246
+ clientScripts?: Array<EntityRef>;
247
+ };
235
248
  /**
236
249
  * Sound settings
237
250
  */
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.3");
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.4");
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.3");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.4");export{s as DynamicLoader};
2
2
  //# sourceMappingURL=library.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dverse/livelink.core",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "3dverse Livelink Core types.",
5
5
  "main": "./dist/library.cjs",
6
6
  "module": "./dist/library.mjs",
@@ -31,7 +31,7 @@
31
31
  "devDependencies": {
32
32
  "@eslint/js": "^9.17.0",
33
33
  "@types/node": "^22.5.3",
34
- "esbuild": "^0.20.1",
34
+ "esbuild": "^0.25.4",
35
35
  "eslint": "^9.17.0",
36
36
  "globals": "^15.14.0",
37
37
  "http-server": "^14.1.1",