@relu-interactives/spatial-ecs 0.2.24 → 0.2.25
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/{Video-ppAXaKt0.d.cts → Video-AIQYTAAr.d.cts} +15 -3
- package/dist/{Video-C1IOat7L.d.ts → Video-DlZ4G9ig.d.ts} +15 -3
- package/dist/{chunk-CCE5K2TU.js → chunk-3P3ZBP7K.js} +17 -13
- package/dist/chunk-3P3ZBP7K.js.map +1 -0
- package/dist/{chunk-JHCPRVBC.js → chunk-J6736FFO.js} +16 -6
- package/dist/chunk-J6736FFO.js.map +1 -0
- package/dist/{chunk-ZXGHKX7N.js → chunk-OWQSESTO.js} +12 -2
- package/dist/chunk-OWQSESTO.js.map +1 -0
- package/dist/{chunk-52CHDPRQ.js → chunk-RJ4J5UEX.js} +4 -4
- package/dist/{chunk-52CHDPRQ.js.map → chunk-RJ4J5UEX.js.map} +1 -1
- package/dist/{chunk-WKGCC7YL.js → chunk-XFD74BQL.js} +3 -3
- package/dist/{chunk-WKGCC7YL.js.map → chunk-XFD74BQL.js.map} +1 -1
- package/dist/components/index.cjs +12 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +1 -1
- package/dist/factories/index.cjs +11 -2
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +1 -1
- package/dist/factories/index.d.ts +1 -1
- package/dist/factories/index.js +3 -3
- package/dist/{index-DdiWu1b6.d.ts → index-BwiRJNIT.d.ts} +3 -2
- package/dist/{index-Cu2Pt7wN.d.cts → index-Gr8aCPRM.d.cts} +3 -2
- package/dist/index.cjs +36 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/systems/index.cjs +24 -11
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.js +3 -3
- package/dist/worldSnapshotUtils.cjs +10 -0
- package/dist/worldSnapshotUtils.cjs.map +1 -1
- package/dist/worldSnapshotUtils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CCE5K2TU.js.map +0 -1
- package/dist/chunk-JHCPRVBC.js.map +0 -1
- package/dist/chunk-ZXGHKX7N.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-CYWZ_Zx5.cjs';
|
|
2
2
|
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-CYWZ_Zx5.cjs';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { O as Object3DRef } from './Video-
|
|
5
|
-
export {
|
|
6
|
-
export { i as CoreComponents } from './index-
|
|
4
|
+
import { O as Object3DRef } from './Video-AIQYTAAr.cjs';
|
|
5
|
+
export { a7 as AnimationStateCallbacks, a8 as AnimationStateMachine, a9 as AnimationStateManager, aa as StateMachine } from './Video-AIQYTAAr.cjs';
|
|
6
|
+
export { i as CoreComponents } from './index-Gr8aCPRM.cjs';
|
|
7
7
|
export { AnimationSystem, AudioSystem, CameraSyncSystem, EnvironmentSyncSystem, InstancedMeshSystem, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ModuleLoader, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, SelectionContext, VideoSystem } from './systems/index.cjs';
|
|
8
8
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.cjs';
|
|
9
9
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { k as EcsSystem, C as Component, W as WorldEntityView, T as TransformComponent, l as World, S as SpawnPrefabSource, m as SpawnPrefabOptions, n as ComponentClass, o as ParentLookup, p as EcsEntityKind, O as ObjectManagementSystem, q as SubtreeSnapshot, r as EntityId, s as ExternalRefWarning } from './System-CYWZ_Zx5.js';
|
|
2
2
|
export { A as AssetInput, t as CheckboxInput, u as ColorInput, v as ComponentFactory, w as ComponentInput, x as ComponentKind, y as DropdownInput, z as DropdownOption, B as EcsComponentFactoryKind, F as EcsEntityEditorKind, G as EntityInput, H as FloatInput, I as InputSystem, J as IntersectionResult, K as KeyboardKey, L as KeyboardKeys, M as MouseButton, N as PREFAB_FILE_VERSION, Q as PREFAB_FILE_VERSION_NESTED, R as PrefabAsset, U as RemapSnapshotOptions, X as RenderSystem, Y as SelectionListener, Z as SliderInput, _ as TextInput, $ as ToggleInput, a0 as TransformSyncSystem, a1 as Vec3, a2 as Vector2Input, a3 as Vector3Input, a4 as clearPrefabCache, a5 as despawnPrefab, a6 as loadPrefab, a7 as parsePrefabAsset, a8 as prefabFileVersionFor, a9 as remapSnapshotEntityIds, aa as setPrefabAssetUrlResolver, ab as spawnPrefab } from './System-CYWZ_Zx5.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { O as Object3DRef } from './Video-
|
|
5
|
-
export {
|
|
6
|
-
export { i as CoreComponents } from './index-
|
|
4
|
+
import { O as Object3DRef } from './Video-DlZ4G9ig.js';
|
|
5
|
+
export { a7 as AnimationStateCallbacks, a8 as AnimationStateMachine, a9 as AnimationStateManager, aa as StateMachine } from './Video-DlZ4G9ig.js';
|
|
6
|
+
export { i as CoreComponents } from './index-BwiRJNIT.js';
|
|
7
7
|
export { AnimationSystem, AudioSystem, CameraSyncSystem, EnvironmentSyncSystem, InstancedMeshSystem, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ModuleLoader, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, SelectionContext, VideoSystem } from './systems/index.js';
|
|
8
8
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.js';
|
|
9
9
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-
|
|
2
|
-
export { ADDED_NODE_MARKER_COMPONENT, AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, HYDRATABLE_ENTITY_KINDS, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, TransformSyncSystem, VideoSystem, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, decanonicalizeComponentValue, despawnPrefab, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, restoreComponentState, restorePostCreateComponents, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-
|
|
3
|
-
import { registerDefaultFactories } from './chunk-
|
|
4
|
-
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-
|
|
5
|
-
import { ObjectManagementSystem } from './chunk-
|
|
6
|
-
export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-
|
|
7
|
-
import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-
|
|
8
|
-
export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents } from './chunk-
|
|
1
|
+
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem, spawnPrefab, despawnPrefab, buildNodeKeyMapsFromSnapshot, indexSnapshotByEntity, findTopLevelNestedRegions, collectSnapshotSubtreeIds, groupOverridePaths, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, canonicalizeComponentValue, mergeComponentValue, decanonicalizeComponentValue, computeInstanceOverrides, collectEntitySubtree, ADDED_NODE_MARKER_COMPONENT } from './chunk-3P3ZBP7K.js';
|
|
2
|
+
export { ADDED_NODE_MARKER_COMPONENT, AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, HYDRATABLE_ENTITY_KINDS, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, NODE_KEY_SEPARATOR, OVERRIDE_DIFF_EXCLUDED_COMPONENTS, OVERRIDE_ROOT_EXCLUDED_COMPONENTS, ObjectVisibilitySystem, PREFAB_FILE_VERSION, PREFAB_FILE_VERSION_NESTED, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObject, ScriptObjectSystem, TransformSyncSystem, VideoSystem, buildComponentValueMaps, buildNodeKeyMapsFromSnapshot, buildNodeMapsFromSnapshot, canonicalizeComponentValue, clearPrefabCache, collectDiffPaths, collectEntitySubtree, collectSnapshotSubtreeIds, computeInstanceOverrides, decanonicalizeComponentValue, despawnPrefab, encodeOverride, findSnapshotRootEntityIds, findTopLevelNestedRegions, groupOverridePaths, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, indexSnapshotByEntity, instantiateSubtree, loadPrefab, mergeComponentValue, parseOverride, parsePrefabAsset, prefabFileVersionFor, restoreComponentState, restorePostCreateComponents, setPrefabAssetUrlResolver, spawnPrefab } from './chunk-3P3ZBP7K.js';
|
|
3
|
+
import { registerDefaultFactories } from './chunk-RJ4J5UEX.js';
|
|
4
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-RJ4J5UEX.js';
|
|
5
|
+
import { ObjectManagementSystem } from './chunk-XFD74BQL.js';
|
|
6
|
+
export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-XFD74BQL.js';
|
|
7
|
+
import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent } from './chunk-J6736FFO.js';
|
|
8
|
+
export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents } from './chunk-J6736FFO.js';
|
|
9
9
|
import './chunk-QHILSPT4.js';
|
|
10
|
-
import { normalizeDebugValue, DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue } from './chunk-
|
|
10
|
+
import { normalizeDebugValue, DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue } from './chunk-OWQSESTO.js';
|
|
11
11
|
import { __name } from './chunk-OY7ZODZP.js';
|
|
12
12
|
export { Component } from './chunk-OY7ZODZP.js';
|
|
13
13
|
import * as THREE from 'three';
|
package/dist/systems/index.cjs
CHANGED
|
@@ -1596,12 +1596,21 @@ function normalizePhysicsState(value) {
|
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
1598
|
__name(normalizePhysicsState, "normalizePhysicsState");
|
|
1599
|
+
function setPhysicsLiveRef(component, key, value) {
|
|
1600
|
+
Object.defineProperty(component, key, {
|
|
1601
|
+
value,
|
|
1602
|
+
writable: true,
|
|
1603
|
+
configurable: true,
|
|
1604
|
+
enumerable: false
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
__name(setPhysicsLiveRef, "setPhysicsLiveRef");
|
|
1599
1608
|
var _PhysicsComponent = class _PhysicsComponent extends Component {
|
|
1600
1609
|
constructor(values) {
|
|
1601
1610
|
super();
|
|
1602
1611
|
this.values = normalizePhysicsState(values);
|
|
1603
|
-
this
|
|
1604
|
-
this
|
|
1612
|
+
setPhysicsLiveRef(this, "rigidBody", null);
|
|
1613
|
+
setPhysicsLiveRef(this, "collider", null);
|
|
1605
1614
|
}
|
|
1606
1615
|
/**
|
|
1607
1616
|
* Patch rigidbody and/or collider state. Each sub-object is deep-merged
|
|
@@ -3228,8 +3237,8 @@ var _PhysicsSyncSystem = class _PhysicsSyncSystem {
|
|
|
3228
3237
|
}
|
|
3229
3238
|
if (!physics.values.rigidbody.enabled) {
|
|
3230
3239
|
this.removeEntityPhysics(physicsWorld, entityId);
|
|
3231
|
-
physics
|
|
3232
|
-
physics
|
|
3240
|
+
setPhysicsLiveRef(physics, "rigidBody", null);
|
|
3241
|
+
setPhysicsLiveRef(physics, "collider", null);
|
|
3233
3242
|
continue;
|
|
3234
3243
|
}
|
|
3235
3244
|
const rigidBodySignature = JSON.stringify(physics.values.rigidbody);
|
|
@@ -3273,7 +3282,7 @@ var _PhysicsSyncSystem = class _PhysicsSyncSystem {
|
|
|
3273
3282
|
}
|
|
3274
3283
|
this.rigidBodyHandles.set(entityId, body2.handle);
|
|
3275
3284
|
this.rigidBodySignatures.set(entityId, rigidBodySignature);
|
|
3276
|
-
physics
|
|
3285
|
+
setPhysicsLiveRef(physics, "rigidBody", body2);
|
|
3277
3286
|
}
|
|
3278
3287
|
const rigidBodyHandle = this.rigidBodyHandles.get(entityId);
|
|
3279
3288
|
if (typeof rigidBodyHandle !== "number") {
|
|
@@ -3282,11 +3291,11 @@ var _PhysicsSyncSystem = class _PhysicsSyncSystem {
|
|
|
3282
3291
|
const body = physicsWorld.getRigidBody(rigidBodyHandle);
|
|
3283
3292
|
if (!body) {
|
|
3284
3293
|
this.removeEntityPhysics(physicsWorld, entityId);
|
|
3285
|
-
physics
|
|
3286
|
-
physics
|
|
3294
|
+
setPhysicsLiveRef(physics, "rigidBody", null);
|
|
3295
|
+
setPhysicsLiveRef(physics, "collider", null);
|
|
3287
3296
|
continue;
|
|
3288
3297
|
}
|
|
3289
|
-
physics
|
|
3298
|
+
setPhysicsLiveRef(physics, "rigidBody", body);
|
|
3290
3299
|
if (this.isEditorMode || physics.values.rigidbody.type !== "dynamic") {
|
|
3291
3300
|
syncBodyFromTransform(body, transform);
|
|
3292
3301
|
}
|
|
@@ -3302,7 +3311,7 @@ var _PhysicsSyncSystem = class _PhysicsSyncSystem {
|
|
|
3302
3311
|
}
|
|
3303
3312
|
this.colliderHandles.delete(entityId);
|
|
3304
3313
|
this.colliderSignatures.delete(entityId);
|
|
3305
|
-
physics
|
|
3314
|
+
setPhysicsLiveRef(physics, "collider", null);
|
|
3306
3315
|
continue;
|
|
3307
3316
|
}
|
|
3308
3317
|
const colliderSignature = `${JSON.stringify(effectiveCollider)}:${triMeshParts?.signature ?? ""}`;
|
|
@@ -3323,10 +3332,14 @@ var _PhysicsSyncSystem = class _PhysicsSyncSystem {
|
|
|
3323
3332
|
const createdCollider = physicsWorld.createCollider(colliderDesc, body);
|
|
3324
3333
|
this.colliderHandles.set(entityId, createdCollider.handle);
|
|
3325
3334
|
this.colliderSignatures.set(entityId, colliderSignature);
|
|
3326
|
-
physics
|
|
3335
|
+
setPhysicsLiveRef(physics, "collider", createdCollider);
|
|
3327
3336
|
} else {
|
|
3328
3337
|
const colliderHandle = this.colliderHandles.get(entityId);
|
|
3329
|
-
|
|
3338
|
+
setPhysicsLiveRef(
|
|
3339
|
+
physics,
|
|
3340
|
+
"collider",
|
|
3341
|
+
typeof colliderHandle === "number" ? physicsWorld.getCollider(colliderHandle) ?? null : null
|
|
3342
|
+
);
|
|
3330
3343
|
}
|
|
3331
3344
|
}
|
|
3332
3345
|
if (!this.isEditorMode) {
|