@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,35 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / serializeEntitySubtree
|
|
6
|
+
|
|
7
|
+
# Function: serializeEntitySubtree()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function serializeEntitySubtree(
|
|
11
|
+
world,
|
|
12
|
+
rootId,
|
|
13
|
+
options?): SerializeEntitySubtreeResult;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Defined in: [prefab/serializeEntitySubtree.ts:42](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/serializeEntitySubtree.ts#L42)
|
|
17
|
+
|
|
18
|
+
Serialize `rootId` + all descendants into a self-contained snapshot:
|
|
19
|
+
entity ids renumbered 1..N in BFS parent-first order, all internal id
|
|
20
|
+
references remapped, external references nulled + reported, root ParentId
|
|
21
|
+
forced to null. The result is directly consumable by
|
|
22
|
+
`hydrateWorldFromSnapshotDetailed` / `instantiateSubtree`.
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
| Parameter | Type |
|
|
27
|
+
| ------ | ------ |
|
|
28
|
+
| `world` | [`World`](../classes/World.md) |
|
|
29
|
+
| `rootId` | `number` |
|
|
30
|
+
| `options?` | \{ `maxDepth?`: `number`; \} |
|
|
31
|
+
| `options.maxDepth?` | `number` |
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
[`SerializeEntitySubtreeResult`](../type-aliases/SerializeEntitySubtreeResult.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / setDracoDecoderPath
|
|
6
|
+
|
|
7
|
+
# Function: setDracoDecoderPath()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function setDracoDecoderPath(path): void;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [utils/dracoDecoderPath.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/utils/dracoDecoderPath.ts#L15)
|
|
14
|
+
|
|
15
|
+
Override where the DRACO decoder files (draco_wasm_wrapper.js,
|
|
16
|
+
draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps
|
|
17
|
+
whose bundlers relocate this package's chunks — making the default
|
|
18
|
+
import.meta.url resolution point at a location that is never populated —
|
|
19
|
+
should call this before any model loads. The path must end with "/".
|
|
20
|
+
Pass null to restore the default resolution.
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
| Parameter | Type |
|
|
25
|
+
| ------ | ------ |
|
|
26
|
+
| `path` | `string` \| `null` |
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`void`
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / setPrefabAssetUrlResolver
|
|
6
|
+
|
|
7
|
+
# Function: setPrefabAssetUrlResolver()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function setPrefabAssetUrlResolver(resolver): void;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Defined in: [prefab/spawnPrefab.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/spawnPrefab.ts#L21)
|
|
14
|
+
|
|
15
|
+
Override how prefab asset URLs (the file URL itself AND every asset URL
|
|
16
|
+
stored inside prefab files) are resolved before fetching. Published/preview
|
|
17
|
+
runtimes register a resolver that maps the editor's `localasset://…/assets/x`
|
|
18
|
+
URLs to `./assets/x`; the editor leaves it unset (identity — the
|
|
19
|
+
`localasset://` protocol is fetchable there). Same pattern as
|
|
20
|
+
[setDracoDecoderPath](setDracoDecoderPath.md). Pass null to restore identity.
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
| Parameter | Type |
|
|
25
|
+
| ------ | ------ |
|
|
26
|
+
| `resolver` | ((`url`) => `string`) \| `null` |
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`void`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / spawnPrefab
|
|
6
|
+
|
|
7
|
+
# Function: spawnPrefab()
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
function spawnPrefab(
|
|
11
|
+
world,
|
|
12
|
+
source,
|
|
13
|
+
options?): Promise<number>;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Defined in: [prefab/spawnPrefab.ts:144](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/spawnPrefab.ts#L144)
|
|
17
|
+
|
|
18
|
+
Instantiate a prefab into a live world at runtime.
|
|
19
|
+
|
|
20
|
+
`source` may be a URL string, a script AssetInput (`{ path, type }`), or an
|
|
21
|
+
already-loaded [PrefabAsset](../type-aliases/PrefabAsset.md). Resolves with the root entity id once
|
|
22
|
+
all entities/components exist — heavyweight assets inside (models,
|
|
23
|
+
textures, audio) continue loading reactively through their systems, using
|
|
24
|
+
the shared model cache for repeat spawns.
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
|
|
28
|
+
| Parameter | Type |
|
|
29
|
+
| ------ | ------ |
|
|
30
|
+
| `world` | [`World`](../classes/World.md) |
|
|
31
|
+
| `source` | [`SpawnPrefabSource`](../type-aliases/SpawnPrefabSource.md) |
|
|
32
|
+
| `options?` | [`SpawnPrefabOptions`](../type-aliases/SpawnPrefabOptions.md) |
|
|
33
|
+
|
|
34
|
+
## Returns
|
|
35
|
+
|
|
36
|
+
`Promise`\<`number`\>
|
|
@@ -31,11 +31,18 @@
|
|
|
31
31
|
| [ScriptBehaviourSystem](classes/ScriptBehaviourSystem.md) | - |
|
|
32
32
|
| [TransformSyncSystem](classes/TransformSyncSystem.md) | - |
|
|
33
33
|
|
|
34
|
+
### Scripting
|
|
35
|
+
|
|
36
|
+
| Class | Description |
|
|
37
|
+
| ------ | ------ |
|
|
38
|
+
| [ScriptObject](classes/ScriptObject.md) | Base class for **script objects** — entities whose THREE.js visual is built entirely by user code (procedural geometry, shaders, particle systems, anything the editor can't author natively). |
|
|
39
|
+
|
|
34
40
|
### Systems
|
|
35
41
|
|
|
36
42
|
| Class | Description |
|
|
37
43
|
| ------ | ------ |
|
|
38
44
|
| [AudioSystem](classes/AudioSystem.md) | Reconciles `AudioComponent` state with the underlying THREE.js audio objects each frame. |
|
|
45
|
+
| [ScriptObjectSystem](classes/ScriptObjectSystem.md) | Builds, ticks, and disposes [ScriptObject](classes/ScriptObject.md) scripts. Unlike `ScriptBehaviourSystem`, this runs in the editor AND at runtime — there is NO `isEditorMode` gating anywhere here. A script's `build()` output is attached under the entity's `Object3DRef.object` (so it inherits transform, selection and visibility). `runtimeState` is written on transitions only (never every frame). |
|
|
39
46
|
| [VideoSystem](classes/VideoSystem.md) | Reconciles `VideoComponent` state with the underlying HTML video element and THREE.js mesh/material each frame. |
|
|
40
47
|
|
|
41
48
|
## Interfaces
|
|
@@ -50,21 +57,44 @@
|
|
|
50
57
|
| Type Alias | Description |
|
|
51
58
|
| ------ | ------ |
|
|
52
59
|
| [AnimationStateCallbacks](type-aliases/AnimationStateCallbacks.md) | - |
|
|
60
|
+
| [ComponentValueMaps](type-aliases/ComponentValueMaps.md) | - |
|
|
53
61
|
| [EcsWorldComponentSnapshot](type-aliases/EcsWorldComponentSnapshot.md) | - |
|
|
54
62
|
| [EcsWorldStateSnapshotLike](type-aliases/EcsWorldStateSnapshotLike.md) | - |
|
|
55
63
|
| [HydrateWorldFromSnapshotResult](type-aliases/HydrateWorldFromSnapshotResult.md) | - |
|
|
64
|
+
| [HydrateOptions](type-aliases/HydrateOptions.md) | Optional behavior tweaks for [hydrateWorldFromSnapshotDetailed](functions/hydrateWorldFromSnapshotDetailed.md). Defaults preserve the historical full-world-load behavior; prefab/subtree instantiation passes stricter options. |
|
|
65
|
+
| [ApplyPrefabToSnapshotResult](type-aliases/ApplyPrefabToSnapshotResult.md) | - |
|
|
66
|
+
| [InstantiateSubtreeResult](type-aliases/InstantiateSubtreeResult.md) | - |
|
|
67
|
+
| [NodeKeyMaps](type-aliases/NodeKeyMaps.md) | - |
|
|
68
|
+
| [NestedRegion](type-aliases/NestedRegion.md) | - |
|
|
69
|
+
| [NodeMaps](type-aliases/NodeMaps.md) | - |
|
|
70
|
+
| [SerializeEntitySubtreeResult](type-aliases/SerializeEntitySubtreeResult.md) | - |
|
|
71
|
+
| [SubtreeSnapshot](type-aliases/SubtreeSnapshot.md) | Snapshot-space entity-id walking/remapping. |
|
|
72
|
+
| [ExternalRefWarning](type-aliases/ExternalRefWarning.md) | - |
|
|
73
|
+
| [RemapSnapshotOptions](type-aliases/RemapSnapshotOptions.md) | - |
|
|
74
|
+
| [SpawnPrefabSource](type-aliases/SpawnPrefabSource.md) | - |
|
|
75
|
+
| [SpawnPrefabOptions](type-aliases/SpawnPrefabOptions.md) | - |
|
|
76
|
+
| [PrefabAsset](type-aliases/PrefabAsset.md) | Envelope of a `.prefab` asset file (and, later, `.scene` assets — same shape with `type: "scene"`). `snapshot` is the same columnar world-snapshot format `hydrateWorldFromSnapshotDetailed` consumes, with entity ids renumbered 1..N and every entity carrying a `PrefabNode` identity. |
|
|
56
77
|
| [MouseButton](type-aliases/MouseButton.md) | - |
|
|
57
78
|
| [EcsComponentFactoryKind](type-aliases/EcsComponentFactoryKind.md) | - |
|
|
58
79
|
| [ComponentFactory](type-aliases/ComponentFactory.md) | - |
|
|
59
80
|
| [SelectionContext](type-aliases/SelectionContext.md) | Optional context that enables raycast-based onSelect / onDeselect dispatch. When provided, pointer/touch taps on the canvas fire a raycast against the scene. If the hit object (or any ancestor) carries userData.entityId, every Behaviour instance for that entity receives onSelect(); the previously selected entity's instances receive onDeselect(). |
|
|
60
81
|
| [KeyboardKey](type-aliases/KeyboardKey.md) | - |
|
|
82
|
+
| [ModuleLoader](type-aliases/ModuleLoader.md) | Resolves a script URL to its ES module namespace. |
|
|
61
83
|
|
|
62
84
|
## Variables
|
|
63
85
|
|
|
64
86
|
| Variable | Description |
|
|
65
87
|
| ------ | ------ |
|
|
66
88
|
| [HYDRATABLE\_ENTITY\_KINDS](variables/HYDRATABLE_ENTITY_KINDS.md) | - |
|
|
89
|
+
| [NODE\_KEY\_SEPARATOR](variables/NODE_KEY_SEPARATOR.md) | - |
|
|
90
|
+
| [ADDED\_NODE\_MARKER\_COMPONENT](variables/ADDED_NODE_MARKER_COMPONENT.md) | Reserved override "component" marking a node ADDED by the host document inside a nested instance region (`"<nodeKey>|+node|"`). File patching trusts stored overrides (the old base is unavailable), so without the marker a host-authored node inside the region would be indistinguishable from a node the child prefab removed — and get deleted. |
|
|
91
|
+
| [OVERRIDE\_DIFF\_EXCLUDED\_COMPONENTS](variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md) | Components that never participate in override diffing/merging. |
|
|
92
|
+
| [OVERRIDE\_ROOT\_EXCLUDED\_COMPONENTS](variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md) | Components excluded ONLY on the instance ROOT node — these are per-instance by definition (where the instance sits in the scene and what it's called). |
|
|
93
|
+
| [PREFAB\_FILE\_VERSION](variables/PREFAB_FILE_VERSION.md) | - |
|
|
94
|
+
| [PREFAB\_FILE\_VERSION\_NESTED](variables/PREFAB_FILE_VERSION_NESTED.md) | Written for files containing NESTED instances (parse accepts either). |
|
|
95
|
+
| [SCRIPT\_OBJECT\_ROOT\_FLAG](variables/SCRIPT_OBJECT_ROOT_FLAG.md) | Tags the Object3D a script's `build()` returned, so reloads can find/remove it. |
|
|
67
96
|
| [KeyboardKeys](variables/KeyboardKeys.md) | - |
|
|
97
|
+
| [SHARED\_MODEL\_RESOURCE\_FLAG](variables/SHARED_MODEL_RESOURCE_FLAG.md) | userData flag set on geometries/materials that back shared (cached) model scenes. Entity disposal must skip these — other live clones and future spawns reference the same GPU resources. |
|
|
68
98
|
|
|
69
99
|
## Functions
|
|
70
100
|
|
|
@@ -91,6 +121,7 @@
|
|
|
91
121
|
| [createPhysicsComponent](functions/createPhysicsComponent.md) | - |
|
|
92
122
|
| [createPostprocessingComponent](functions/createPostprocessingComponent.md) | - |
|
|
93
123
|
| [createScriptComponent](functions/createScriptComponent.md) | - |
|
|
124
|
+
| [createScriptObjectComponent](functions/createScriptObjectComponent.md) | - |
|
|
94
125
|
| [createSelectableComponent](functions/createSelectableComponent.md) | - |
|
|
95
126
|
| [createSelectionTransformStateComponent](functions/createSelectionTransformStateComponent.md) | - |
|
|
96
127
|
| [createSpriteComponent](functions/createSpriteComponent.md) | - |
|
|
@@ -98,8 +129,42 @@
|
|
|
98
129
|
| [createVideoComponent](functions/createVideoComponent.md) | - |
|
|
99
130
|
| [registerDefaultComponentFactories](functions/registerDefaultComponentFactories.md) | - |
|
|
100
131
|
| [registerDefaultFactories](functions/registerDefaultFactories.md) | - |
|
|
132
|
+
| [buildComponentValueMaps](functions/buildComponentValueMaps.md) | - |
|
|
101
133
|
| [hydrateWorldFromSnapshotDetailed](functions/hydrateWorldFromSnapshotDetailed.md) | - |
|
|
102
134
|
| [hydrateWorldFromSnapshot](functions/hydrateWorldFromSnapshot.md) | - |
|
|
135
|
+
| [restorePostCreateComponents](functions/restorePostCreateComponents.md) | - |
|
|
136
|
+
| [restoreComponentState](functions/restoreComponentState.md) | - |
|
|
137
|
+
| [applyPrefabToSnapshotInstances](functions/applyPrefabToSnapshotInstances.md) | Patch every top-level-relative nested instance of `nestedUrl` inside `hostSnapshot` with `newNestedSnapshot`. Deeper nesting (B inside C inside A) is NOT touched here — it cascades through C's own file. |
|
|
138
|
+
| [collectEntitySubtree](functions/collectEntitySubtree.md) | Collect the given roots plus every descendant, BFS parent-first, using the `ParentId` component edges. Parent-first ordering matters: serialization renumbers ids in this order and instantiation creates entities in file order, so parents always exist before their children are linked. |
|
|
139
|
+
| [collectDirectPrefabDependencies](functions/collectDirectPrefabDependencies.md) | Direct (top-level-relative) prefab urls a document depends on — the edges of the nesting graph. Deeper nesting is reached transitively through each dependency's own file, never directly. |
|
|
140
|
+
| [instantiateSubtree](functions/instantiateSubtree.md) | Hydrate a self-contained subtree snapshot (a prefab file's `snapshot`) into a LIVE world: fresh entity ids, internal references remapped, no camera promotion, transform pass scoped to the created entities. |
|
|
141
|
+
| [buildNodeKeyMapsFromSnapshot](functions/buildNodeKeyMapsFromSnapshot.md) | - |
|
|
142
|
+
| [collectSnapshotSubtreeIds](functions/collectSnapshotSubtreeIds.md) | JSON-space subtree ids (root first, BFS) via ParentId edges. |
|
|
143
|
+
| [findTopLevelNestedRegions](functions/findTopLevelNestedRegions.md) | TOP-LEVEL-RELATIVE nested instance regions of a document: instance roots that are not the scope root and not themselves inside another region. Deeper nesting is reached by cascading through the intermediate prefab's own file, never directly. |
|
|
144
|
+
| [findSnapshotRootEntityIds](functions/findSnapshotRootEntityIds.md) | Entity ids of entities whose ParentId is null or absent. |
|
|
145
|
+
| [buildNodeMapsFromSnapshot](functions/buildNodeMapsFromSnapshot.md) | - |
|
|
146
|
+
| [indexSnapshotByEntity](functions/indexSnapshotByEntity.md) | Invert the columnar snapshot into entityId → (componentName → value). |
|
|
147
|
+
| [canonicalizeComponentValue](functions/canonicalizeComponentValue.md) | Canonicalize a serialized component value into nodeId-space: - entity-id fields → `{$node}` (internal) or raw id (external) - ScriptComponent entries keep only `{className, scriptUrl, enabled, data}` (entityId/runtimeState/runtimeMessage are per-instance transients) - ScriptObjectComponent keeps only `{scriptUrl, className, enabled, data}` (runtimeState/runtimeMessage are per-instance transients) - Object3DRef keeps only `{visibility}` (the rest is a live object ref) |
|
|
148
|
+
| [decanonicalizeComponentValue](functions/decanonicalizeComponentValue.md) | Replace every `{$node}` marker (at any depth) with the mapped entity id from `nodeToId`, or null when the node no longer exists. Exact inverse of canonicalization for the id-bearing positions. |
|
|
149
|
+
| [encodeOverride](functions/encodeOverride.md) | - |
|
|
150
|
+
| [parseOverride](functions/parseOverride.md) | - |
|
|
151
|
+
| [groupOverridePaths](functions/groupOverridePaths.md) | nodeId → componentName → set of overridden paths. |
|
|
152
|
+
| [collectDiffPaths](functions/collectDiffPaths.md) | Collect leaf paths where two canonical values differ. Semantics: - `{$node}` refs compare atomically by nodeId - arrays of differing length are ONE atomic override (the array path); equal lengths recurse per index - object key present on one side only marks that key's path - type mismatches mark the current path An empty-string path means the values differ at the top level. |
|
|
153
|
+
| [computeInstanceOverrides](functions/computeInstanceOverrides.md) | Diff a live instance subtree against its prefab base (both as serialized subtree snapshots carrying PrefabNode identity) and return the encoded override list: every path where the instance deviates from the base. |
|
|
154
|
+
| [mergeComponentValue](functions/mergeComponentValue.md) | Merge a component's NEW canonical file value with an instance's canonical value, preserving the instance side at every overridden path. An empty path ("") means the whole component is overridden → instance wins. |
|
|
155
|
+
| [serializeEntitySubtree](functions/serializeEntitySubtree.md) | Serialize `rootId` + all descendants into a self-contained snapshot: entity ids renumbered 1..N in BFS parent-first order, all internal id references remapped, external references nulled + reported, root ParentId forced to null. The result is directly consumable by `hydrateWorldFromSnapshotDetailed` / `instantiateSubtree`. |
|
|
156
|
+
| [remapSnapshotEntityIds](functions/remapSnapshotEntityIds.md) | Return a deep-cloned snapshot with every entity id (entity list, entry keys, and all id-bearing component fields) remapped through `idMap`. References to ids missing from the map follow `externalRefPolicy` and are reported in `warnings` (with ids in the INPUT snapshot's id space). |
|
|
157
|
+
| [setPrefabAssetUrlResolver](functions/setPrefabAssetUrlResolver.md) | Override how prefab asset URLs (the file URL itself AND every asset URL stored inside prefab files) are resolved before fetching. Published/preview runtimes register a resolver that maps the editor's `localasset://…/assets/x` URLs to `./assets/x`; the editor leaves it unset (identity — the `localasset://` protocol is fetchable there). Same pattern as [setDracoDecoderPath](functions/setDracoDecoderPath.md). Pass null to restore identity. |
|
|
158
|
+
| [loadPrefab](functions/loadPrefab.md) | Fetch + parse (and cache) a `.prefab` asset. All strings inside the snapshot are passed through the registered URL resolver, so asset references load correctly in published/preview builds. Use this from preloaders to warm the same cache `spawnPrefab` reads. |
|
|
159
|
+
| [clearPrefabCache](functions/clearPrefabCache.md) | Drop one cached prefab (or all when no url is given). |
|
|
160
|
+
| [spawnPrefab](functions/spawnPrefab.md) | Instantiate a prefab into a live world at runtime. |
|
|
161
|
+
| [despawnPrefab](functions/despawnPrefab.md) | Delete a spawned prefab instance: the root entity plus every descendant (children first). Returns the number of entities removed. `dispose` releases GPU resources not flagged as shared (safe with the model cache). |
|
|
162
|
+
| [prefabFileVersionFor](functions/prefabFileVersionFor.md) | File version to write for a given snapshot: 2 iff it nests instances. |
|
|
163
|
+
| [parsePrefabAsset](functions/parsePrefabAsset.md) | Validate untrusted JSON into a `PrefabAsset`, or null when malformed. |
|
|
164
|
+
| [setDracoDecoderPath](functions/setDracoDecoderPath.md) | Override where the DRACO decoder files (draco_wasm_wrapper.js, draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps whose bundlers relocate this package's chunks — making the default import.meta.url resolution point at a location that is never populated — should call this before any model loads. The path must end with "/". Pass null to restore the default resolution. |
|
|
165
|
+
| [resolveDracoDecoderPath](functions/resolveDracoDecoderPath.md) | - |
|
|
166
|
+
| [loadSharedGltf](functions/loadSharedGltf.md) | Load a GLTF once per URL and share the parsed result, so repeated spawns of the same model skip both the fetch and the parse. The cached scene must never be mounted directly (an Object3D has a single parent) — mount a cloneModelScene() of it. Failed loads are evicted so a retry re-fetches. |
|
|
167
|
+
| [clearModelCache](functions/clearModelCache.md) | Forget cached models (one URL, or everything). Subsequent loads fetch and parse anew. Does not dispose GPU resources — live clones may still use them. |
|
|
103
168
|
|
|
104
169
|
## References
|
|
105
170
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: EcsSystem
|
|
8
8
|
|
|
9
|
-
Defined in: [System.ts:3](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
9
|
+
Defined in: [System.ts:3](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/System.ts#L3)
|
|
10
10
|
|
|
11
11
|
## Methods
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Defined in: [System.ts:3](https://github.com/Relu-Interactives/relu-spatial-ecs-
|
|
|
16
16
|
update(world, deltaTime): void;
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Defined in: [System.ts:4](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
19
|
+
Defined in: [System.ts:4](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/System.ts#L4)
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
@@ -37,7 +37,7 @@ Defined in: [System.ts:4](https://github.com/Relu-Interactives/relu-spatial-ecs-
|
|
|
37
37
|
optional dispose(world): void;
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Defined in: [System.ts:5](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
40
|
+
Defined in: [System.ts:5](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/System.ts#L5)
|
|
41
41
|
|
|
42
42
|
#### Parameters
|
|
43
43
|
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: StateMachine
|
|
8
8
|
|
|
9
|
-
Defined in: [AnimationStateMachine.ts:3](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
9
|
+
Defined in: [AnimationStateMachine.ts:3](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L3)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
13
|
| Property | Type | Defined in |
|
|
14
14
|
| ------ | ------ | ------ |
|
|
15
|
-
| <a id="name"></a> `name` | `string` | [AnimationStateMachine.ts:4](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
16
|
-
| <a id="clip"></a> `clip` | `AnimationClip` | [AnimationStateMachine.ts:5](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
17
|
-
| <a id="clipid"></a> `clipId` | `string` \| `null` | [AnimationStateMachine.ts:6](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
18
|
-
| <a id="loop"></a> `loop` | `boolean` | [AnimationStateMachine.ts:7](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
19
|
-
| <a id="isplaying"></a> `isPlaying` | `boolean` | [AnimationStateMachine.ts:8](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
20
|
-
| <a id="ispaused"></a> `isPaused` | `boolean` | [AnimationStateMachine.ts:9](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
21
|
-
| <a id="onstart"></a> `onStart` | () => `void` | [AnimationStateMachine.ts:10](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
22
|
-
| <a id="onplaying"></a> `onPlaying` | () => `void` | [AnimationStateMachine.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
23
|
-
| <a id="onend"></a> `onEnd` | () => `void` | [AnimationStateMachine.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
24
|
-
| <a id="play"></a> `play` | () => `void` | [AnimationStateMachine.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
25
|
-
| <a id="pause"></a> `pause` | () => `void` | [AnimationStateMachine.ts:14](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
26
|
-
| <a id="stop"></a> `stop` | () => `void` | [AnimationStateMachine.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
15
|
+
| <a id="name"></a> `name` | `string` | [AnimationStateMachine.ts:4](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L4) |
|
|
16
|
+
| <a id="clip"></a> `clip` | `AnimationClip` | [AnimationStateMachine.ts:5](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L5) |
|
|
17
|
+
| <a id="clipid"></a> `clipId` | `string` \| `null` | [AnimationStateMachine.ts:6](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L6) |
|
|
18
|
+
| <a id="loop"></a> `loop` | `boolean` | [AnimationStateMachine.ts:7](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L7) |
|
|
19
|
+
| <a id="isplaying"></a> `isPlaying` | `boolean` | [AnimationStateMachine.ts:8](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L8) |
|
|
20
|
+
| <a id="ispaused"></a> `isPaused` | `boolean` | [AnimationStateMachine.ts:9](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L9) |
|
|
21
|
+
| <a id="onstart"></a> `onStart` | () => `void` | [AnimationStateMachine.ts:10](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L10) |
|
|
22
|
+
| <a id="onplaying"></a> `onPlaying` | () => `void` | [AnimationStateMachine.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L11) |
|
|
23
|
+
| <a id="onend"></a> `onEnd` | () => `void` | [AnimationStateMachine.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L12) |
|
|
24
|
+
| <a id="play"></a> `play` | () => `void` | [AnimationStateMachine.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L13) |
|
|
25
|
+
| <a id="pause"></a> `pause` | () => `void` | [AnimationStateMachine.ts:14](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L14) |
|
|
26
|
+
| <a id="stop"></a> `stop` | () => `void` | [AnimationStateMachine.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L15) |
|
|
@@ -14,12 +14,12 @@ type AnimationStateCallbacks = {
|
|
|
14
14
|
};
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Defined in: [AnimationStateMachine.ts:18](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
17
|
+
Defined in: [AnimationStateMachine.ts:18](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L18)
|
|
18
18
|
|
|
19
19
|
## Properties
|
|
20
20
|
|
|
21
21
|
| Property | Type | Defined in |
|
|
22
22
|
| ------ | ------ | ------ |
|
|
23
|
-
| <a id="onstart"></a> `onStart?` | () => `void` | [AnimationStateMachine.ts:19](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
24
|
-
| <a id="onplaying"></a> `onPlaying?` | () => `void` | [AnimationStateMachine.ts:20](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
25
|
-
| <a id="onend"></a> `onEnd?` | () => `void` | [AnimationStateMachine.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
23
|
+
| <a id="onstart"></a> `onStart?` | () => `void` | [AnimationStateMachine.ts:19](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L19) |
|
|
24
|
+
| <a id="onplaying"></a> `onPlaying?` | () => `void` | [AnimationStateMachine.ts:20](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L20) |
|
|
25
|
+
| <a id="onend"></a> `onEnd?` | () => `void` | [AnimationStateMachine.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/AnimationStateMachine.ts#L21) |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / ApplyPrefabToSnapshotResult
|
|
6
|
+
|
|
7
|
+
# Type Alias: ApplyPrefabToSnapshotResult
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type ApplyPrefabToSnapshotResult = {
|
|
11
|
+
snapshot: SubtreeSnapshot;
|
|
12
|
+
changed: boolean;
|
|
13
|
+
};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Defined in: [prefab/applyPrefabToSnapshot.ts:112](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/applyPrefabToSnapshot.ts#L112)
|
|
17
|
+
|
|
18
|
+
## Properties
|
|
19
|
+
|
|
20
|
+
| Property | Type | Defined in |
|
|
21
|
+
| ------ | ------ | ------ |
|
|
22
|
+
| <a id="snapshot"></a> `snapshot` | [`SubtreeSnapshot`](SubtreeSnapshot.md) | [prefab/applyPrefabToSnapshot.ts:113](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/applyPrefabToSnapshot.ts#L113) |
|
|
23
|
+
| <a id="changed"></a> `changed` | `boolean` | [prefab/applyPrefabToSnapshot.ts:114](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/applyPrefabToSnapshot.ts#L114) |
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
type ComponentFactory = (world, entityId, ...args) => unknown;
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Defined in: [systems/ObjectManagementSystem.ts:
|
|
13
|
+
Defined in: [systems/ObjectManagementSystem.ts:60](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/systems/ObjectManagementSystem.ts#L60)
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / ComponentValueMaps
|
|
6
|
+
|
|
7
|
+
# Type Alias: ComponentValueMaps
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type ComponentValueMaps = {
|
|
11
|
+
object3DRefValues: Map<number, unknown>;
|
|
12
|
+
nameValues: Map<number, unknown>;
|
|
13
|
+
transformValues: Map<number, unknown>;
|
|
14
|
+
modelValues: Map<number, unknown>;
|
|
15
|
+
imageValues: Map<number, unknown>;
|
|
16
|
+
spriteValues: Map<number, unknown>;
|
|
17
|
+
videoValues: Map<number, unknown>;
|
|
18
|
+
cameraValues: Map<number, unknown>;
|
|
19
|
+
environmentValues: Map<number, unknown>;
|
|
20
|
+
postprocessingValues: Map<number, unknown>;
|
|
21
|
+
audioValues: Map<number, unknown>;
|
|
22
|
+
imageTargetValues: Map<number, unknown>;
|
|
23
|
+
lightValues: Map<number, unknown>;
|
|
24
|
+
materialValues: Map<number, unknown>;
|
|
25
|
+
meshGeometryValues: Map<number, unknown>;
|
|
26
|
+
selectableValues: Map<number, unknown>;
|
|
27
|
+
physicsValues: Map<number, unknown>;
|
|
28
|
+
animationValues: Map<number, unknown>;
|
|
29
|
+
imageTargetAnchorValues: Map<number, unknown>;
|
|
30
|
+
scriptValues: Map<number, unknown>;
|
|
31
|
+
scriptObjectValues: Map<number, unknown>;
|
|
32
|
+
instancedMeshValues: Map<number, unknown>;
|
|
33
|
+
instanceSlotValues: Map<number, unknown>;
|
|
34
|
+
prefabNodeValues: Map<number, unknown>;
|
|
35
|
+
prefabInstanceValues: Map<number, unknown>;
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Defined in: [hydration/types.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L15)
|
|
40
|
+
|
|
41
|
+
## Properties
|
|
42
|
+
|
|
43
|
+
| Property | Type | Defined in |
|
|
44
|
+
| ------ | ------ | ------ |
|
|
45
|
+
| <a id="object3drefvalues"></a> `object3DRefValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:16](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L16) |
|
|
46
|
+
| <a id="namevalues"></a> `nameValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:17](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L17) |
|
|
47
|
+
| <a id="transformvalues"></a> `transformValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:18](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L18) |
|
|
48
|
+
| <a id="modelvalues"></a> `modelValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:19](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L19) |
|
|
49
|
+
| <a id="imagevalues"></a> `imageValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:20](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L20) |
|
|
50
|
+
| <a id="spritevalues"></a> `spriteValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L21) |
|
|
51
|
+
| <a id="videovalues"></a> `videoValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:22](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L22) |
|
|
52
|
+
| <a id="cameravalues"></a> `cameraValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:23](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L23) |
|
|
53
|
+
| <a id="environmentvalues"></a> `environmentValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:24](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L24) |
|
|
54
|
+
| <a id="postprocessingvalues"></a> `postprocessingValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:25](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L25) |
|
|
55
|
+
| <a id="audiovalues"></a> `audioValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:26](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L26) |
|
|
56
|
+
| <a id="imagetargetvalues"></a> `imageTargetValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:27](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L27) |
|
|
57
|
+
| <a id="lightvalues"></a> `lightValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:28](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L28) |
|
|
58
|
+
| <a id="materialvalues"></a> `materialValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:29](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L29) |
|
|
59
|
+
| <a id="meshgeometryvalues"></a> `meshGeometryValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:30](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L30) |
|
|
60
|
+
| <a id="selectablevalues"></a> `selectableValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:31](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L31) |
|
|
61
|
+
| <a id="physicsvalues"></a> `physicsValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:32](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L32) |
|
|
62
|
+
| <a id="animationvalues"></a> `animationValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:33](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L33) |
|
|
63
|
+
| <a id="imagetargetanchorvalues"></a> `imageTargetAnchorValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:34](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L34) |
|
|
64
|
+
| <a id="scriptvalues"></a> `scriptValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:35](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L35) |
|
|
65
|
+
| <a id="scriptobjectvalues"></a> `scriptObjectValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:36](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L36) |
|
|
66
|
+
| <a id="instancedmeshvalues"></a> `instancedMeshValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:37](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L37) |
|
|
67
|
+
| <a id="instanceslotvalues"></a> `instanceSlotValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:38](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L38) |
|
|
68
|
+
| <a id="prefabnodevalues"></a> `prefabNodeValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:39](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L39) |
|
|
69
|
+
| <a id="prefabinstancevalues"></a> `prefabInstanceValues` | `Map`\<`number`, `unknown`\> | [hydration/types.ts:40](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L40) |
|
|
@@ -27,6 +27,7 @@ type EcsComponentFactoryKind =
|
|
|
27
27
|
| "physics"
|
|
28
28
|
| "postprocessing"
|
|
29
29
|
| "script"
|
|
30
|
+
| "scriptObject"
|
|
30
31
|
| "selectable"
|
|
31
32
|
| "selectionTransformState"
|
|
32
33
|
| "sprite"
|
|
@@ -35,4 +36,4 @@ type EcsComponentFactoryKind =
|
|
|
35
36
|
| "instancedMesh";
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
Defined in: [systems/ObjectManagementSystem.ts:
|
|
39
|
+
Defined in: [systems/ObjectManagementSystem.ts:32](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/systems/ObjectManagementSystem.ts#L32)
|
|
@@ -16,11 +16,11 @@ type EcsWorldComponentSnapshot = {
|
|
|
16
16
|
};
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Defined in: [hydration/types.ts:
|
|
19
|
+
Defined in: [hydration/types.ts:43](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L43)
|
|
20
20
|
|
|
21
21
|
## Properties
|
|
22
22
|
|
|
23
23
|
| Property | Type | Defined in |
|
|
24
24
|
| ------ | ------ | ------ |
|
|
25
|
-
| <a id="component"></a> `component` | `string` | [hydration/types.ts:
|
|
26
|
-
| <a id="entries"></a> `entries` | \{ `entityId`: `number`; `value`: `unknown`; \}[] | [hydration/types.ts:
|
|
25
|
+
| <a id="component"></a> `component` | `string` | [hydration/types.ts:44](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L44) |
|
|
26
|
+
| <a id="entries"></a> `entries` | \{ `entityId`: `number`; `value`: `unknown`; \}[] | [hydration/types.ts:45](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L45) |
|
|
@@ -14,12 +14,12 @@ type EcsWorldStateSnapshotLike = {
|
|
|
14
14
|
};
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Defined in: [hydration/types.ts:
|
|
17
|
+
Defined in: [hydration/types.ts:51](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L51)
|
|
18
18
|
|
|
19
19
|
## Properties
|
|
20
20
|
|
|
21
21
|
| Property | Type | Defined in |
|
|
22
22
|
| ------ | ------ | ------ |
|
|
23
|
-
| <a id="selectedentityid"></a> `selectedEntityId?` | `number` \| `null` | [hydration/types.ts:
|
|
24
|
-
| <a id="entities"></a> `entities` | `number`[] | [hydration/types.ts:
|
|
25
|
-
| <a id="components"></a> `components` | [`EcsWorldComponentSnapshot`](EcsWorldComponentSnapshot.md)[] | [hydration/types.ts:
|
|
23
|
+
| <a id="selectedentityid"></a> `selectedEntityId?` | `number` \| `null` | [hydration/types.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L52) |
|
|
24
|
+
| <a id="entities"></a> `entities` | `number`[] | [hydration/types.ts:53](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L53) |
|
|
25
|
+
| <a id="components"></a> `components` | [`EcsWorldComponentSnapshot`](EcsWorldComponentSnapshot.md)[] | [hydration/types.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L54) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / ExternalRefWarning
|
|
6
|
+
|
|
7
|
+
# Type Alias: ExternalRefWarning
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type ExternalRefWarning = {
|
|
11
|
+
entityId: number;
|
|
12
|
+
component: string;
|
|
13
|
+
path: string;
|
|
14
|
+
targetId: number;
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Defined in: [prefab/snapshotIdUtils.ts:25](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/snapshotIdUtils.ts#L25)
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Description | Defined in |
|
|
23
|
+
| ------ | ------ | ------ | ------ |
|
|
24
|
+
| <a id="entityid"></a> `entityId` | `number` | Entity id (in the INPUT snapshot's id space) holding the reference. | [prefab/snapshotIdUtils.ts:27](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/snapshotIdUtils.ts#L27) |
|
|
25
|
+
| <a id="component"></a> `component` | `string` | - | [prefab/snapshotIdUtils.ts:28](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/snapshotIdUtils.ts#L28) |
|
|
26
|
+
| <a id="path"></a> `path` | `string` | Slash-separated path of the reference inside the component value. | [prefab/snapshotIdUtils.ts:30](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/snapshotIdUtils.ts#L30) |
|
|
27
|
+
| <a id="targetid"></a> `targetId` | `number` | The referenced entity id that falls outside the id map. | [prefab/snapshotIdUtils.ts:32](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/prefab/snapshotIdUtils.ts#L32) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [index](../index.md) / HydrateOptions
|
|
6
|
+
|
|
7
|
+
# Type Alias: HydrateOptions
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type HydrateOptions = {
|
|
11
|
+
assignPrimaryCamera?: boolean;
|
|
12
|
+
applyTransformsScope?: "world" | "created";
|
|
13
|
+
};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Defined in: [hydration/types.ts:69](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L69)
|
|
17
|
+
|
|
18
|
+
Optional behavior tweaks for [hydrateWorldFromSnapshotDetailed](../functions/hydrateWorldFromSnapshotDetailed.md).
|
|
19
|
+
Defaults preserve the historical full-world-load behavior; prefab/subtree
|
|
20
|
+
instantiation passes stricter options.
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Type | Description | Defined in |
|
|
25
|
+
| ------ | ------ | ------ | ------ |
|
|
26
|
+
| <a id="assignprimarycamera"></a> `assignPrimaryCamera?` | `boolean` | When false, no camera in the snapshot is promoted to the world camera. Defaults to true (full scene loads want their default camera active); prefab spawns pass false so a spawned camera never hijacks the view. | [hydration/types.ts:75](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L75) |
|
|
27
|
+
| <a id="applytransformsscope"></a> `applyTransformsScope?` | `"world"` \| `"created"` | "world" (default) re-applies local transforms for every entity in the world after parent links restore — correct for full scene loads. "created" limits the pass to entities created by THIS hydrate call, so mid-session spawns don't touch unrelated live entities. | [hydration/types.ts:82](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L82) |
|
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
type HydrateWorldFromSnapshotResult = {
|
|
11
11
|
restoredCount: number;
|
|
12
12
|
selectedEntityId: number | null;
|
|
13
|
+
idMap: Map<number, number>;
|
|
13
14
|
};
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
Defined in: [hydration/types.ts:
|
|
17
|
+
Defined in: [hydration/types.ts:57](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L57)
|
|
17
18
|
|
|
18
19
|
## Properties
|
|
19
20
|
|
|
20
|
-
| Property | Type | Defined in |
|
|
21
|
-
| ------ | ------ | ------ |
|
|
22
|
-
| <a id="restoredcount"></a> `restoredCount` | `number` | [hydration/types.ts:
|
|
23
|
-
| <a id="selectedentityid"></a> `selectedEntityId` | `number` \| `null` | [hydration/types.ts:
|
|
21
|
+
| Property | Type | Description | Defined in |
|
|
22
|
+
| ------ | ------ | ------ | ------ |
|
|
23
|
+
| <a id="restoredcount"></a> `restoredCount` | `number` | - | [hydration/types.ts:58](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L58) |
|
|
24
|
+
| <a id="selectedentityid"></a> `selectedEntityId` | `number` \| `null` | - | [hydration/types.ts:59](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L59) |
|
|
25
|
+
| <a id="idmap"></a> `idMap` | `Map`\<`number`, `number`\> | Snapshot entity id → created live entity id for every hydrated entity. | [hydration/types.ts:61](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/hydration/types.ts#L61) |
|