@relu-interactives/spatial-ecs 0.2.5 → 0.2.6
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-DCMCLInA.d.ts → Video-B-qMljTn.d.ts} +15 -7
- package/dist/{Video-ChVFs9Tl.d.cts → Video-Dj4KBqQ1.d.cts} +15 -7
- package/dist/{chunk-4A66FSFT.js → chunk-EIC5B3A7.js} +4 -4
- package/dist/{chunk-4A66FSFT.js.map → chunk-EIC5B3A7.js.map} +1 -1
- package/dist/{chunk-CRP3W2GK.js → chunk-FDWNCXU3.js} +3 -3
- package/dist/{chunk-CRP3W2GK.js.map → chunk-FDWNCXU3.js.map} +1 -1
- package/dist/{chunk-NB6I5JJN.js → chunk-G2DUXNTQ.js} +3 -2
- package/dist/chunk-G2DUXNTQ.js.map +1 -0
- package/dist/{chunk-RXCUHGRB.js → chunk-NRSUYDBA.js} +183 -32
- package/dist/chunk-NRSUYDBA.js.map +1 -0
- package/dist/{chunk-KRZLEPRI.js → chunk-R5D5PWXV.js} +6 -2
- package/dist/chunk-R5D5PWXV.js.map +1 -0
- package/dist/components/index.cjs +4 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/factories/index.cjs +4 -0
- 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-D1I5L7bA.d.cts → index-B12sx9yF.d.cts} +1 -1
- package/dist/{index-DGZDgt3p.d.ts → index-Cf-PaKyN.d.ts} +1 -1
- package/dist/index.cjs +187 -28
- 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 +12 -9
- package/dist/index.js.map +1 -1
- package/dist/systems/index.cjs +183 -28
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +16 -4
- package/dist/systems/index.d.ts +16 -4
- package/dist/systems/index.js +3 -3
- package/dist/worldSnapshotUtils.cjs +1 -0
- package/dist/worldSnapshotUtils.cjs.map +1 -1
- package/dist/worldSnapshotUtils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KRZLEPRI.js.map +0 -1
- package/dist/chunk-NB6I5JJN.js.map +0 -1
- package/dist/chunk-RXCUHGRB.js.map +0 -1
|
@@ -647,11 +647,11 @@ type InstanceTransform = {
|
|
|
647
647
|
z: number;
|
|
648
648
|
};
|
|
649
649
|
};
|
|
650
|
-
/** Primitive geometry kinds supported by instanced mesh rendering. */
|
|
651
|
-
type InstancedMeshKind = "capsule" | "cube" | "cylinder" | "plane" | "sphere";
|
|
650
|
+
/** Primitive geometry kinds and custom 3D model kind supported by instanced mesh rendering. */
|
|
651
|
+
type InstancedMeshKind = "capsule" | "cube" | "cylinder" | "model" | "plane" | "sphere";
|
|
652
652
|
/** Default identity instance transform. */
|
|
653
653
|
declare const DEFAULT_INSTANCE_TRANSFORM: InstanceTransform;
|
|
654
|
-
/** Default geometry parameters per instanced mesh kind. */
|
|
654
|
+
/** Default geometry parameters per instanced mesh kind. For "model" kind, cube params are stored as a placeholder (unused). */
|
|
655
655
|
declare const DEFAULT_INSTANCED_MESH_PARAMETERS: Record<InstancedMeshKind, MeshGeometryParameters>;
|
|
656
656
|
/**
|
|
657
657
|
* Holds authored instanced-mesh data for an entity that renders as a
|
|
@@ -665,9 +665,14 @@ declare const DEFAULT_INSTANCED_MESH_PARAMETERS: Record<InstancedMeshKind, MeshG
|
|
|
665
665
|
* @category Components
|
|
666
666
|
*/
|
|
667
667
|
declare class InstancedMeshComponent extends Component {
|
|
668
|
-
/**
|
|
668
|
+
/** Geometry kind for all instances. Use `"model"` for a custom GLTF/GLB asset. */
|
|
669
669
|
meshKind: InstancedMeshKind;
|
|
670
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* Path to the GLTF/GLB asset when `meshKind === "model"`.
|
|
672
|
+
* Serialized in snapshots and restored on hydration.
|
|
673
|
+
*/
|
|
674
|
+
modelPath: string;
|
|
675
|
+
/** Editable geometry parameters (width/height/depth, radius, etc.). Ignored when `meshKind === "model"`. */
|
|
671
676
|
meshParameters: MeshGeometryParameters;
|
|
672
677
|
/** Whether all instances cast shadows. */
|
|
673
678
|
castShadow: boolean;
|
|
@@ -676,14 +681,17 @@ declare class InstancedMeshComponent extends Component {
|
|
|
676
681
|
/** Per-instance transforms stored in local space relative to the anchor object. */
|
|
677
682
|
instances: InstanceTransform[];
|
|
678
683
|
/**
|
|
679
|
-
* Live
|
|
684
|
+
* Live runtime container managed by {@link InstancedMeshSystem}:
|
|
685
|
+
* - For primitive kinds: a `THREE.InstancedMesh`.
|
|
686
|
+
* - For `"model"` kind: a `THREE.Group` containing per-mesh `THREE.InstancedMesh` objects.
|
|
680
687
|
* Excluded from snapshot serialization — do **not** read this in hydration code.
|
|
681
688
|
*/
|
|
682
|
-
instancedMesh: THREE.
|
|
689
|
+
instancedMesh: THREE.Object3D | null;
|
|
683
690
|
constructor(meshKind?: InstancedMeshKind, meshParameters?: Partial<MeshGeometryParameters>, options?: {
|
|
684
691
|
castShadow?: boolean;
|
|
685
692
|
receiveShadow?: boolean;
|
|
686
693
|
instances?: InstanceTransform[];
|
|
694
|
+
modelPath?: string;
|
|
687
695
|
});
|
|
688
696
|
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
689
697
|
getSanitizedParameters(): MeshGeometryParameters;
|
|
@@ -647,11 +647,11 @@ type InstanceTransform = {
|
|
|
647
647
|
z: number;
|
|
648
648
|
};
|
|
649
649
|
};
|
|
650
|
-
/** Primitive geometry kinds supported by instanced mesh rendering. */
|
|
651
|
-
type InstancedMeshKind = "capsule" | "cube" | "cylinder" | "plane" | "sphere";
|
|
650
|
+
/** Primitive geometry kinds and custom 3D model kind supported by instanced mesh rendering. */
|
|
651
|
+
type InstancedMeshKind = "capsule" | "cube" | "cylinder" | "model" | "plane" | "sphere";
|
|
652
652
|
/** Default identity instance transform. */
|
|
653
653
|
declare const DEFAULT_INSTANCE_TRANSFORM: InstanceTransform;
|
|
654
|
-
/** Default geometry parameters per instanced mesh kind. */
|
|
654
|
+
/** Default geometry parameters per instanced mesh kind. For "model" kind, cube params are stored as a placeholder (unused). */
|
|
655
655
|
declare const DEFAULT_INSTANCED_MESH_PARAMETERS: Record<InstancedMeshKind, MeshGeometryParameters>;
|
|
656
656
|
/**
|
|
657
657
|
* Holds authored instanced-mesh data for an entity that renders as a
|
|
@@ -665,9 +665,14 @@ declare const DEFAULT_INSTANCED_MESH_PARAMETERS: Record<InstancedMeshKind, MeshG
|
|
|
665
665
|
* @category Components
|
|
666
666
|
*/
|
|
667
667
|
declare class InstancedMeshComponent extends Component {
|
|
668
|
-
/**
|
|
668
|
+
/** Geometry kind for all instances. Use `"model"` for a custom GLTF/GLB asset. */
|
|
669
669
|
meshKind: InstancedMeshKind;
|
|
670
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* Path to the GLTF/GLB asset when `meshKind === "model"`.
|
|
672
|
+
* Serialized in snapshots and restored on hydration.
|
|
673
|
+
*/
|
|
674
|
+
modelPath: string;
|
|
675
|
+
/** Editable geometry parameters (width/height/depth, radius, etc.). Ignored when `meshKind === "model"`. */
|
|
671
676
|
meshParameters: MeshGeometryParameters;
|
|
672
677
|
/** Whether all instances cast shadows. */
|
|
673
678
|
castShadow: boolean;
|
|
@@ -676,14 +681,17 @@ declare class InstancedMeshComponent extends Component {
|
|
|
676
681
|
/** Per-instance transforms stored in local space relative to the anchor object. */
|
|
677
682
|
instances: InstanceTransform[];
|
|
678
683
|
/**
|
|
679
|
-
* Live
|
|
684
|
+
* Live runtime container managed by {@link InstancedMeshSystem}:
|
|
685
|
+
* - For primitive kinds: a `THREE.InstancedMesh`.
|
|
686
|
+
* - For `"model"` kind: a `THREE.Group` containing per-mesh `THREE.InstancedMesh` objects.
|
|
680
687
|
* Excluded from snapshot serialization — do **not** read this in hydration code.
|
|
681
688
|
*/
|
|
682
|
-
instancedMesh: THREE.
|
|
689
|
+
instancedMesh: THREE.Object3D | null;
|
|
683
690
|
constructor(meshKind?: InstancedMeshKind, meshParameters?: Partial<MeshGeometryParameters>, options?: {
|
|
684
691
|
castShadow?: boolean;
|
|
685
692
|
receiveShadow?: boolean;
|
|
686
693
|
instances?: InstanceTransform[];
|
|
694
|
+
modelPath?: string;
|
|
687
695
|
});
|
|
688
696
|
/** Sanitize and return a copy of the current mesh parameters with valid values. */
|
|
689
697
|
getSanitizedParameters(): MeshGeometryParameters;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveDracoDecoderPath, createTransform, applyTransform } from './chunk-
|
|
2
|
-
import { AnimationComponent, AudioComponent, Object3DRef, CameraComponent, PhysicsComponent, Environment, EntityType, ImageComponent, ImageTargetAnchor, ImageTarget, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, ParentId, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, InstancedMeshComponent, VideoComponent } from './chunk-
|
|
1
|
+
import { resolveDracoDecoderPath, createTransform, applyTransform } from './chunk-FDWNCXU3.js';
|
|
2
|
+
import { AnimationComponent, AudioComponent, Object3DRef, CameraComponent, PhysicsComponent, Environment, EntityType, ImageComponent, ImageTargetAnchor, ImageTarget, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, ParentId, Postprocessing, ScriptComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, InstancedMeshComponent, VideoComponent } from './chunk-R5D5PWXV.js';
|
|
3
3
|
import { __name } from './chunk-OY7ZODZP.js';
|
|
4
4
|
import * as THREE21 from 'three';
|
|
5
5
|
import { RectAreaLightHelper } from 'three/examples/jsm/helpers/RectAreaLightHelper.js';
|
|
@@ -1357,5 +1357,5 @@ function registerDefaultFactories(objectManagementSystem) {
|
|
|
1357
1357
|
__name(registerDefaultFactories, "registerDefaultFactories");
|
|
1358
1358
|
|
|
1359
1359
|
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVideoComponent, registerDefaultComponentFactories, registerDefaultFactories };
|
|
1360
|
-
//# sourceMappingURL=chunk-
|
|
1361
|
-
//# sourceMappingURL=chunk-
|
|
1360
|
+
//# sourceMappingURL=chunk-EIC5B3A7.js.map
|
|
1361
|
+
//# sourceMappingURL=chunk-EIC5B3A7.js.map
|