@relu-interactives/spatial-ecs 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7QBONTBW.js → chunk-CJW6K3CL.js} +52 -39
- package/dist/chunk-CJW6K3CL.js.map +1 -0
- package/dist/{chunk-D3AKP6QQ.js → chunk-EPK6MA7X.js} +4 -5
- package/dist/chunk-EPK6MA7X.js.map +1 -0
- package/dist/{chunk-27RBPOVO.js → chunk-GRUK5TNL.js} +68 -12
- package/dist/chunk-GRUK5TNL.js.map +1 -0
- package/dist/factories/index.cjs +196 -142
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.js +2 -2
- package/dist/index.cjs +312 -237
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +6 -6
- package/dist/systems/index.cjs +120 -118
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-27RBPOVO.js.map +0 -1
- package/dist/chunk-7QBONTBW.js.map +0 -1
- package/dist/chunk-D3AKP6QQ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,7 @@ export { a2 as AnimationStateCallbacks, a3 as AnimationStateMachine, a4 as Anima
|
|
|
6
6
|
export { i as CoreComponents } from './index-BfoOC2CG.cjs';
|
|
7
7
|
export { AnimationSystem, AudioSystem, CameraSyncSystem, EnvironmentSyncSystem, InstancedMeshSystem, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, ScriptBehaviourSystem, 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, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.cjs';
|
|
9
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
9
10
|
import '@dimforge/rapier3d-compat';
|
|
10
11
|
|
|
11
12
|
interface CustomEcsSystem extends EcsSystem {
|
|
@@ -280,4 +281,34 @@ declare const HYDRATABLE_ENTITY_KINDS: Set<EcsEntityKind>;
|
|
|
280
281
|
declare function hydrateWorldFromSnapshotDetailed(snapshot: EcsWorldStateSnapshotLike | null | undefined, world: World, objectManagementSystem: ObjectManagementSystem): HydrateWorldFromSnapshotResult;
|
|
281
282
|
declare function hydrateWorldFromSnapshot(snapshot: EcsWorldStateSnapshotLike | null | undefined, world: World, objectManagementSystem: ObjectManagementSystem): number;
|
|
282
283
|
|
|
283
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Override where the DRACO decoder files (draco_wasm_wrapper.js,
|
|
286
|
+
* draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps
|
|
287
|
+
* whose bundlers relocate this package's chunks — making the default
|
|
288
|
+
* import.meta.url resolution point at a location that is never populated —
|
|
289
|
+
* should call this before any model loads. The path must end with "/".
|
|
290
|
+
* Pass null to restore the default resolution.
|
|
291
|
+
*/
|
|
292
|
+
declare function setDracoDecoderPath(path: string | null): void;
|
|
293
|
+
declare function resolveDracoDecoderPath(): string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* userData flag set on geometries/materials that back shared (cached) model
|
|
297
|
+
* scenes. Entity disposal must skip these — other live clones and future
|
|
298
|
+
* spawns reference the same GPU resources.
|
|
299
|
+
*/
|
|
300
|
+
declare const SHARED_MODEL_RESOURCE_FLAG = "spatialEcsSharedModelResource";
|
|
301
|
+
/**
|
|
302
|
+
* Load a GLTF once per URL and share the parsed result, so repeated spawns of
|
|
303
|
+
* the same model skip both the fetch and the parse. The cached scene must
|
|
304
|
+
* never be mounted directly (an Object3D has a single parent) — mount a
|
|
305
|
+
* cloneModelScene() of it. Failed loads are evicted so a retry re-fetches.
|
|
306
|
+
*/
|
|
307
|
+
declare function loadSharedGltf(url: string, load: () => Promise<GLTF>): Promise<GLTF>;
|
|
308
|
+
/**
|
|
309
|
+
* Forget cached models (one URL, or everything). Subsequent loads fetch and
|
|
310
|
+
* parse anew. Does not dispose GPU resources — live clones may still use them.
|
|
311
|
+
*/
|
|
312
|
+
declare function clearModelCache(url?: string): void;
|
|
313
|
+
|
|
314
|
+
export { Behaviour, Component, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, HYDRATABLE_ENTITY_KINDS, type HydrateWorldFromSnapshotResult, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, World, WorldEntityView, clearModelCache, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { a2 as AnimationStateCallbacks, a3 as AnimationStateMachine, a4 as Anima
|
|
|
6
6
|
export { i as CoreComponents } from './index-BoJ3_6a3.js';
|
|
7
7
|
export { AnimationSystem, AudioSystem, CameraSyncSystem, EnvironmentSyncSystem, InstancedMeshSystem, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, ScriptBehaviourSystem, 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, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './factories/index.js';
|
|
9
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
9
10
|
import '@dimforge/rapier3d-compat';
|
|
10
11
|
|
|
11
12
|
interface CustomEcsSystem extends EcsSystem {
|
|
@@ -280,4 +281,34 @@ declare const HYDRATABLE_ENTITY_KINDS: Set<EcsEntityKind>;
|
|
|
280
281
|
declare function hydrateWorldFromSnapshotDetailed(snapshot: EcsWorldStateSnapshotLike | null | undefined, world: World, objectManagementSystem: ObjectManagementSystem): HydrateWorldFromSnapshotResult;
|
|
281
282
|
declare function hydrateWorldFromSnapshot(snapshot: EcsWorldStateSnapshotLike | null | undefined, world: World, objectManagementSystem: ObjectManagementSystem): number;
|
|
282
283
|
|
|
283
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Override where the DRACO decoder files (draco_wasm_wrapper.js,
|
|
286
|
+
* draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps
|
|
287
|
+
* whose bundlers relocate this package's chunks — making the default
|
|
288
|
+
* import.meta.url resolution point at a location that is never populated —
|
|
289
|
+
* should call this before any model loads. The path must end with "/".
|
|
290
|
+
* Pass null to restore the default resolution.
|
|
291
|
+
*/
|
|
292
|
+
declare function setDracoDecoderPath(path: string | null): void;
|
|
293
|
+
declare function resolveDracoDecoderPath(): string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* userData flag set on geometries/materials that back shared (cached) model
|
|
297
|
+
* scenes. Entity disposal must skip these — other live clones and future
|
|
298
|
+
* spawns reference the same GPU resources.
|
|
299
|
+
*/
|
|
300
|
+
declare const SHARED_MODEL_RESOURCE_FLAG = "spatialEcsSharedModelResource";
|
|
301
|
+
/**
|
|
302
|
+
* Load a GLTF once per URL and share the parsed result, so repeated spawns of
|
|
303
|
+
* the same model skip both the fetch and the parse. The cached scene must
|
|
304
|
+
* never be mounted directly (an Object3D has a single parent) — mount a
|
|
305
|
+
* cloneModelScene() of it. Failed loads are evicted so a retry re-fetches.
|
|
306
|
+
*/
|
|
307
|
+
declare function loadSharedGltf(url: string, load: () => Promise<GLTF>): Promise<GLTF>;
|
|
308
|
+
/**
|
|
309
|
+
* Forget cached models (one URL, or everything). Subsequent loads fetch and
|
|
310
|
+
* parse anew. Does not dispose GPU resources — live clones may still use them.
|
|
311
|
+
*/
|
|
312
|
+
declare function clearModelCache(url?: string): void;
|
|
313
|
+
|
|
314
|
+
export { Behaviour, Component, EcsEntityKind, EcsSystem, type EcsWorldComponentSnapshot, type EcsWorldStateSnapshotLike, HYDRATABLE_ENTITY_KINDS, type HydrateWorldFromSnapshotResult, ObjectManagementSystem, ParentLookup, SHARED_MODEL_RESOURCE_FLAG, World, WorldEntityView, clearModelCache, hydrateWorldFromSnapshot, hydrateWorldFromSnapshotDetailed, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem } from './chunk-
|
|
2
|
-
export { AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, ScriptBehaviourSystem, TransformSyncSystem, VideoSystem } 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, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-
|
|
5
|
-
import { ObjectManagementSystem, applyTransform } from './chunk-
|
|
6
|
-
export { ObjectManagementSystem } from './chunk-
|
|
1
|
+
import { MeshGeometrySystem, InstancedMeshSystem, EnvironmentSyncSystem, PostprocessingSyncSystem, LightSyncSystem, MaterialSyncSystem, PhysicsSyncSystem, AnimationSystem, AudioSystem, VideoSystem, CameraSyncSystem, TransformSyncSystem, ObjectVisibilitySystem, RenderSystem } from './chunk-EPK6MA7X.js';
|
|
2
|
+
export { AnimationSystem, AudioSystem, Behaviour, CameraSyncSystem, EnvironmentSyncSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, ScriptBehaviourSystem, TransformSyncSystem, VideoSystem } from './chunk-EPK6MA7X.js';
|
|
3
|
+
import { registerDefaultFactories } from './chunk-CJW6K3CL.js';
|
|
4
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories } from './chunk-CJW6K3CL.js';
|
|
5
|
+
import { ObjectManagementSystem, applyTransform } from './chunk-GRUK5TNL.js';
|
|
6
|
+
export { ObjectManagementSystem, SHARED_MODEL_RESOURCE_FLAG, clearModelCache, loadSharedGltf, resolveDracoDecoderPath, setDracoDecoderPath } from './chunk-GRUK5TNL.js';
|
|
7
7
|
import { SelectionTransformState, Object3DRef, Name, EntityType, ParentId, Environment, Postprocessing, ScriptComponent, InstancedMeshComponent, InstanceSlotComponent, AnimationComponent, TransformComponent, ModelComponent, ImageComponent, SpriteComponent, VideoComponent, AudioComponent, CameraComponent, ImageTarget, LightComponent, MaterialComponent, MeshGeometryComponent, Selectable, PhysicsComponent } from './chunk-FTIQQK62.js';
|
|
8
8
|
export { AnimationStateMachine, AnimationStateManager, components_exports as CoreComponents } from './chunk-FTIQQK62.js';
|
|
9
9
|
import './chunk-QHILSPT4.js';
|