@relu-interactives/spatial-ecs 0.2.25 → 0.3.1
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/{System-CYWZ_Zx5.d.cts → System-vrU46Vuw.d.cts} +16 -2
- package/dist/{System-CYWZ_Zx5.d.ts → System-vrU46Vuw.d.ts} +16 -2
- package/dist/{Video-AIQYTAAr.d.cts → XRRig-CAmf04NX.d.ts} +131 -4
- package/dist/{Video-DlZ4G9ig.d.ts → XRRig-Cu-EyliG.d.cts} +131 -4
- package/dist/{chunk-XFD74BQL.js → chunk-67WGASUJ.js} +3 -3
- package/dist/{chunk-XFD74BQL.js.map → chunk-67WGASUJ.js.map} +1 -1
- package/dist/{chunk-RJ4J5UEX.js → chunk-PCOZLCXS.js} +160 -83
- package/dist/chunk-PCOZLCXS.js.map +1 -0
- package/dist/{chunk-J6736FFO.js → chunk-U3MDYKPV.js} +90 -14
- package/dist/chunk-U3MDYKPV.js.map +1 -0
- package/dist/{chunk-3P3ZBP7K.js → chunk-VXUVNC7S.js} +634 -6
- package/dist/chunk-VXUVNC7S.js.map +1 -0
- package/dist/components/index.cjs +87 -11
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +1 -1
- package/dist/docs/api/Behaviour/classes/Behaviour.md +98 -51
- package/dist/docs/api/Component/classes/Component.md +4 -1
- package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
- package/dist/docs/api/components/classes/AudioComponent.md +19 -19
- package/dist/docs/api/components/classes/CameraComponent.md +14 -14
- package/dist/docs/api/components/classes/EntityType.md +4 -4
- package/dist/docs/api/components/classes/Environment.md +3 -3
- package/dist/docs/api/components/classes/ImageComponent.md +7 -7
- package/dist/docs/api/components/classes/ImageTarget.md +7 -7
- package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
- package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
- package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
- package/dist/docs/api/components/classes/LightComponent.md +6 -6
- package/dist/docs/api/components/classes/MaterialComponent.md +57 -11
- package/dist/docs/api/components/classes/MeshComponent.md +3 -3
- package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
- package/dist/docs/api/components/classes/ModelComponent.md +4 -4
- package/dist/docs/api/components/classes/Name.md +3 -3
- package/dist/docs/api/components/classes/Object3DRef.md +4 -4
- package/dist/docs/api/components/classes/ParentId.md +3 -3
- package/dist/docs/api/components/classes/PhysicsComponent.md +12 -13
- package/dist/docs/api/components/classes/Postprocessing.md +3 -3
- package/dist/docs/api/components/classes/PrefabInstance.md +80 -0
- package/dist/docs/api/components/classes/PrefabNode.md +54 -0
- package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
- package/dist/docs/api/components/classes/ScriptObjectComponent.md +55 -0
- package/dist/docs/api/components/classes/Selectable.md +3 -3
- package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
- package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
- package/dist/docs/api/components/classes/TransformComponent.md +12 -12
- package/dist/docs/api/components/classes/VideoComponent.md +28 -28
- package/dist/docs/api/components/functions/defaultMaterialValue.md +17 -0
- package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
- package/dist/docs/api/components/functions/setPhysicsLiveRef.md +34 -0
- package/dist/docs/api/components/index.md +8 -1
- package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
- package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
- package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
- package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
- package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
- package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
- package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +7 -7
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentState.md +5 -5
- package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
- package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
- package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
- package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
- package/dist/docs/api/components/type-aliases/LightValueState.md +11 -11
- package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
- package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
- package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
- package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
- package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
- package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
- package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
- package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
- package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -10
- package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +20 -0
- package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +13 -0
- package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
- package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
- package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
- package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
- package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
- package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
- package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
- package/dist/docs/api/index/classes/AudioSystem.md +4 -4
- package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/InputSystem.md +33 -33
- package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
- package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
- package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
- package/dist/docs/api/index/classes/ObjectManagementSystem.md +14 -14
- package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
- package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/RenderSystem.md +3 -3
- package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +5 -5
- package/dist/docs/api/index/classes/ScriptObject.md +156 -0
- package/dist/docs/api/index/classes/ScriptObjectSystem.md +129 -0
- package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/VideoSystem.md +4 -4
- package/dist/docs/api/index/classes/World.md +183 -86
- package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +32 -0
- package/dist/docs/api/index/functions/buildComponentValueMaps.md +23 -0
- package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +25 -0
- package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +23 -0
- package/dist/docs/api/index/functions/canonicalizeComponentValue.md +38 -0
- package/dist/docs/api/index/functions/clearModelCache.md +26 -0
- package/dist/docs/api/index/functions/clearPrefabCache.md +25 -0
- package/dist/docs/api/index/functions/collectDiffPaths.md +38 -0
- package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +27 -0
- package/dist/docs/api/index/functions/collectEntitySubtree.md +29 -0
- package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +26 -0
- package/dist/docs/api/index/functions/computeInstanceOverrides.md +44 -0
- package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
- package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
- package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
- package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
- package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createLightComponent.md +1 -1
- package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
- package/dist/docs/api/index/functions/createModelComponent.md +1 -1
- package/dist/docs/api/index/functions/createNameComponent.md +1 -1
- package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
- package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
- package/dist/docs/api/index/functions/createPhysicsComponent.md +2 -4
- package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptObjectComponent.md +28 -0
- package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
- package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
- package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
- package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
- package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
- package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +28 -0
- package/dist/docs/api/index/functions/despawnPrefab.md +32 -0
- package/dist/docs/api/index/functions/encodeOverride.md +28 -0
- package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +25 -0
- package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +28 -0
- package/dist/docs/api/index/functions/groupOverridePaths.md +25 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +4 -2
- package/dist/docs/api/index/functions/indexSnapshotByEntity.md +25 -0
- package/dist/docs/api/index/functions/instantiateSubtree.md +32 -0
- package/dist/docs/api/index/functions/loadPrefab.md +28 -0
- package/dist/docs/api/index/functions/loadSharedGltf.md +29 -0
- package/dist/docs/api/index/functions/mergeComponentValue.md +32 -0
- package/dist/docs/api/index/functions/parseOverride.md +34 -0
- package/dist/docs/api/index/functions/parsePrefabAsset.md +25 -0
- package/dist/docs/api/index/functions/prefabFileVersionFor.md +25 -0
- package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
- package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
- package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +46 -0
- package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +17 -0
- package/dist/docs/api/index/functions/restoreComponentState.md +34 -0
- package/dist/docs/api/index/functions/restorePostCreateComponents.md +36 -0
- package/dist/docs/api/index/functions/serializeEntitySubtree.md +35 -0
- package/dist/docs/api/index/functions/setDracoDecoderPath.md +30 -0
- package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +30 -0
- package/dist/docs/api/index/functions/spawnPrefab.md +36 -0
- package/dist/docs/api/index/index.md +65 -0
- package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
- package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
- package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
- package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +23 -0
- package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
- package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +69 -0
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +2 -1
- package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
- package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
- package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +7 -5
- package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +23 -0
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
- package/dist/docs/api/index/type-aliases/ModuleLoader.md +25 -0
- package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
- package/dist/docs/api/index/type-aliases/NestedRegion.md +27 -0
- package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +30 -0
- package/dist/docs/api/index/type-aliases/NodeMaps.md +25 -0
- package/dist/docs/api/index/type-aliases/PrefabAsset.md +32 -0
- package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +21 -0
- package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
- package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +25 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +19 -0
- package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +43 -0
- package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +19 -0
- package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
- package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
- package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +13 -0
- package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +15 -0
- package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +16 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +13 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +15 -0
- package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +15 -0
- package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +17 -0
- package/dist/docs/api/typedoc-sidebar.json +1 -1
- package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
- package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
- package/dist/docs/api/types/type-aliases/ComponentKind.md +2 -1
- package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
- package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
- package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
- package/dist/docs/api/types/type-aliases/EcsEntityKind.md +3 -2
- package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
- package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
- package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
- package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
- package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
- package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
- package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
- package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
- package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
- package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
- package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
- package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
- package/dist/docs/guide/components/_sidebar.json +4 -0
- package/dist/docs/guide/components/material.md +1 -0
- package/dist/docs/guide/components/script-object.md +32 -0
- package/dist/factories/index.cjs +271 -118
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +9 -3
- package/dist/factories/index.d.ts +9 -3
- package/dist/factories/index.js +3 -3
- package/dist/{index-Gr8aCPRM.d.cts → index-CUFd71ri.d.cts} +12 -3
- package/dist/index-D84o_UA6.d.ts +488 -0
- package/dist/index-YYypJaVw.d.cts +488 -0
- package/dist/{index-BwiRJNIT.d.ts → index-w1oqWl_M.d.ts} +12 -3
- package/dist/index.cjs +1014 -208
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -8
- package/dist/index.d.ts +42 -8
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +717 -12
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +3 -278
- package/dist/systems/index.d.ts +3 -278
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/package.json +4 -4
- package/dist/chunk-3P3ZBP7K.js.map +0 -1
- package/dist/chunk-J6736FFO.js.map +0 -1
- package/dist/chunk-RJ4J5UEX.js.map +0 -1
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { k as EcsSystem, l as World } from './System-vrU46Vuw.cjs';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
|
|
4
|
+
declare class AnimationSystem implements EcsSystem {
|
|
5
|
+
private readonly runtimeByEntity;
|
|
6
|
+
private readonly gltfLoader;
|
|
7
|
+
private readonly fbxLoader;
|
|
8
|
+
private loadClipsFromSource;
|
|
9
|
+
private refreshExternalClipSources;
|
|
10
|
+
private release;
|
|
11
|
+
update(world: World, deltaTime: number): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class CameraSyncSystem implements EcsSystem {
|
|
16
|
+
private readonly signatures;
|
|
17
|
+
update(world: World): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare class ObjectVisibilitySystem implements EcsSystem {
|
|
21
|
+
update(world: World): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class EnvironmentSyncSystem implements EcsSystem {
|
|
25
|
+
private readonly scene;
|
|
26
|
+
private readonly textureLoader;
|
|
27
|
+
private signature;
|
|
28
|
+
private activeTexture;
|
|
29
|
+
private pendingImageUrl;
|
|
30
|
+
constructor(scene: THREE.Scene);
|
|
31
|
+
private disposeActiveTexture;
|
|
32
|
+
private applySkybox;
|
|
33
|
+
private applyFog;
|
|
34
|
+
update(world: World): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class PostprocessingSyncSystem implements EcsSystem {
|
|
39
|
+
private readonly renderer;
|
|
40
|
+
private readonly scene;
|
|
41
|
+
private readonly camera;
|
|
42
|
+
private signature;
|
|
43
|
+
private composer;
|
|
44
|
+
private composerEnabled;
|
|
45
|
+
constructor(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera);
|
|
46
|
+
private setComposerEnabled;
|
|
47
|
+
private disposeComposer;
|
|
48
|
+
private buildComposer;
|
|
49
|
+
update(world: World): void;
|
|
50
|
+
dispose(): void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare class PhysicsSyncSystem implements EcsSystem {
|
|
54
|
+
private readonly rigidBodyHandles;
|
|
55
|
+
private readonly colliderHandles;
|
|
56
|
+
private readonly rigidBodySignatures;
|
|
57
|
+
private readonly colliderSignatures;
|
|
58
|
+
private readonly isEditorMode;
|
|
59
|
+
private rapier;
|
|
60
|
+
private isBootstrappingWorld;
|
|
61
|
+
private accumulator;
|
|
62
|
+
constructor(options?: {
|
|
63
|
+
isEditor?: boolean;
|
|
64
|
+
});
|
|
65
|
+
private ensurePhysicsWorld;
|
|
66
|
+
private removeEntityPhysics;
|
|
67
|
+
update(world: World, deltaTime: number): void;
|
|
68
|
+
dispose(world: World): void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class LightSyncSystem implements EcsSystem {
|
|
72
|
+
private readonly signatures;
|
|
73
|
+
update(world: World): void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare class MaterialSyncSystem implements EcsSystem {
|
|
77
|
+
private readonly signatures;
|
|
78
|
+
private readonly textureCache;
|
|
79
|
+
update(world: World): void;
|
|
80
|
+
dispose(): void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class MeshGeometrySystem implements EcsSystem {
|
|
84
|
+
private readonly geometrySignatures;
|
|
85
|
+
private readonly shadowSignatures;
|
|
86
|
+
update(world: World): void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Maintains the runtime geometry for entities with an {@link InstancedMeshComponent}.
|
|
91
|
+
*
|
|
92
|
+
* - **Primitive kinds** (`cube`, `sphere`, `plane`, `cylinder`, `capsule`): creates a single
|
|
93
|
+
* `THREE.InstancedMesh` on the anchor and writes per-instance matrices every frame.
|
|
94
|
+
* - **Model kind** (`model`): asynchronously loads the GLTF/GLB at `comp.modelPath`, traverses
|
|
95
|
+
* the scene to collect all `THREE.Mesh` nodes, and creates one `THREE.InstancedMesh` per mesh
|
|
96
|
+
* (preserving the mesh's local transform and original materials). All sub-meshes are grouped
|
|
97
|
+
* under a `THREE.Group` stored in `comp.instancedMesh`. Per-instance matrices are composed as
|
|
98
|
+
* `instanceTransform × meshLocalMatrix` every frame.
|
|
99
|
+
*
|
|
100
|
+
* Geometry is rebuilt whenever the signature (`meshKind:parameters:instanceCount` for primitives,
|
|
101
|
+
* `model:path:instanceCount` for model kind) changes.
|
|
102
|
+
*/
|
|
103
|
+
declare class InstancedMeshSystem implements EcsSystem {
|
|
104
|
+
/** Signature tracking for geometry + instance count changes. */
|
|
105
|
+
private readonly geometrySignatures;
|
|
106
|
+
/** Signature being loaded per entity. Maps entityId → geometrySignature in-flight.
|
|
107
|
+
* Prevents re-dispatching a load every frame while comp.instancedMesh is still null. */
|
|
108
|
+
private readonly loadingSignatures;
|
|
109
|
+
/** Per-mesh data for model kind, populated after GLTF load. */
|
|
110
|
+
private readonly modelMeshEntries;
|
|
111
|
+
/**
|
|
112
|
+
* System-internal ref to the Three.js mesh/group most recently placed on
|
|
113
|
+
* the anchor by this system. Used for cleanup on rebuild instead of
|
|
114
|
+
* `comp.instancedMesh`, which can be stale (pointing to a disposed mesh)
|
|
115
|
+
* after an undo/redo restores a history snapshot captured at an earlier
|
|
116
|
+
* geometry configuration. Relying on the stale comp ref would skip removal
|
|
117
|
+
* of the current live mesh → ghost mesh in the scene.
|
|
118
|
+
*/
|
|
119
|
+
private readonly trackedMeshes;
|
|
120
|
+
update(world: World): void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Shared infrastructure for the script-hosting systems (`ScriptBehaviourSystem`
|
|
125
|
+
* and `ScriptObjectSystem`): module loading, class resolution, data-envelope
|
|
126
|
+
* merge/resolve/serialize. Extracted verbatim from `ScriptBehaviourSystem` so
|
|
127
|
+
* both systems stay behaviourally identical for the parts they share.
|
|
128
|
+
*/
|
|
129
|
+
/** Resolves a script URL to its ES module namespace. */
|
|
130
|
+
type ModuleLoader = (scriptUrl: string) => Promise<Record<string, unknown>>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Optional context that enables raycast-based onSelect / onDeselect dispatch.
|
|
134
|
+
* When provided, pointer/touch taps on the canvas fire a raycast against the
|
|
135
|
+
* scene. If the hit object (or any ancestor) carries userData.entityId, every
|
|
136
|
+
* Behaviour instance for that entity receives onSelect(); the previously
|
|
137
|
+
* selected entity's instances receive onDeselect().
|
|
138
|
+
*/
|
|
139
|
+
type SelectionContext = {
|
|
140
|
+
camera: THREE.Camera;
|
|
141
|
+
scene: THREE.Scene;
|
|
142
|
+
domElement: HTMLElement;
|
|
143
|
+
};
|
|
144
|
+
declare class ScriptBehaviourSystem implements EcsSystem {
|
|
145
|
+
private instances;
|
|
146
|
+
private loading;
|
|
147
|
+
private readonly moduleLoader;
|
|
148
|
+
private readonly selectionCtx;
|
|
149
|
+
private readonly raycaster;
|
|
150
|
+
private readonly ndcPointer;
|
|
151
|
+
private selectedEntityId;
|
|
152
|
+
private pendingEntityId;
|
|
153
|
+
private pointerDownPos;
|
|
154
|
+
private static readonly CLICK_THRESHOLD;
|
|
155
|
+
constructor(moduleLoader?: ModuleLoader, selectionContext?: SelectionContext);
|
|
156
|
+
/** Walk up the object hierarchy to find the nearest userData.entityId. */
|
|
157
|
+
private resolveEntityId;
|
|
158
|
+
/** Convert client (screen) coordinates to normalised device coordinates. */
|
|
159
|
+
private toNdc;
|
|
160
|
+
/** Fire raycast and queue the result to be dispatched in the next update(). */
|
|
161
|
+
private queueRaycast;
|
|
162
|
+
private onPointerDown;
|
|
163
|
+
private onPointerUp;
|
|
164
|
+
/**
|
|
165
|
+
* Apply a queued selection change.
|
|
166
|
+
* Calls onDeselect() on all behaviours of the previous entity and
|
|
167
|
+
* onSelect() on all behaviours of the newly selected entity.
|
|
168
|
+
*/
|
|
169
|
+
private applySelection;
|
|
170
|
+
update(world: World, deltaTime: number): void;
|
|
171
|
+
dispose(world: World): void;
|
|
172
|
+
private loadBehaviour;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Tags the Object3D a script's `build()` returned, so reloads can find/remove it. */
|
|
176
|
+
declare const SCRIPT_OBJECT_ROOT_FLAG = "__scriptObjectRoot";
|
|
177
|
+
/**
|
|
178
|
+
* Builds, ticks, and disposes {@link ScriptObject} scripts. Unlike
|
|
179
|
+
* `ScriptBehaviourSystem`, this runs in the editor AND at runtime — there is NO
|
|
180
|
+
* `isEditorMode` gating anywhere here. A script's `build()` output is attached
|
|
181
|
+
* under the entity's `Object3DRef.object` (so it inherits transform, selection
|
|
182
|
+
* and visibility). `runtimeState` is written on transitions only (never every
|
|
183
|
+
* frame).
|
|
184
|
+
*
|
|
185
|
+
* Construct it and pass it to `World.setup({ systems })`.
|
|
186
|
+
*
|
|
187
|
+
* @category Systems
|
|
188
|
+
*/
|
|
189
|
+
declare class ScriptObjectSystem implements EcsSystem {
|
|
190
|
+
private readonly moduleLoader;
|
|
191
|
+
private instances;
|
|
192
|
+
private loading;
|
|
193
|
+
/** Bumped by invalidate*() so in-flight loads that predate it are discarded. */
|
|
194
|
+
private epoch;
|
|
195
|
+
constructor(moduleLoader?: ModuleLoader);
|
|
196
|
+
update(world: World, deltaTime: number): void;
|
|
197
|
+
private loadScriptObject;
|
|
198
|
+
/** Dispose a record's instance + built subtree. `keepTombstone` leaves an error marker. */
|
|
199
|
+
private teardownRecord;
|
|
200
|
+
private markError;
|
|
201
|
+
/** Dispose all live instances so the next update() reloads with fresh modules. */
|
|
202
|
+
invalidateAll(): void;
|
|
203
|
+
/** Invalidate only the entities whose script matches `scriptUrl`. */
|
|
204
|
+
invalidate(scriptUrl: string): void;
|
|
205
|
+
dispose(world: World): void;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Reconciles `AudioComponent` state with the underlying THREE.js audio objects
|
|
210
|
+
* each frame.
|
|
211
|
+
*
|
|
212
|
+
* **Playback** — drives `play()`, `pause()`, and `stop()` on the THREE.js
|
|
213
|
+
* audio node based on the `isPlaying` / `isPaused` flags set by
|
|
214
|
+
* `AudioComponent.play()`, `.pause()`, and `.stop()`.
|
|
215
|
+
*
|
|
216
|
+
* **Option sync** — detects changes to `loop`, `pitch`, `volume`,
|
|
217
|
+
* `refDistance`, `distanceModel`, and `rolloffFactor` and applies them live.
|
|
218
|
+
* Changes take effect on the next frame, so scripts and inspector edits during
|
|
219
|
+
* runtime are reflected without reloading the scene.
|
|
220
|
+
*
|
|
221
|
+
* Only active in **preview** mode (`isEditor: true` makes every update a
|
|
222
|
+
* no-op so the editor is unaffected).
|
|
223
|
+
*
|
|
224
|
+
* @category Systems
|
|
225
|
+
*/
|
|
226
|
+
declare class AudioSystem implements EcsSystem {
|
|
227
|
+
private readonly isEditor;
|
|
228
|
+
/** THREE.js `isPlaying` state captured at the end of the previous frame. */
|
|
229
|
+
private readonly prevPlayingState;
|
|
230
|
+
/** Snapshot of options applied in the previous frame, for change detection. */
|
|
231
|
+
private readonly prevOptions;
|
|
232
|
+
/** Tracks entities that were stopped due to invisibility. */
|
|
233
|
+
private readonly stoppedDueToInvisibility;
|
|
234
|
+
constructor({ isEditor }?: {
|
|
235
|
+
isEditor?: boolean;
|
|
236
|
+
});
|
|
237
|
+
update(world: World, _deltaTime: number): void;
|
|
238
|
+
/** Apply any changed options from the component to the THREE.js audio node. */
|
|
239
|
+
private _syncOptions;
|
|
240
|
+
dispose(_world: World): void;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Reconciles `VideoComponent` state with the underlying HTML video element
|
|
245
|
+
* and THREE.js mesh/material each frame.
|
|
246
|
+
*
|
|
247
|
+
* **Playback** — drives `play()`, `pause()`, and stop (pause + seek to 0) on
|
|
248
|
+
* the HTML `<video>` element based on the `isPlaying` / `isPaused` flags set
|
|
249
|
+
* by `VideoComponent.play()`, `.pause()`, and `.stop()`.
|
|
250
|
+
*
|
|
251
|
+
* **Option sync** — detects changes to `loop`, `volume`, `width`, `height`,
|
|
252
|
+
* and green-screen shader uniforms (`backgroundColor`, `similarity`,
|
|
253
|
+
* `smoothness`, `spill`) and applies them live without a scene reload.
|
|
254
|
+
*
|
|
255
|
+
* Only active in **preview** mode (`isEditor: true` makes every update a
|
|
256
|
+
* no-op so the editor is unaffected).
|
|
257
|
+
*
|
|
258
|
+
* @category Systems
|
|
259
|
+
*/
|
|
260
|
+
declare class VideoSystem implements EcsSystem {
|
|
261
|
+
private readonly isEditor;
|
|
262
|
+
/** Playback intent captured at the end of the previous frame. */
|
|
263
|
+
private readonly prevIntent;
|
|
264
|
+
/** Snapshot of options applied in the previous frame, for change detection. */
|
|
265
|
+
private readonly prevOptions;
|
|
266
|
+
/** Tracks entities that were manually paused due to invisibility. */
|
|
267
|
+
private readonly pausedDueToInvisibility;
|
|
268
|
+
constructor({ isEditor }?: {
|
|
269
|
+
isEditor?: boolean;
|
|
270
|
+
});
|
|
271
|
+
update(world: World, _deltaTime: number): void;
|
|
272
|
+
/** Apply any changed options from the component to the video element and mesh. */
|
|
273
|
+
private _syncOptions;
|
|
274
|
+
dispose(_world: World): void;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Shared vocabulary for the WebXR layer.
|
|
279
|
+
*
|
|
280
|
+
* The single most important design constraint here: **the three target
|
|
281
|
+
* platforms expose fundamentally different input models**, and a runtime that
|
|
282
|
+
* hard-codes one of them silently excludes the others.
|
|
283
|
+
*
|
|
284
|
+
* - Meta Quest / Pico → motion controllers (trigger, grip, thumbstick) and,
|
|
285
|
+
* optionally, tracked hands.
|
|
286
|
+
* - Android XR → tracked hands are the PRIMARY input.
|
|
287
|
+
* - Apple Vision Pro → no controllers at all. Input arrives as
|
|
288
|
+
* `transient-pointer` sources that exist ONLY for the duration of a
|
|
289
|
+
* gaze-and-pinch, appearing on pinch-start and disappearing on release.
|
|
290
|
+
*
|
|
291
|
+
* {@link XrInputState} normalizes all three into one shape so gameplay code and
|
|
292
|
+
* Behaviours are written once. Anything platform-specific is expressed as a
|
|
293
|
+
* capability (`kind`, `hasAxes`) rather than a branch on device name — we never
|
|
294
|
+
* sniff the user agent, per the WebXR guidance from every vendor.
|
|
295
|
+
*/
|
|
296
|
+
/** Which hand an input source belongs to (`none` for gaze / single-source devices). */
|
|
297
|
+
type XrHandedness = "left" | "right" | "none";
|
|
298
|
+
/**
|
|
299
|
+
* How an input source is physically driven.
|
|
300
|
+
*
|
|
301
|
+
* `transient-pointer` is the Vision Pro case: the source is EPHEMERAL — it is
|
|
302
|
+
* created when the user pinches and destroyed when they release, so it must
|
|
303
|
+
* never be cached across frames by identity.
|
|
304
|
+
*/
|
|
305
|
+
type XrInputKind = "controller" | "hand" | "transient-pointer" | "gaze";
|
|
306
|
+
/**
|
|
307
|
+
* One frame of normalized input for a single source.
|
|
308
|
+
*
|
|
309
|
+
* Boolean actions follow the same pending→latched contract as the desktop
|
|
310
|
+
* `InputSystem`: `select` is the held state, while `selectStart` / `selectEnd`
|
|
311
|
+
* are true for exactly one frame. This lets Behaviours poll (`if (select)`) or
|
|
312
|
+
* edge-detect (`if (selectStart)`) without subscribing to events.
|
|
313
|
+
*/
|
|
314
|
+
type XrInputState = {
|
|
315
|
+
handedness: XrHandedness;
|
|
316
|
+
kind: XrInputKind;
|
|
317
|
+
/** False once the source disconnects (a released pinch on Vision Pro). */
|
|
318
|
+
connected: boolean;
|
|
319
|
+
/** Pointing ray in WORLD space, from the source's `targetRaySpace`. */
|
|
320
|
+
rayOrigin: THREE.Vector3;
|
|
321
|
+
rayDirection: THREE.Vector3;
|
|
322
|
+
/** Physical grip pose. Null for gaze and transient-pointer, which have no grip. */
|
|
323
|
+
gripPosition: THREE.Vector3 | null;
|
|
324
|
+
gripQuaternion: THREE.Quaternion | null;
|
|
325
|
+
/** Primary action: controller trigger, hand pinch, or Vision Pro gaze-pinch. */
|
|
326
|
+
select: boolean;
|
|
327
|
+
selectStart: boolean;
|
|
328
|
+
selectEnd: boolean;
|
|
329
|
+
/** Secondary action: controller grip squeeze. Never fires for hands/gaze. */
|
|
330
|
+
squeeze: boolean;
|
|
331
|
+
squeezeStart: boolean;
|
|
332
|
+
squeezeEnd: boolean;
|
|
333
|
+
/** Thumbstick / trackpad axes in [-1, 1]. Empty when {@link hasAxes} is false. */
|
|
334
|
+
axes: number[];
|
|
335
|
+
/** True only for sources with a physical stick — gates stick-driven locomotion. */
|
|
336
|
+
hasAxes: boolean;
|
|
337
|
+
/** Raw gamepad button pressed-states, when the source exposes a gamepad. */
|
|
338
|
+
buttons: boolean[];
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* What the ACTIVE session actually granted us.
|
|
342
|
+
*
|
|
343
|
+
* Always derived from `XRSession.enabledFeatures` — never from the device name.
|
|
344
|
+
* A feature being requested is not a promise it was granted, and support varies
|
|
345
|
+
* sharply per platform (e.g. Vision Pro grants no `immersive-ar` at all today).
|
|
346
|
+
*/
|
|
347
|
+
type XrCapabilities = {
|
|
348
|
+
/** The session's mode. `immersive-ar` implies passthrough / mixed reality. */
|
|
349
|
+
mode: "immersive-vr" | "immersive-ar" | "inline";
|
|
350
|
+
/** Tracked-hand joint data is available. */
|
|
351
|
+
handTracking: boolean;
|
|
352
|
+
/** Real-world plane detection (incubating; effectively Quest-only today). */
|
|
353
|
+
planeDetection: boolean;
|
|
354
|
+
/** Real-world mesh detection (draft spec; Quest-only today). */
|
|
355
|
+
meshDetection: boolean;
|
|
356
|
+
/** Per-frame depth buffer (Android XR stereo, Quest experimental). */
|
|
357
|
+
depthSensing: boolean;
|
|
358
|
+
/** Spatial anchors. */
|
|
359
|
+
anchors: boolean;
|
|
360
|
+
/** Ray-against-real-world hit testing. */
|
|
361
|
+
hitTest: boolean;
|
|
362
|
+
/** Everything the UA reported, verbatim, for diagnostics. */
|
|
363
|
+
enabledFeatures: string[];
|
|
364
|
+
};
|
|
365
|
+
/** Capabilities for "no session running" — every feature off. */
|
|
366
|
+
declare const NO_XR_CAPABILITIES: XrCapabilities;
|
|
367
|
+
/**
|
|
368
|
+
* Read granted features off a live session.
|
|
369
|
+
*
|
|
370
|
+
* `enabledFeatures` is optional in the spec and missing on some UAs; when it is
|
|
371
|
+
* absent we report nothing as granted rather than optimistically assuming
|
|
372
|
+
* support, so callers degrade instead of calling an API that will throw.
|
|
373
|
+
*/
|
|
374
|
+
declare function readXrCapabilities(session: XRSession | null, mode?: XrCapabilities["mode"]): XrCapabilities;
|
|
375
|
+
|
|
376
|
+
declare class XRInputSystem implements EcsSystem {
|
|
377
|
+
private readonly records;
|
|
378
|
+
private session;
|
|
379
|
+
private readonly onSelectStart;
|
|
380
|
+
private readonly onSelectEnd;
|
|
381
|
+
private readonly onSqueezeStart;
|
|
382
|
+
private readonly onSqueezeEnd;
|
|
383
|
+
private mark;
|
|
384
|
+
private ensureRecord;
|
|
385
|
+
/** Bind to a session. Called by {@link XRSessionSystem} on session start. */
|
|
386
|
+
attachSession(session: XRSession): void;
|
|
387
|
+
/** Unbind and drop all per-source state. */
|
|
388
|
+
detachSession(): void;
|
|
389
|
+
update(world: World): void;
|
|
390
|
+
/** Every input source active this frame. */
|
|
391
|
+
getInputs(): XrInputState[];
|
|
392
|
+
/** The first source for a hand, or null. Prefer this for hand-specific logic. */
|
|
393
|
+
getInput(handedness: XrHandedness): XrInputState | null;
|
|
394
|
+
/** True while ANY source is selecting — the portable "is the user acting" check. */
|
|
395
|
+
isSelecting(): boolean;
|
|
396
|
+
dispose(): void;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare class XRInteractionSystem implements EcsSystem {
|
|
400
|
+
private readonly inputSystem;
|
|
401
|
+
private readonly raycaster;
|
|
402
|
+
/** Which entity each source is holding. Keyed by source state identity. */
|
|
403
|
+
private readonly grabs;
|
|
404
|
+
private hoveredEntityId;
|
|
405
|
+
constructor(inputSystem: XRInputSystem);
|
|
406
|
+
update(world: World): void;
|
|
407
|
+
private collectInteractables;
|
|
408
|
+
/** Entity id of the nearest pointable hit along this source's ray, or null. */
|
|
409
|
+
private raycast;
|
|
410
|
+
private grab;
|
|
411
|
+
private moveHeld;
|
|
412
|
+
private release;
|
|
413
|
+
private releaseAll;
|
|
414
|
+
/**
|
|
415
|
+
* Where the "hand" is for this source. Controllers and tracked hands report a
|
|
416
|
+
* grip pose; gaze and transient-pointer sources have none, so we hold the
|
|
417
|
+
* object a fixed distance along the ray instead.
|
|
418
|
+
*/
|
|
419
|
+
private handPosition;
|
|
420
|
+
private dispatch;
|
|
421
|
+
/** Entity currently under a pointer this frame, or null. */
|
|
422
|
+
getHoveredEntityId(): number | null;
|
|
423
|
+
/** True when any source is holding something. */
|
|
424
|
+
isGrabbing(): boolean;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
declare class XRLocomotionSystem implements EcsSystem {
|
|
428
|
+
private readonly inputSystem;
|
|
429
|
+
private readonly raycaster;
|
|
430
|
+
/** Per-source latch so one stick push yields exactly one snap turn. */
|
|
431
|
+
private readonly turnLatched;
|
|
432
|
+
/** Where the pointer currently lands, for the consumer to draw a marker. */
|
|
433
|
+
private teleportPoint;
|
|
434
|
+
constructor(inputSystem: XRInputSystem);
|
|
435
|
+
update(world: World, deltaTime: number): void;
|
|
436
|
+
/**
|
|
437
|
+
* Snap turning, not smooth turning — rotating the view continuously is the
|
|
438
|
+
* single biggest cause of VR nausea, so the comfort-safe option is the one
|
|
439
|
+
* wired to the stick.
|
|
440
|
+
*/
|
|
441
|
+
private applySnapTurn;
|
|
442
|
+
private applySmoothMove;
|
|
443
|
+
private applyTeleport;
|
|
444
|
+
private collectTeleportTargets;
|
|
445
|
+
/**
|
|
446
|
+
* Where the teleport pointer currently lands this frame, or null.
|
|
447
|
+
* Consumers use this to render an aim marker.
|
|
448
|
+
*/
|
|
449
|
+
getTeleportPoint(): THREE.Vector3 | null;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Owns the immersive-session lifecycle and fans XR events out to Behaviours.
|
|
454
|
+
*
|
|
455
|
+
* Detects session start/end by polling `renderer.xr.isPresenting` rather than
|
|
456
|
+
* binding to `sessionstart`/`sessionend`: the session may already be running
|
|
457
|
+
* before this system is registered (the consumer owns the entry button), and
|
|
458
|
+
* polling a boolean makes the system correct regardless of construction order.
|
|
459
|
+
*
|
|
460
|
+
* Hook dispatch mirrors `ImageTargetAnchorSystem`'s AR precedent — walk live
|
|
461
|
+
* `ScriptComponent.scriptInstances` and call the public no-op hook — so XR and
|
|
462
|
+
* AR extend `Behaviour` the same way.
|
|
463
|
+
*/
|
|
464
|
+
declare class XRSessionSystem implements EcsSystem {
|
|
465
|
+
private presenting;
|
|
466
|
+
private capabilities;
|
|
467
|
+
private readonly inputSystem;
|
|
468
|
+
constructor(inputSystem?: XRInputSystem);
|
|
469
|
+
update(world: World): void;
|
|
470
|
+
private handleSessionStart;
|
|
471
|
+
private handleSessionEnd;
|
|
472
|
+
/**
|
|
473
|
+
* Relay this frame's one-frame select edges. Polling the latched state (rather
|
|
474
|
+
* than dispatching from the DOM event) keeps hook delivery on the ECS tick, so
|
|
475
|
+
* a Behaviour's `onSelectStart` always observes the same world state its
|
|
476
|
+
* `onUpdate` would.
|
|
477
|
+
*/
|
|
478
|
+
private dispatchInputEdges;
|
|
479
|
+
private forEachBehaviour;
|
|
480
|
+
/** What the active session granted. `NO_XR_CAPABILITIES` when not presenting. */
|
|
481
|
+
getCapabilities(): XrCapabilities;
|
|
482
|
+
/** True while an immersive session is presenting. */
|
|
483
|
+
isPresenting(): boolean;
|
|
484
|
+
/** Convenience passthrough so consumers need only hold this system. */
|
|
485
|
+
getInputs(): XrInputState[];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export { AnimationSystem as A, CameraSyncSystem as C, EnvironmentSyncSystem as E, InstancedMeshSystem as I, LightSyncSystem as L, MaterialSyncSystem as M, NO_XR_CAPABILITIES as N, ObjectVisibilitySystem as O, PhysicsSyncSystem as P, SCRIPT_OBJECT_ROOT_FLAG as S, VideoSystem as V, type XrCapabilities as X, type XrInputState as a, AudioSystem as b, MeshGeometrySystem as c, type ModuleLoader as d, PostprocessingSyncSystem as e, ScriptBehaviourSystem as f, ScriptObjectSystem as g, type SelectionContext as h, XRInputSystem as i, XRInteractionSystem as j, XRLocomotionSystem as k, XRSessionSystem as l, type XrHandedness as m, type XrInputKind as n, readXrCapabilities as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, I as ImageComponent, o as ImageTarget, p as ImageTargetAnchor, q as ImageTargetAnchorOptions, r as ImageTargetReference, s as InstanceSlotComponent, t as InstanceTransform, u as InstancedMeshComponent, v as InstancedMeshKind, L as LightComponent, w as LightValueState, M as MaterialComponent, x as MaterialTypeValue, y as MaterialValueState, z as MeshComponent, B as MeshGeometryComponent, F as MeshGeometryParameters, G as MeshGeometryParametersByKind, H as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, J as PhysicsState, K as PlaneMeshParameters, R as RadiusHeightMeshParameters, Q as RadiusMeshParameters, S as RigidbodyState, T as RigidbodyType, U as ScriptComponent, V as ScriptEntry, W as ScriptObjectComponent, X as ScriptObjectComponentInput, Y as ScriptObjectRuntimeState, Z as Selectable, _ as SelectionTransformState, $ as SpriteComponent, a0 as TextureFilteringValue, a1 as TransformModeValue, a2 as TransformSpaceValue, a3 as
|
|
2
|
-
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, I as ImageComponent, o as ImageTarget, p as ImageTargetAnchor, q as ImageTargetAnchorOptions, r as ImageTargetReference, s as InstanceSlotComponent, t as InstanceTransform, u as InstancedMeshComponent, v as InstancedMeshKind, L as LightComponent, w as LightValueState, M as MaterialComponent, x as MaterialTypeValue, y as MaterialValueState, z as MeshComponent, B as MeshGeometryComponent, F as MeshGeometryParameters, G as MeshGeometryParametersByKind, H as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, J as PhysicsState, K as PlaneMeshParameters, R as RadiusHeightMeshParameters, Q as RadiusMeshParameters, S as RigidbodyState, T as RigidbodyType, U as ScriptComponent, V as ScriptEntry, W as ScriptObjectComponent, X as ScriptObjectComponentInput, Y as ScriptObjectRuntimeState, Z as Selectable, _ as SelectionTransformState, $ as SpriteComponent, a0 as TextureFilteringValue, a1 as TransformModeValue, a2 as TransformSpaceValue, a3 as VRTeleportAreaComponent, a4 as VRTeleportAreaOptions, a5 as VideoComponent, a6 as VrTeleportShape, a7 as XRInteractableComponent, a8 as XRInteractableOptions, a9 as XRRigComponent, aa as XRRigOptions, ab as XrGrabMode, ac as XrLocomotionMode, ad as defaultMaterialValue, ae as normalizePhysicsState, af as setPhysicsLiveRef } from './XRRig-CAmf04NX.js';
|
|
2
|
+
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-vrU46Vuw.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Marks the ROOT entity of a prefab instance and records its link to the
|
|
@@ -143,13 +143,22 @@ declare const index_TransformComponent: typeof TransformComponent;
|
|
|
143
143
|
declare const index_TransformData: typeof TransformData;
|
|
144
144
|
declare const index_TransformModeValue: typeof TransformModeValue;
|
|
145
145
|
declare const index_TransformSpaceValue: typeof TransformSpaceValue;
|
|
146
|
+
declare const index_VRTeleportAreaComponent: typeof VRTeleportAreaComponent;
|
|
147
|
+
declare const index_VRTeleportAreaOptions: typeof VRTeleportAreaOptions;
|
|
146
148
|
declare const index_Vec3: typeof Vec3;
|
|
147
149
|
declare const index_VideoComponent: typeof VideoComponent;
|
|
150
|
+
declare const index_VrTeleportShape: typeof VrTeleportShape;
|
|
151
|
+
declare const index_XRInteractableComponent: typeof XRInteractableComponent;
|
|
152
|
+
declare const index_XRInteractableOptions: typeof XRInteractableOptions;
|
|
153
|
+
declare const index_XRRigComponent: typeof XRRigComponent;
|
|
154
|
+
declare const index_XRRigOptions: typeof XRRigOptions;
|
|
155
|
+
declare const index_XrGrabMode: typeof XrGrabMode;
|
|
156
|
+
declare const index_XrLocomotionMode: typeof XrLocomotionMode;
|
|
148
157
|
declare const index_defaultMaterialValue: typeof defaultMaterialValue;
|
|
149
158
|
declare const index_normalizePhysicsState: typeof normalizePhysicsState;
|
|
150
159
|
declare const index_setPhysicsLiveRef: typeof setPhysicsLiveRef;
|
|
151
160
|
declare namespace index {
|
|
152
|
-
export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_defaultMaterialValue as defaultMaterialValue, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
|
|
161
|
+
export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_VRTeleportAreaComponent as VRTeleportAreaComponent, index_VRTeleportAreaOptions as VRTeleportAreaOptions, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_VrTeleportShape as VrTeleportShape, index_XRInteractableComponent as XRInteractableComponent, index_XRInteractableOptions as XRInteractableOptions, index_XRRigComponent as XRRigComponent, index_XRRigOptions as XRRigOptions, index_XrGrabMode as XrGrabMode, index_XrLocomotionMode as XrLocomotionMode, index_defaultMaterialValue as defaultMaterialValue, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
|
|
153
162
|
}
|
|
154
163
|
|
|
155
164
|
export { PrefabInstance as P, PrefabNode as a, index as i };
|