@relu-interactives/spatial-ecs 0.3.9 → 0.3.10

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-CxPz8VBp.d.ts → XRHandPose-CjacJ_16.d.ts} +70 -1
  2. package/dist/{XRHandPose-VuSbe4iz.d.cts → XRHandPose-hAtj9wm-.d.cts} +70 -1
  3. package/dist/{chunk-KIKIWCEB.js → chunk-5UVBEAGW.js} +4 -4
  4. package/dist/{chunk-KIKIWCEB.js.map → chunk-5UVBEAGW.js.map} +1 -1
  5. package/dist/{chunk-KVGGAL5V.js → chunk-ELSZ5U3F.js} +23 -3
  6. package/dist/chunk-ELSZ5U3F.js.map +1 -0
  7. package/dist/{chunk-L5BP727H.js → chunk-NJOO7NO6.js} +3 -3
  8. package/dist/{chunk-L5BP727H.js.map → chunk-NJOO7NO6.js.map} +1 -1
  9. package/dist/{chunk-W5TSYV6Q.js → chunk-O2HSIZFC.js} +572 -185
  10. package/dist/chunk-O2HSIZFC.js.map +1 -0
  11. package/dist/components/index.cjs +20 -0
  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 +48 -0
  17. package/dist/factories/index.cjs +19 -0
  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-C7XQyrgE.d.ts → index-B-KhN8Ox.d.ts} +51 -0
  23. package/dist/{index-BxdXgqiI.d.ts → index-B7JDsx4a.d.ts} +9 -2
  24. package/dist/{index-BIQoaKAA.d.cts → index-B9JqYr3Q.d.cts} +9 -2
  25. package/dist/{index-DyN50JZo.d.cts → index-DU-CF-3m.d.cts} +51 -0
  26. package/dist/index.cjs +710 -303
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +14 -5
  29. package/dist/index.d.ts +14 -5
  30. package/dist/index.js +8 -8
  31. package/dist/systems/index.cjs +617 -211
  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-KVGGAL5V.js.map +0 -1
  38. package/dist/chunk-W5TSYV6Q.js.map +0 -1
@@ -49,6 +49,7 @@ __export(components_exports, {
49
49
  XRInteractorComponent: () => XRInteractorComponent,
50
50
  XRInteractorSideComponent: () => XRInteractorSideComponent,
51
51
  XRRigComponent: () => XRRigComponent,
52
+ createAttachPoint: () => createAttachPoint,
52
53
  createHandPoseEntry: () => createHandPoseEntry,
53
54
  defaultMaterialValue: () => defaultMaterialValue,
54
55
  handPoseDefinitionFor: () => handPoseDefinitionFor,
@@ -1956,6 +1957,14 @@ var _XRInteractableComponent = class _XRInteractableComponent extends Component
1956
1957
  y: 0,
1957
1958
  z: 0
1958
1959
  };
1960
+ this.grabHands = options?.grabHands ?? "handOff";
1961
+ this.twoHandRotation = options?.twoHandRotation ?? "align";
1962
+ this.allowTwoHandScale = options?.allowTwoHandScale ?? false;
1963
+ this.minScale = options?.minScale ?? 0.25;
1964
+ this.maxScale = options?.maxScale ?? 4;
1965
+ this.attachPoints = (options?.attachPoints ?? []).map(
1966
+ (point) => createAttachPoint(point)
1967
+ );
1959
1968
  this.throwOnRelease = options?.throwOnRelease ?? true;
1960
1969
  this.throwStrength = options?.throwStrength ?? 1;
1961
1970
  this.highlightOnHover = options?.highlightOnHover ?? true;
@@ -1963,6 +1972,17 @@ var _XRInteractableComponent = class _XRInteractableComponent extends Component
1963
1972
  };
1964
1973
  __name(_XRInteractableComponent, "XRInteractableComponent");
1965
1974
  var XRInteractableComponent = _XRInteractableComponent;
1975
+ function createAttachPoint(partial) {
1976
+ return {
1977
+ id: partial.id,
1978
+ name: partial.name ?? partial.id,
1979
+ position: { x: 0, y: 0, z: 0, ...partial.position },
1980
+ rotation: { x: 0, y: 0, z: 0, ...partial.rotation },
1981
+ hand: partial.hand ?? "any",
1982
+ role: partial.role ?? "any"
1983
+ };
1984
+ }
1985
+ __name(createAttachPoint, "createAttachPoint");
1966
1986
 
1967
1987
  // core/components/XRRig.ts
1968
1988
  var _XRRigComponent = class _XRRigComponent extends Component {
@@ -2206,6 +2226,6 @@ var _XRHandPoseComponent = class _XRHandPoseComponent extends Component {
2206
2226
  __name(_XRHandPoseComponent, "XRHandPoseComponent");
2207
2227
  var XRHandPoseComponent = _XRHandPoseComponent;
2208
2228
 
2209
- 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, createHandPoseEntry, defaultMaterialValue, getHandPosePreset, handPoseDefinitionFor, handPoseFromCurls, normalizePhysicsState, setPhysicsLiveRef };
2210
- //# sourceMappingURL=chunk-KVGGAL5V.js.map
2211
- //# sourceMappingURL=chunk-KVGGAL5V.js.map
2229
+ 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 };
2230
+ //# sourceMappingURL=chunk-ELSZ5U3F.js.map
2231
+ //# sourceMappingURL=chunk-ELSZ5U3F.js.map