@relu-interactives/spatial-ecs 0.3.14 → 0.3.15
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.
- package/dist/{chunk-XHMOFI3Q.js → chunk-GULLCPO6.js} +15 -10
- package/dist/chunk-GULLCPO6.js.map +1 -0
- package/dist/docs/guide/vr-and-hand-poses.md +11 -0
- package/dist/{index-CbrjAm_8.d.cts → index-BKGV3VvQ.d.cts} +8 -3
- package/dist/{index-CvIXdHzx.d.ts → index-Bi7L3QHF.d.ts} +8 -3
- package/dist/index.cjs +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/systems/index.cjs +13 -8
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +1 -1
- package/dist/systems/index.d.ts +1 -1
- package/dist/systems/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-XHMOFI3Q.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFac
|
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-LR4EhboN.cjs';
|
|
5
5
|
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-LR4EhboN.cjs';
|
|
6
|
-
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-
|
|
7
|
-
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-
|
|
6
|
+
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-BKGV3VvQ.cjs';
|
|
7
|
+
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-BKGV3VvQ.cjs';
|
|
8
8
|
export { i as CoreComponents } from './index-BL5EWkwY.cjs';
|
|
9
9
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.cjs';
|
|
10
10
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFac
|
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { O as Object3DRef, an as XrHandPreset } from './XRHandPose-SZ7ou63b.js';
|
|
5
5
|
export { az as AnimationStateCallbacks, aA as AnimationStateMachine, aB as AnimationStateManager, aC as StateMachine } from './XRHandPose-SZ7ou63b.js';
|
|
6
|
-
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-
|
|
7
|
-
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-
|
|
6
|
+
import { X as XrCapabilities, a as XrInputState, b as XrHandPoseEventDetail } from './index-Bi7L3QHF.js';
|
|
7
|
+
export { A as AnimationSystem, c as AudioSystem, C as CameraSyncSystem, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, d as MeshGeometrySystem, e as ModuleLoader, N as NO_XR_CAPABILITIES, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, f as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, g as ScriptBehaviourSystem, h as ScriptObjectSystem, i as SelectionContext, V as VRTeleportAreaSystem, j as VideoSystem, k as XRControllerVisualSystem, l as XRHandPoseSystem, m as XRHoverVisualSystem, n as XRInputSystem, o as XRInteractionSystem, p as XRLocomotionSystem, q as XRSessionSystem, r as XRTeleportVisualSystem, s as XR_HOVER_SHELL_FLAG, t as XrHandedness, u as XrInputKind, v as readXrCapabilities } from './index-Bi7L3QHF.js';
|
|
8
8
|
export { i as CoreComponents } from './index-ByiUoIoh.js';
|
|
9
9
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.js';
|
|
10
10
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-
|
|
2
|
-
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioSystem, Behaviour, CURLED_COS, CameraSyncSystem, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HYDRATABLE_ENTITY_KINDS, HandPoseTracker, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, NO_XR_CAPABILITIES, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PINCH_FINGERS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, TeleportAimGate, ThrowVelocityTracker, TransformSyncSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRControllerVisualSystem, XRHandPoseSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeFingerCurl, computeHandShape, computeInstanceOverrides, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, decanonicalizeComponentValue, despawnPrefab, encodeOverride, estimateHandScale, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, matchHandPose, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, readXrCapabilities, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-
|
|
1
|
+
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, VRTeleportAreaSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-GULLCPO6.js';
|
|
2
|
+
export { ADDED_NODE_MARKER_COMPONENT, ARC_GRAVITY, ARC_MAX_TIME, ARC_SPEED, ARC_STEPS, AnimationSystem, AudioSystem, Behaviour, CURLED_COS, CameraSyncSystem, DEFAULT_ENTER_CONFIDENCE, DEFAULT_EXIT_CONFIDENCE, DEFAULT_LOST_GRACE_SECONDS, DEFAULT_MIN_HOLD_SECONDS, EnvironmentSyncSystem, FALLBACK_HAND_SCALE, HYDRATABLE_ENTITY_KINDS, HandPoseTracker, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MATCH_FALLOFF, MAX_PLAUSIBLE_SPEED, MAX_SAMPLE_AGE_SECONDS, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, NO_XR_CAPABILITIES, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PINCH_FINGERS, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, STRAIGHT_COS, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, TeleportAimGate, ThrowVelocityTracker, TransformSyncSystem, VELOCITY_SAMPLES, VRTeleportAreaSystem, VideoSystem, XRControllerVisualSystem, XRHandPoseSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_FINGERS, XR_HOVER_SHELL_FLAG, angularVelocityFrom, applyHandMaterial, arcGroundCrossing, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeFingerCurl, computeHandShape, computeInstanceOverrides, computePalmPose, computePalmWidth, computePinch, computeSpread, createHandMaterial, decanonicalizeComponentValue, despawnPrefab, encodeOverride, estimateHandScale, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, matchHandPose, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, readXrCapabilities, restoreComponentState, restorePostCreateComponents, sampleTeleportArc, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-GULLCPO6.js';
|
|
3
3
|
import { registerDefaultFactories } from './chunk-UHJ4MDIM.js';
|
|
4
4
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-UHJ4MDIM.js';
|
|
5
5
|
import { ObjectManagementSystem } from './chunk-PNQ7HDQC.js';
|
package/dist/systems/index.cjs
CHANGED
|
@@ -9049,17 +9049,22 @@ var _XRInteractionSystem = class _XRInteractionSystem {
|
|
|
9049
9049
|
return this.grabs.size > 0;
|
|
9050
9050
|
}
|
|
9051
9051
|
/**
|
|
9052
|
-
* Whether this
|
|
9052
|
+
* Whether this input's primary action is committed to interaction.
|
|
9053
9053
|
*
|
|
9054
|
-
* True while the
|
|
9054
|
+
* True while the source holds something, and also while it merely HOVERS a
|
|
9055
9055
|
* grabbable — because the pinch that is about to grab must not be read as a
|
|
9056
9056
|
* teleport by the locomotion system. Without the hover half, the first pinch
|
|
9057
9057
|
* of a grab teleports the player, and so does the pinch that takes an object
|
|
9058
9058
|
* from the other hand.
|
|
9059
|
+
*
|
|
9060
|
+
* Keyed on the INPUT SOURCE rather than handedness. Vision Pro reports
|
|
9061
|
+
* `handedness: "none"` for every gaze-pinch (it is hard-coded in WebKit), so a
|
|
9062
|
+
* handedness-keyed check silently never matched there and each pinch both
|
|
9063
|
+
* grabbed and teleported.
|
|
9059
9064
|
*/
|
|
9060
|
-
|
|
9061
|
-
if (this.
|
|
9062
|
-
const hover = this.
|
|
9065
|
+
isSourceBusy(world, input) {
|
|
9066
|
+
if (this.grabs.has(input)) return true;
|
|
9067
|
+
const hover = this.hovers.get(input);
|
|
9063
9068
|
if (!hover) return false;
|
|
9064
9069
|
const interactable = world.getComponent(
|
|
9065
9070
|
hover.entityId,
|
|
@@ -9140,7 +9145,7 @@ var _TeleportAimGate = class _TeleportAimGate {
|
|
|
9140
9145
|
if (aiming) this.aiming.add(source);
|
|
9141
9146
|
if (!releasing) return false;
|
|
9142
9147
|
this.aiming.delete(source);
|
|
9143
|
-
return hadAim;
|
|
9148
|
+
return hadAim || aiming;
|
|
9144
9149
|
}
|
|
9145
9150
|
/** True if this source currently has an aim engaged. */
|
|
9146
9151
|
isAiming(source) {
|
|
@@ -9314,7 +9319,7 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
9314
9319
|
const targets = this.collectTeleportTargets(world);
|
|
9315
9320
|
for (const input of inputs) {
|
|
9316
9321
|
const source = input;
|
|
9317
|
-
if (
|
|
9322
|
+
if (this.interactionSystem?.isSourceBusy(world, input)) {
|
|
9318
9323
|
if (this.teleportAim.cancel(source)) {
|
|
9319
9324
|
this.aimCurve = [];
|
|
9320
9325
|
this.landingPoint = null;
|
|
@@ -9323,7 +9328,7 @@ var _XRLocomotionSystem = class _XRLocomotionSystem {
|
|
|
9323
9328
|
continue;
|
|
9324
9329
|
}
|
|
9325
9330
|
const stick = this.readStickAim(input, source);
|
|
9326
|
-
const aiming = input.select || stick.aiming;
|
|
9331
|
+
const aiming = input.select || input.selectStart || stick.aiming;
|
|
9327
9332
|
const releasing = input.selectEnd || stick.released;
|
|
9328
9333
|
const commit = this.teleportAim.update(source, aiming, releasing);
|
|
9329
9334
|
if (!aiming && !commit) continue;
|