@relu-interactives/spatial-ecs 0.3.11 → 0.3.13

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.
Files changed (38) hide show
  1. package/dist/{XRHandPose-C-KJeYcJ.d.cts → XRHandPose-9mVZVU3K.d.cts} +32 -8
  2. package/dist/{XRHandPose-B6I4y1lj.d.ts → XRHandPose-To0260Lc.d.ts} +32 -8
  3. package/dist/{chunk-TXEGYR76.js → chunk-3LDQ4GVZ.js} +7 -5
  4. package/dist/chunk-3LDQ4GVZ.js.map +1 -0
  5. package/dist/{chunk-Y3AC3VZ2.js → chunk-CHZQ4NXP.js} +3 -3
  6. package/dist/{chunk-Y3AC3VZ2.js.map → chunk-CHZQ4NXP.js.map} +1 -1
  7. package/dist/{chunk-FSHRPY65.js → chunk-JHFBEMXM.js} +4 -4
  8. package/dist/{chunk-FSHRPY65.js.map → chunk-JHFBEMXM.js.map} +1 -1
  9. package/dist/{chunk-KLU2M43M.js → chunk-N2634D4W.js} +112 -29
  10. package/dist/chunk-N2634D4W.js.map +1 -0
  11. package/dist/components/index.cjs +5 -3
  12. package/dist/components/index.cjs.map +1 -1
  13. package/dist/components/index.d.cts +2 -2
  14. package/dist/components/index.d.ts +2 -2
  15. package/dist/components/index.js +1 -1
  16. package/dist/docs/guide/vr-and-hand-poses.md +5 -3
  17. package/dist/factories/index.cjs +5 -3
  18. package/dist/factories/index.cjs.map +1 -1
  19. package/dist/factories/index.d.cts +1 -1
  20. package/dist/factories/index.d.ts +1 -1
  21. package/dist/factories/index.js +3 -3
  22. package/dist/{index-DPRnnSI-.d.cts → index-BPKDsVF7.d.cts} +1 -1
  23. package/dist/{index-Bi_wIo1o.d.ts → index-BbXqWyEZ.d.ts} +34 -0
  24. package/dist/{index-CEZp7qLL.d.ts → index-Wzs-8FYa.d.ts} +1 -1
  25. package/dist/{index-jlgDou9W.d.cts → index-lqw8BM6E.d.cts} +34 -0
  26. package/dist/index.cjs +113 -28
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +5 -5
  29. package/dist/index.d.ts +5 -5
  30. package/dist/index.js +8 -8
  31. package/dist/systems/index.cjs +113 -28
  32. package/dist/systems/index.cjs.map +1 -1
  33. package/dist/systems/index.d.cts +1 -1
  34. package/dist/systems/index.d.ts +1 -1
  35. package/dist/systems/index.js +3 -3
  36. package/package.json +1 -1
  37. package/dist/chunk-KLU2M43M.js.map +0 -1
  38. package/dist/chunk-TXEGYR76.js.map +0 -1
