@relu-interactives/spatial-ecs 0.2.7 → 0.2.9
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-CIiWteft.d.cts → System-AV2_87Zr.d.cts} +1 -1
- package/dist/{System-CIiWteft.d.ts → System-AV2_87Zr.d.ts} +1 -1
- package/dist/{Video-Dj4KBqQ1.d.cts → Video-Bn93p6XV.d.cts} +27 -5
- package/dist/{Video-B-qMljTn.d.ts → Video-D6mObK_5.d.ts} +27 -5
- package/dist/{chunk-R5D5PWXV.js → chunk-AZR6SLQN.js} +16 -4
- package/dist/chunk-AZR6SLQN.js.map +1 -0
- package/dist/{chunk-EIC5B3A7.js → chunk-LE6ARNYQ.js} +84 -13
- package/dist/chunk-LE6ARNYQ.js.map +1 -0
- package/dist/{chunk-FDWNCXU3.js → chunk-ODCWJHPS.js} +3 -3
- package/dist/{chunk-FDWNCXU3.js.map → chunk-ODCWJHPS.js.map} +1 -1
- package/dist/{chunk-G2DUXNTQ.js → chunk-PHIEXEKJ.js} +10 -3
- package/dist/chunk-PHIEXEKJ.js.map +1 -0
- package/dist/{chunk-2F6T3BVO.js → chunk-SABZQFSA.js} +47 -29
- package/dist/chunk-SABZQFSA.js.map +1 -0
- package/dist/components/index.cjs +13 -1
- 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 +92 -9
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +7 -4
- package/dist/factories/index.d.ts +7 -4
- package/dist/factories/index.js +3 -3
- package/dist/{index-Cf-PaKyN.d.ts → index-B4-ABchF.d.cts} +4 -3
- package/dist/{index-B12sx9yF.d.cts → index-BO49V8aS.d.ts} +4 -3
- package/dist/index.cjs +187 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +52 -14
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +44 -31
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.ts +2 -2
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.cjs +8 -1
- package/dist/worldSnapshotUtils.cjs.map +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/dist/worldSnapshotUtils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2F6T3BVO.js.map +0 -1
- package/dist/chunk-EIC5B3A7.js.map +0 -1
- package/dist/chunk-G2DUXNTQ.js.map +0 -1
- package/dist/chunk-R5D5PWXV.js.map +0 -1
|
@@ -86,7 +86,7 @@ type EntityId = number;
|
|
|
86
86
|
* maps to an object factory in `core/factories/objects/*` that creates the
|
|
87
87
|
* baseline component set.
|
|
88
88
|
*/
|
|
89
|
-
type EcsEntityKind = "cube" | "sphere" | "plane" | "capsule" | "cylinder" | "empty" | "model" | "image" | "imageTarget" | "sprite" | "audio" | "camera" | "video" | "ambientLight" | "directionalLight" | "pointLight" | "spotLight" | "areaLight" | "instancedMesh";
|
|
89
|
+
type EcsEntityKind = "cube" | "sphere" | "plane" | "capsule" | "cylinder" | "empty" | "model" | "image" | "imageTarget" | "sprite" | "audio" | "camera" | "video" | "ambientLight" | "directionalLight" | "pointLight" | "spotLight" | "areaLight" | "instancedMesh" | "instanceSlot";
|
|
90
90
|
/** {@link EcsEntityKind} extended with editor-only utility entities (gizmos, helpers). */
|
|
91
91
|
type EcsEntityEditorKind = EcsEntityKind | "editorUtility";
|
|
92
92
|
/** Callback invoked when the selected entity changes. `null` indicates a deselection. */
|
|
@@ -86,7 +86,7 @@ type EntityId = number;
|
|
|
86
86
|
* maps to an object factory in `core/factories/objects/*` that creates the
|
|
87
87
|
* baseline component set.
|
|
88
88
|
*/
|
|
89
|
-
type EcsEntityKind = "cube" | "sphere" | "plane" | "capsule" | "cylinder" | "empty" | "model" | "image" | "imageTarget" | "sprite" | "audio" | "camera" | "video" | "ambientLight" | "directionalLight" | "pointLight" | "spotLight" | "areaLight" | "instancedMesh";
|
|
89
|
+
type EcsEntityKind = "cube" | "sphere" | "plane" | "capsule" | "cylinder" | "empty" | "model" | "image" | "imageTarget" | "sprite" | "audio" | "camera" | "video" | "ambientLight" | "directionalLight" | "pointLight" | "spotLight" | "areaLight" | "instancedMesh" | "instanceSlot";
|
|
90
90
|
/** {@link EcsEntityKind} extended with editor-only utility entities (gizmos, helpers). */
|
|
91
91
|
type EcsEntityEditorKind = EcsEntityKind | "editorUtility";
|
|
92
92
|
/** Callback invoked when the selected entity changes. `null` indicates a deselection. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { C as Component, e as EcsEntityKind, m as EcsEntityEditorKind, n as EntityId } from './System-
|
|
2
|
+
import { C as Component, e as EcsEntityKind, m as EcsEntityEditorKind, n as EntityId } from './System-AV2_87Zr.cjs';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
|
|
5
5
|
interface StateMachine {
|
|
@@ -678,8 +678,12 @@ declare class InstancedMeshComponent extends Component {
|
|
|
678
678
|
castShadow: boolean;
|
|
679
679
|
/** Whether all instances receive shadows. */
|
|
680
680
|
receiveShadow: boolean;
|
|
681
|
-
/**
|
|
682
|
-
|
|
681
|
+
/**
|
|
682
|
+
* Ordered list of entity IDs for the instance slot entities owned by this group.
|
|
683
|
+
* Each slot entity carries a `TransformComponent` that `InstancedMeshSystem`
|
|
684
|
+
* reads every frame to build the per-instance matrix.
|
|
685
|
+
*/
|
|
686
|
+
instanceEntityIds: number[];
|
|
683
687
|
/**
|
|
684
688
|
* Live runtime container managed by {@link InstancedMeshSystem}:
|
|
685
689
|
* - For primitive kinds: a `THREE.InstancedMesh`.
|
|
@@ -690,13 +694,31 @@ declare class InstancedMeshComponent extends Component {
|
|
|
690
694
|
constructor(meshKind?: InstancedMeshKind, meshParameters?: Partial<MeshGeometryParameters>, options?: {
|
|
691
695
|
castShadow?: boolean;
|
|
692
696
|
receiveShadow?: boolean;
|
|
693
|
-
|
|
697
|
+
instanceEntityIds?: number[];
|
|
694
698
|
modelPath?: string;
|
|
695
699
|
});
|
|
696
700
|
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
697
701
|
getSanitizedParameters(): MeshGeometryParameters;
|
|
698
702
|
}
|
|
699
703
|
|
|
704
|
+
/**
|
|
705
|
+
* Marks an entity as an instance slot owned by an {@link InstancedMeshComponent} group entity.
|
|
706
|
+
*
|
|
707
|
+
* Instance slot entities are lightweight data containers — they carry
|
|
708
|
+
* `TransformComponent` (the per-instance local transform) and this component,
|
|
709
|
+
* but do **not** have an `Object3DRef`. Their transforms are consumed each
|
|
710
|
+
* frame by `InstancedMeshSystem` to compose the instance matrix.
|
|
711
|
+
*
|
|
712
|
+
* @category Components
|
|
713
|
+
*/
|
|
714
|
+
declare class InstanceSlotComponent extends Component {
|
|
715
|
+
/** Entity ID of the owning `instancedMesh` group entity. */
|
|
716
|
+
groupEntityId: number;
|
|
717
|
+
/** Zero-based index of this slot within the group's `instanceEntityIds` array. */
|
|
718
|
+
slotIndex: number;
|
|
719
|
+
constructor(groupEntityId: number, slotIndex: number);
|
|
720
|
+
}
|
|
721
|
+
|
|
700
722
|
type RapierRigidBody = RAPIER.RigidBody;
|
|
701
723
|
type RapierCollider = RAPIER.Collider;
|
|
702
724
|
/**
|
|
@@ -1330,4 +1352,4 @@ declare class VideoComponent extends Component {
|
|
|
1330
1352
|
stop(): void;
|
|
1331
1353
|
}
|
|
1332
1354
|
|
|
1333
|
-
export { type
|
|
1355
|
+
export { type RadiusHeightMeshParameters as $, AnimationComponent as A, type ImageTargetReference as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, InstanceSlotComponent as F, type InstanceTransform as G, InstancedMeshComponent as H, ImageComponent as I, type InstancedMeshKind as J, type LightValueState as K, LightComponent as L, MaterialComponent as M, type MaterialTypeValue as N, type MaterialValueState as O, MeshComponent as P, MeshGeometryComponent as Q, type MeshGeometryParameters as R, type MeshGeometryParametersByKind as S, ModelComponent as T, Name as U, Object3DRef as V, PhysicsComponent as W, type PhysicsState as X, type PlaneMeshParameters as Y, Postprocessing as Z, type PostprocessingState as _, type AnimationComponentOptions as a, type RadiusMeshParameters as a0, type RigidbodyState as a1, type RigidbodyType as a2, ScriptComponent as a3, type ScriptEntry as a4, Selectable as a5, SelectionTransformState as a6, SpriteComponent as a7, type TextureFilteringValue as a8, type TransformModeValue as a9, type TransformSpaceValue as aa, VideoComponent as ab, normalizePhysicsState as ac, type AnimationStateCallbacks as ad, AnimationStateMachine as ae, AnimationStateManager as af, type StateMachine as ag, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_ENVIRONMENT_STATE as i, DEFAULT_INSTANCED_MESH_PARAMETERS as j, DEFAULT_INSTANCE_TRANSFORM as k, DEFAULT_MESH_GEOMETRY_PARAMETERS as l, DEFAULT_PHYSICS_STATE as m, DEFAULT_POSTPROCESSING_STATE as n, DEFAULT_RIGIDBODY_STATE as o, EntityType as p, Environment as q, type EnvironmentFogState as r, type EnvironmentFogType as s, type EnvironmentGradientEffect as t, type EnvironmentSkyboxState as u, type EnvironmentSkyboxType as v, type EnvironmentState as w, ImageTarget as x, ImageTargetAnchor as y, type ImageTargetAnchorOptions as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { C as Component, e as EcsEntityKind, m as EcsEntityEditorKind, n as EntityId } from './System-
|
|
2
|
+
import { C as Component, e as EcsEntityKind, m as EcsEntityEditorKind, n as EntityId } from './System-AV2_87Zr.js';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
|
|
5
5
|
interface StateMachine {
|
|
@@ -678,8 +678,12 @@ declare class InstancedMeshComponent extends Component {
|
|
|
678
678
|
castShadow: boolean;
|
|
679
679
|
/** Whether all instances receive shadows. */
|
|
680
680
|
receiveShadow: boolean;
|
|
681
|
-
/**
|
|
682
|
-
|
|
681
|
+
/**
|
|
682
|
+
* Ordered list of entity IDs for the instance slot entities owned by this group.
|
|
683
|
+
* Each slot entity carries a `TransformComponent` that `InstancedMeshSystem`
|
|
684
|
+
* reads every frame to build the per-instance matrix.
|
|
685
|
+
*/
|
|
686
|
+
instanceEntityIds: number[];
|
|
683
687
|
/**
|
|
684
688
|
* Live runtime container managed by {@link InstancedMeshSystem}:
|
|
685
689
|
* - For primitive kinds: a `THREE.InstancedMesh`.
|
|
@@ -690,13 +694,31 @@ declare class InstancedMeshComponent extends Component {
|
|
|
690
694
|
constructor(meshKind?: InstancedMeshKind, meshParameters?: Partial<MeshGeometryParameters>, options?: {
|
|
691
695
|
castShadow?: boolean;
|
|
692
696
|
receiveShadow?: boolean;
|
|
693
|
-
|
|
697
|
+
instanceEntityIds?: number[];
|
|
694
698
|
modelPath?: string;
|
|
695
699
|
});
|
|
696
700
|
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
697
701
|
getSanitizedParameters(): MeshGeometryParameters;
|
|
698
702
|
}
|
|
699
703
|
|
|
704
|
+
/**
|
|
705
|
+
* Marks an entity as an instance slot owned by an {@link InstancedMeshComponent} group entity.
|
|
706
|
+
*
|
|
707
|
+
* Instance slot entities are lightweight data containers — they carry
|
|
708
|
+
* `TransformComponent` (the per-instance local transform) and this component,
|
|
709
|
+
* but do **not** have an `Object3DRef`. Their transforms are consumed each
|
|
710
|
+
* frame by `InstancedMeshSystem` to compose the instance matrix.
|
|
711
|
+
*
|
|
712
|
+
* @category Components
|
|
713
|
+
*/
|
|
714
|
+
declare class InstanceSlotComponent extends Component {
|
|
715
|
+
/** Entity ID of the owning `instancedMesh` group entity. */
|
|
716
|
+
groupEntityId: number;
|
|
717
|
+
/** Zero-based index of this slot within the group's `instanceEntityIds` array. */
|
|
718
|
+
slotIndex: number;
|
|
719
|
+
constructor(groupEntityId: number, slotIndex: number);
|
|
720
|
+
}
|
|
721
|
+
|
|
700
722
|
type RapierRigidBody = RAPIER.RigidBody;
|
|
701
723
|
type RapierCollider = RAPIER.Collider;
|
|
702
724
|
/**
|
|
@@ -1330,4 +1352,4 @@ declare class VideoComponent extends Component {
|
|
|
1330
1352
|
stop(): void;
|
|
1331
1353
|
}
|
|
1332
1354
|
|
|
1333
|
-
export { type
|
|
1355
|
+
export { type RadiusHeightMeshParameters as $, AnimationComponent as A, type ImageTargetReference as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, InstanceSlotComponent as F, type InstanceTransform as G, InstancedMeshComponent as H, ImageComponent as I, type InstancedMeshKind as J, type LightValueState as K, LightComponent as L, MaterialComponent as M, type MaterialTypeValue as N, type MaterialValueState as O, MeshComponent as P, MeshGeometryComponent as Q, type MeshGeometryParameters as R, type MeshGeometryParametersByKind as S, ModelComponent as T, Name as U, Object3DRef as V, PhysicsComponent as W, type PhysicsState as X, type PlaneMeshParameters as Y, Postprocessing as Z, type PostprocessingState as _, type AnimationComponentOptions as a, type RadiusMeshParameters as a0, type RigidbodyState as a1, type RigidbodyType as a2, ScriptComponent as a3, type ScriptEntry as a4, Selectable as a5, SelectionTransformState as a6, SpriteComponent as a7, type TextureFilteringValue as a8, type TransformModeValue as a9, type TransformSpaceValue as aa, VideoComponent as ab, normalizePhysicsState as ac, type AnimationStateCallbacks as ad, AnimationStateMachine as ae, AnimationStateManager as af, type StateMachine as ag, AudioComponent as b, type CameraComponentOptions as c, type CameraProjection as d, type CameraRuntimeType as e, type ColliderShape as f, type ColliderState as g, type CubeMeshParameters as h, DEFAULT_ENVIRONMENT_STATE as i, DEFAULT_INSTANCED_MESH_PARAMETERS as j, DEFAULT_INSTANCE_TRANSFORM as k, DEFAULT_MESH_GEOMETRY_PARAMETERS as l, DEFAULT_PHYSICS_STATE as m, DEFAULT_POSTPROCESSING_STATE as n, DEFAULT_RIGIDBODY_STATE as o, EntityType as p, Environment as q, type EnvironmentFogState as r, type EnvironmentFogType as s, type EnvironmentGradientEffect as t, type EnvironmentSkyboxState as u, type EnvironmentSkyboxType as v, type EnvironmentState as w, ImageTarget as x, ImageTargetAnchor as y, type ImageTargetAnchorOptions as z };
|
|
@@ -21,6 +21,7 @@ __export(components_exports, {
|
|
|
21
21
|
ImageComponent: () => ImageComponent,
|
|
22
22
|
ImageTarget: () => ImageTarget,
|
|
23
23
|
ImageTargetAnchor: () => ImageTargetAnchor,
|
|
24
|
+
InstanceSlotComponent: () => InstanceSlotComponent,
|
|
24
25
|
InstancedMeshComponent: () => InstancedMeshComponent,
|
|
25
26
|
LightComponent: () => LightComponent,
|
|
26
27
|
MaterialComponent: () => MaterialComponent,
|
|
@@ -1050,7 +1051,7 @@ var _InstancedMeshComponent = class _InstancedMeshComponent extends Component {
|
|
|
1050
1051
|
};
|
|
1051
1052
|
this.castShadow = options?.castShadow ?? false;
|
|
1052
1053
|
this.receiveShadow = options?.receiveShadow ?? false;
|
|
1053
|
-
this.
|
|
1054
|
+
this.instanceEntityIds = options?.instanceEntityIds ?? [];
|
|
1054
1055
|
this.instancedMesh = null;
|
|
1055
1056
|
}
|
|
1056
1057
|
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
@@ -1094,6 +1095,17 @@ var _InstancedMeshComponent = class _InstancedMeshComponent extends Component {
|
|
|
1094
1095
|
__name(_InstancedMeshComponent, "InstancedMeshComponent");
|
|
1095
1096
|
var InstancedMeshComponent = _InstancedMeshComponent;
|
|
1096
1097
|
|
|
1098
|
+
// core/components/InstanceSlotComponent.ts
|
|
1099
|
+
var _InstanceSlotComponent = class _InstanceSlotComponent extends Component {
|
|
1100
|
+
constructor(groupEntityId, slotIndex) {
|
|
1101
|
+
super();
|
|
1102
|
+
this.groupEntityId = groupEntityId;
|
|
1103
|
+
this.slotIndex = slotIndex;
|
|
1104
|
+
}
|
|
1105
|
+
};
|
|
1106
|
+
__name(_InstanceSlotComponent, "InstanceSlotComponent");
|
|
1107
|
+
var InstanceSlotComponent = _InstanceSlotComponent;
|
|
1108
|
+
|
|
1097
1109
|
// core/components/Physics.ts
|
|
1098
1110
|
var DEFAULT_RIGIDBODY_STATE = {
|
|
1099
1111
|
enabled: true,
|
|
@@ -1789,6 +1801,6 @@ var _VideoComponent = class _VideoComponent extends Component {
|
|
|
1789
1801
|
__name(_VideoComponent, "VideoComponent");
|
|
1790
1802
|
var VideoComponent = _VideoComponent;
|
|
1791
1803
|
|
|
1792
|
-
export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, normalizePhysicsState };
|
|
1793
|
-
//# sourceMappingURL=chunk-
|
|
1794
|
-
//# sourceMappingURL=chunk-
|
|
1804
|
+
export { AnimationComponent, AnimationStateMachine, AnimationStateManager, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, components_exports, normalizePhysicsState };
|
|
1805
|
+
//# sourceMappingURL=chunk-AZR6SLQN.js.map
|
|
1806
|
+
//# sourceMappingURL=chunk-AZR6SLQN.js.map
|