@@ -1342,10 +1342,10 @@ type XRInteractableOptions = {
1342
1342
  maxScale?: number;
1343
1343
  /** Authored hand-holds. Empty means grab anywhere. */
1344
1344
  attachPoints?: XrAttachPoint[];
1345
- /** Carry the hand's momentum into the body on release. */
1346
- throwOnRelease?: boolean;
1345
+ /** Hand the object the velocity it was moving with when released. */
1346
+ applyVelocityOnRelease?: boolean;
1347
1347
  /** Scales released velocity; >1 makes throws feel stronger than real life. */
1348
- throwStrength?: number;
1348
+ velocityScale?: number;
1349
1349
  /** Feedback shown while a pointer is on the object. */
1350
1350
  hoverBehavior?: XrHoverBehavior;
1351
1351
  /** Outline colour used by the `color` and `both` behaviours. */
@@ -1398,10 +1398,16 @@ declare class XRInteractableComponent extends Component {
1398
1398
  maxScale: number;
1399
1399
  /** Authored hand-holds; empty means grab anywhere. */
1400
1400
  attachPoints: XrAttachPoint[];
1401
- /** Carry hand momentum into the body on release. */
1402
- throwOnRelease: boolean;
1401
+ /**
1402
+ * Hand the object the velocity it was moving with when released.
1403
+ *
1404
+ * Applies to every release, not just a deliberate throw — letting go while
1405
+ * your hand drifts should nudge the object, which is why this is not called
1406
+ * "throw".
1407
+ */
1408
+ applyVelocityOnRelease: boolean;
1403
1409
  /** Multiplier on released velocity. */
1404
- throwStrength: number;
1410
+ velocityScale: number;
1405
1411
  /** Feedback shown while a pointer is on the object. */
1406
1412
  hoverBehavior: XrHoverBehavior;
1407
1413
  /** Outline colour for the `color` and `both` behaviours. */
@@ -1484,6 +1490,14 @@ declare class XRRigComponent extends Component {
1484
1490
  * currently reports avoids shipping a build that shows nothing on half the
1485
1491
  * hardware. `none` hands presentation entirely to the author's own meshes.
1486
1492
  */
1493
+ /**
1494
+ * When the pointer ray is drawn.
1495
+ *
1496
+ * `interacting` (default) shows it only while the hand is pointing at something
1497
+ * it could act on, so the scene isn't permanently criss-crossed with rays
1498
+ * implying everything is clickable. `always` suits scenes built around pointing.
1499
+ */
1500
+ type XrRayVisibility = "always" | "interacting" | "never";
1487
1501
  type XrInteractorType = "hands" | "controllers" | "both" | "none";
1488
1502
  /**
1489
1503
  * Look applied to tracked-hand meshes.
@@ -1508,7 +1522,12 @@ type XRInteractorOptions = {
1508
1522
  /** Emissive strength, used by `neon`. */
1509
1523
  handEmissiveIntensity?: number;
1510
1524
  /** Draw the aim ray from each hand. */
1511
- showRay?: boolean;
1525
+ /** When the pointer ray is drawn. */
1526
+ rayVisibility?: XrRayVisibility;
1527
+ /** Pointer ray colour. */
1528
+ rayColor?: string;
1529
+ /** Pointer ray thickness (diameter), metres. */
1530
+ rayThickness?: number;
1512
1531
  };
1513
1532
  /**
1514
1533
  * Configures what the user sees as their hands, and hosts custom hand content.
@@ -1532,7 +1551,12 @@ declare class XRInteractorComponent extends Component {
1532
1551
  /** Emissive strength for glowing presets. */
1533
1552
  handEmissiveIntensity: number;
1534
1553
  /** Draw the aim ray from each hand. */
1535
- showRay: boolean;
1554
+ /** When the pointer ray is drawn. */
1555
+ rayVisibility: XrRayVisibility;
1556
+ /** Pointer ray colour. */
1557
+ rayColor: string;
1558
+ /** Pointer ray thickness (diameter), metres. */
1559
+ rayThickness: number;
1536
1560
  constructor(options?: XRInteractorOptions);
1537
1561
  }
1538
1562
  /**
@@ -1342,10 +1342,10 @@ type XRInteractableOptions = {
1342
1342
  maxScale?: number;
1343
1343
  /** Authored hand-holds. Empty means grab anywhere. */
1344
1344
  attachPoints?: XrAttachPoint[];
1345
- /** Carry the hand's momentum into the body on release. */
1346
- throwOnRelease?: boolean;
1345
+ /** Hand the object the velocity it was moving with when released. */
1346
+ applyVelocityOnRelease?: boolean;
1347
1347
  /** Scales released velocity; >1 makes throws feel stronger than real life. */
1348
- throwStrength?: number;
1348
+ velocityScale?: number;
1349
1349
  /** Feedback shown while a pointer is on the object. */
1350
1350
  hoverBehavior?: XrHoverBehavior;
1351
1351
  /** Outline colour used by the `color` and `both` behaviours. */
@@ -1398,10 +1398,16 @@ declare class XRInteractableComponent extends Component {
1398
1398
  maxScale: number;
1399
1399
  /** Authored hand-holds; empty means grab anywhere. */
1400
1400
  attachPoints: XrAttachPoint[];
1401
- /** Carry hand momentum into the body on release. */
1402
- throwOnRelease: boolean;
1401
+ /**
1402
+ * Hand the object the velocity it was moving with when released.
1403
+ *
1404
+ * Applies to every release, not just a deliberate throw — letting go while
1405
+ * your hand drifts should nudge the object, which is why this is not called
1406
+ * "throw".
1407
+ */
1408
+ applyVelocityOnRelease: boolean;
1403
1409
  /** Multiplier on released velocity. */
1404
- throwStrength: number;
1410
+ velocityScale: number;
1405
1411
  /** Feedback shown while a pointer is on the object. */
1406
1412
  hoverBehavior: XrHoverBehavior;
1407
1413
  /** Outline colour for the `color` and `both` behaviours. */
@@ -1484,6 +1490,14 @@ declare class XRRigComponent extends Component {
1484
1490
  * currently reports avoids shipping a build that shows nothing on half the
1485
1491
  * hardware. `none` hands presentation entirely to the author's own meshes.
1486
1492
  */
1493
+ /**
1494
+ * When the pointer ray is drawn.
1495
+ *
1496
+ * `interacting` (default) shows it only while the hand is pointing at something
1497
+ * it could act on, so the scene isn't permanently criss-crossed with rays
1498
+ * implying everything is clickable. `always` suits scenes built around pointing.
1499
+ */
1500
+ type XrRayVisibility = "always" | "interacting" | "never";
1487
1501
  type XrInteractorType = "hands" | "controllers" | "both" | "none";
1488
1502
  /**
1489
1503
  * Look applied to tracked-hand meshes.
@@ -1508,7 +1522,12 @@ type XRInteractorOptions = {
1508
1522
  /** Emissive strength, used by `neon`. */
1509
1523
  handEmissiveIntensity?: number;
1510
1524
  /** Draw the aim ray from each hand. */
1511
- showRay?: boolean;
1525
+ /** When the pointer ray is drawn. */
1526
+ rayVisibility?: XrRayVisibility;
1527
+ /** Pointer ray colour. */
1528
+ rayColor?: string;
1529
+ /** Pointer ray thickness (diameter), metres. */
1530
+ rayThickness?: number;
1512
1531
  };
1513
1532
  /**
1514
1533
  * Configures what the user sees as their hands, and hosts custom hand content.
@@ -1532,7 +1551,12 @@ declare class XRInteractorComponent extends Component {
1532
1551
  /** Emissive strength for glowing presets. */
1533
1552
  handEmissiveIntensity: number;
1534
1553
  /** Draw the aim ray from each hand. */
1535
- showRay: boolean;
1554
+ /** When the pointer ray is drawn. */
1555
+ rayVisibility: XrRayVisibility;
1556
+ /** Pointer ray colour. */
1557
+ rayColor: string;
1558
+ /** Pointer ray thickness (diameter), metres. */
1559
+ rayThickness: number;
1536
1560
  constructor(options?: XRInteractorOptions);
1537
1561
  }
1538
1562
  /**
@@ -1964,8 +1964,8 @@ var _XRInteractableComponent = class _XRInteractableComponent extends Component
1964
1964
  this.attachPoints = (options?.attachPoints ?? []).map(
1965
1965
  (point) => createAttachPoint(point)
1966
1966
  );
1967
- this.throwOnRelease = options?.throwOnRelease ?? true;
1968
- this.throwStrength = options?.throwStrength ?? 1;
1967
+ this.applyVelocityOnRelease = options?.applyVelocityOnRelease ?? true;
1968
+ this.velocityScale = options?.velocityScale ?? 1;
1969
1969
  this.hoverBehavior = options?.hoverBehavior ?? "color";
1970
1970
  this.hoverColor = options?.hoverColor ?? "#4da3ff";
1971
1971
  this.hoverScale = options?.hoverScale ?? 1.06;
@@ -2009,7 +2009,9 @@ var _XRInteractorComponent = class _XRInteractorComponent extends Component {
2009
2009
  this.handColor = options?.handColor ?? "#e8b48a";
2010
2010
  this.handOpacity = options?.handOpacity ?? 1;
2011
2011
  this.handEmissiveIntensity = options?.handEmissiveIntensity ?? 0;
2012
- this.showRay = options?.showRay ?? true;
2012
+ this.rayVisibility = options?.rayVisibility ?? "interacting";
2013
+ this.rayColor = options?.rayColor ?? "#4da3ff";
2014
+ this.rayThickness = options?.rayThickness ?? 6e-3;
2013
2015
  }
2014
2016
  };
2015
2017
  __name(_XRInteractorComponent, "XRInteractorComponent");
@@ -2228,5 +2230,5 @@ __name(_XRHandPoseComponent, "XRHandPoseComponent");
2228
2230
  var XRHandPoseComponent = _XRHandPoseComponent;
2229
2231
 
2230
2232
  export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSE_CURLS, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VRTeleportAreaComponent, VideoComponent, XRHandPoseComponent, XRInteractableComponent, XRInteractorComponent, XRInteractorSideComponent, XRRigComponent, cloneHandPose, components_exports, createAttachPoint, createHandPoseEntry, defaultMaterialValue, getHandPosePreset, handPoseDefinitionFor, handPoseFromCurls, normalizePhysicsState, setPhysicsLiveRef };
2231
- //# sourceMappingURL=chunk-TXEGYR76.js.map
2232
- //# sourceMappingURL=chunk-TXEGYR76.js.map
2233
+ //# sourceMappingURL=chunk-3LDQ4GVZ.js.map
2234
+ //# sourceMappingURL=chunk-3LDQ4GVZ.js.map