@relu-interactives/spatial-ecs 0.4.0 → 0.4.2
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-QjjSc6LZ.d.cts → System-ln4Q7Eot.d.cts} +1 -1
- package/dist/{System-QjjSc6LZ.d.ts → System-ln4Q7Eot.d.ts} +1 -1
- package/dist/{XRHandPose-Csd3QGkj.d.ts → XRHandPose-BImIa4ZS.d.ts} +37 -2
- package/dist/{XRHandPose-Capx-RTD.d.cts → XRHandPose-CxPv-LBo.d.cts} +37 -2
- package/dist/{chunk-ZWONFM2F.js → chunk-4AK4I3QF.js} +2 -2
- package/dist/{chunk-ZWONFM2F.js.map → chunk-4AK4I3QF.js.map} +1 -1
- package/dist/{chunk-2GTFFLGG.js → chunk-4DWZK4X4.js} +3 -3
- package/dist/{chunk-2GTFFLGG.js.map → chunk-4DWZK4X4.js.map} +1 -1
- package/dist/{chunk-24ZMSBR7.js → chunk-6UZC6M7V.js} +43 -6
- package/dist/chunk-6UZC6M7V.js.map +1 -0
- package/dist/{chunk-OWQPGEBB.js → chunk-SGADE55G.js} +14 -5
- package/dist/chunk-SGADE55G.js.map +1 -0
- 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/guide/mixed-reality.md +120 -0
- package/dist/factories/index.cjs +20 -0
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +5 -3
- package/dist/factories/index.d.ts +5 -3
- package/dist/factories/index.js +3 -3
- package/dist/{index-SC9Mgjht.d.cts → index-CBdnIyI8.d.cts} +1 -1
- package/dist/{index-BRATaqTT.d.ts → index-CQsHUez3.d.cts} +5 -41
- package/dist/{index-C1rprGz_.d.cts → index-CuGqxuk-.d.ts} +5 -41
- package/dist/{index-BAeeVJ6f.d.ts → index-n7SeH119.d.ts} +1 -1
- package/dist/index.cjs +59 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +8 -8
- package/dist/systems/index.cjs +39 -2
- 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.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-24ZMSBR7.js.map +0 -1
- package/dist/chunk-OWQPGEBB.js.map +0 -1
|
@@ -619,7 +619,7 @@ type CreateContext = {
|
|
|
619
619
|
isEditor?: boolean;
|
|
620
620
|
};
|
|
621
621
|
type EntityFactory = (context: CreateContext) => EntityId;
|
|
622
|
-
type EcsComponentFactoryKind = "animation" | "audio" | "camera" | "environment" | "entityType" | "image" | "imageTargetAnchor" | "imageTarget" | "light" | "material" | "mesh" | "meshGeometry" | "model" | "name" | "object3DRef" | "parentId" | "physics" | "postprocessing" | "script" | "scriptObject" | "selectable" | "selectionTransformState" | "sprite" | "transform" | "video" | "instancedMesh" | "xrRig" | "vrTeleportArea" | "xrHandPose" | "xrInteractable" | "xrInteractor" | "xrInteractorSide";
|
|
622
|
+
type EcsComponentFactoryKind = "animation" | "audio" | "camera" | "environment" | "entityType" | "image" | "imageTargetAnchor" | "imageTarget" | "light" | "material" | "mesh" | "meshGeometry" | "model" | "name" | "object3DRef" | "parentId" | "physics" | "postprocessing" | "script" | "scriptObject" | "selectable" | "selectionTransformState" | "sprite" | "transform" | "video" | "instancedMesh" | "xrRig" | "vrTeleportArea" | "xrHandPose" | "xrAnchor" | "xrInteractable" | "xrInteractor" | "xrInteractorSide";
|
|
623
623
|
type ComponentFactory = (world: World, entityId: EntityId, ...args: any[]) => unknown;
|
|
624
624
|
declare class ObjectManagementSystem implements EcsSystem {
|
|
625
625
|
private readonly scene;
|
|
@@ -619,7 +619,7 @@ type CreateContext = {
|
|
|
619
619
|
isEditor?: boolean;
|
|
620
620
|
};
|
|
621
621
|
type EntityFactory = (context: CreateContext) => EntityId;
|
|
622
|
-
type EcsComponentFactoryKind = "animation" | "audio" | "camera" | "environment" | "entityType" | "image" | "imageTargetAnchor" | "imageTarget" | "light" | "material" | "mesh" | "meshGeometry" | "model" | "name" | "object3DRef" | "parentId" | "physics" | "postprocessing" | "script" | "scriptObject" | "selectable" | "selectionTransformState" | "sprite" | "transform" | "video" | "instancedMesh" | "xrRig" | "vrTeleportArea" | "xrHandPose" | "xrInteractable" | "xrInteractor" | "xrInteractorSide";
|
|
622
|
+
type EcsComponentFactoryKind = "animation" | "audio" | "camera" | "environment" | "entityType" | "image" | "imageTargetAnchor" | "imageTarget" | "light" | "material" | "mesh" | "meshGeometry" | "model" | "name" | "object3DRef" | "parentId" | "physics" | "postprocessing" | "script" | "scriptObject" | "selectable" | "selectionTransformState" | "sprite" | "transform" | "video" | "instancedMesh" | "xrRig" | "vrTeleportArea" | "xrHandPose" | "xrAnchor" | "xrInteractable" | "xrInteractor" | "xrInteractorSide";
|
|
623
623
|
type ComponentFactory = (world: World, entityId: EntityId, ...args: any[]) => unknown;
|
|
624
624
|
declare class ObjectManagementSystem implements EcsSystem {
|
|
625
625
|
private readonly scene;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { C as Component, p as EcsEntityKind, F as EcsEntityEditorKind, r as EntityId } from './System-
|
|
2
|
+
import { C as Component, p as EcsEntityKind, F as EcsEntityEditorKind, r as EntityId } from './System-ln4Q7Eot.js';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
import { a as XrFinger, c as XrHandPoseDirection, b as XrHandPoseOrientation, X as XrHandPoseDefinition } from './handPose-DlcTtqgx.js';
|
|
5
5
|
|
|
@@ -1538,6 +1538,41 @@ declare class XRRigComponent extends Component {
|
|
|
1538
1538
|
constructor(options?: XRRigOptions);
|
|
1539
1539
|
}
|
|
1540
1540
|
|
|
1541
|
+
/** Optional initializer for {@link XRAnchorComponent}. */
|
|
1542
|
+
type XRAnchorOptions = {
|
|
1543
|
+
/** Whether the entity should anchor at all. Defaults to `true`. */
|
|
1544
|
+
enabled?: boolean;
|
|
1545
|
+
};
|
|
1546
|
+
/**
|
|
1547
|
+
* Pins an entity to a real-world position.
|
|
1548
|
+
*
|
|
1549
|
+
* A headset's idea of where the room is keeps being refined while a session
|
|
1550
|
+
* runs — it re-recognises the space, corrects drift, and quietly shifts its
|
|
1551
|
+
* coordinate system by a few centimetres. Content placed at fixed scene
|
|
1552
|
+
* coordinates does not move with those corrections, so a vase carefully set on a
|
|
1553
|
+
* real table gradually slides off it.
|
|
1554
|
+
*
|
|
1555
|
+
* An anchor is the runtime's own handle on a point in the room. Attaching this
|
|
1556
|
+
* component hands the entity's pose over to that handle, so the entity moves
|
|
1557
|
+
* exactly as the runtime's understanding of the room moves and stays put
|
|
1558
|
+
* relative to the real world.
|
|
1559
|
+
*
|
|
1560
|
+
* Because the anchor OWNS the transform once created, moving the entity by
|
|
1561
|
+
* script or by physics has no lasting effect — release it first if you want to
|
|
1562
|
+
* move it, then re-anchor.
|
|
1563
|
+
*
|
|
1564
|
+
* Anchors last only as long as the session. Persisting one across launches
|
|
1565
|
+
* needs `requestPersistentHandle`, which is still a draft extension and not
|
|
1566
|
+
* supported here.
|
|
1567
|
+
*
|
|
1568
|
+
* @category Components
|
|
1569
|
+
*/
|
|
1570
|
+
declare class XRAnchorComponent extends Component {
|
|
1571
|
+
/** Whether the entity should anchor. Turning this off releases the anchor. */
|
|
1572
|
+
enabled: boolean;
|
|
1573
|
+
constructor(options?: XRAnchorOptions);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1541
1576
|
/**
|
|
1542
1577
|
* What is rendered at the user's hands.
|
|
1543
1578
|
*
|
|
@@ -1702,4 +1737,4 @@ declare class XRHandPoseComponent extends Component {
|
|
|
1702
1737
|
constructor(options?: XRHandPoseOptions);
|
|
1703
1738
|
}
|
|
1704
1739
|
|
|
1705
|
-
export { Selectable as $, AnimationComponent as A, type MaterialValueState as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, MeshComponent as F, MeshGeometryComponent as G, type MeshGeometryParameters as H, ImageComponent as I, type MeshGeometryParametersByKind as J, ModelComponent as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type PhysicsState as Q, type PlaneMeshParameters as R, type RadiusHeightMeshParameters as S, type RadiusMeshParameters as T, type RigidbodyState as U, type RigidbodyType as V, ScriptComponent as W, type ScriptEntry as X, ScriptObjectComponent as Y, type ScriptObjectComponentInput as Z, type ScriptObjectRuntimeState as _, type AnimationComponentOptions as a, SelectionTransformState as a0, SpriteComponent as a1, type TextureFilteringValue as a2, type TransformModeValue as a3, type TransformSpaceValue as a4, VRTeleportAreaComponent as a5, type VRTeleportAreaOptions as a6, VideoComponent as a7, type VrTeleportShape as a8,
|
|
1740
|
+
export { Selectable as $, AnimationComponent as A, type MaterialValueState as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, MeshComponent as F, MeshGeometryComponent as G, type MeshGeometryParameters as H, ImageComponent as I, type MeshGeometryParametersByKind as J, ModelComponent as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type PhysicsState as Q, type PlaneMeshParameters as R, type RadiusHeightMeshParameters as S, type RadiusMeshParameters as T, type RigidbodyState as U, type RigidbodyType as V, ScriptComponent as W, type ScriptEntry as X, ScriptObjectComponent as Y, type ScriptObjectComponentInput as Z, type ScriptObjectRuntimeState as _, type AnimationComponentOptions as a, SelectionTransformState as a0, SpriteComponent as a1, type TextureFilteringValue as a2, type TransformModeValue as a3, type TransformSpaceValue as a4, VRTeleportAreaComponent as a5, type VRTeleportAreaOptions as a6, VideoComponent as a7, type VrTeleportShape as a8, XRAnchorComponent as a9, handPoseDefinitionFor as aA, normalizePhysicsState as aB, setPhysicsLiveRef as aC, type AnimationStateCallbacks as aD, AnimationStateMachine as aE, AnimationStateManager as aF, type StateMachine as aG, type XRAnchorOptions as aa, XRHandPoseComponent as ab, type XRHandPoseOptions as ac, XRInteractableComponent as ad, type XRInteractableOptions as ae, XRInteractorComponent as af, type XRInteractorOptions as ag, XRInteractorSideComponent as ah, XRRigComponent as ai, type XRRigOptions as aj, type XrAttachPoint as ak, type XrDistanceGrabBehavior as al, type XrEnvironmentPhysics as am, type XrGrabGesture as an, type XrGrabHands as ao, type XrGrabReach as ap, type XrHandPoseEntry as aq, type XrHandPreset as ar, type XrInteractorSide as as, type XrInteractorType as at, type XrLocomotionMode as au, type XrTrackingOrigin as av, type XrTwoHandRotation as aw, createAttachPoint as ax, createHandPoseEntry as ay, defaultMaterialValue as az, 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_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_POSE_CURLS as m, DEFAULT_POSE_DIRECTIONS as n, DEFAULT_RIGIDBODY_STATE as o, EntityType as p, ImageTarget as q, ImageTargetAnchor as r, type ImageTargetAnchorOptions as s, type ImageTargetReference as t, InstanceSlotComponent as u, type InstanceTransform as v, InstancedMeshComponent as w, type InstancedMeshKind as x, type LightValueState as y, type MaterialTypeValue as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { C as Component, p as EcsEntityKind, F as EcsEntityEditorKind, r as EntityId } from './System-
|
|
2
|
+
import { C as Component, p as EcsEntityKind, F as EcsEntityEditorKind, r as EntityId } from './System-ln4Q7Eot.cjs';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
import { a as XrFinger, c as XrHandPoseDirection, b as XrHandPoseOrientation, X as XrHandPoseDefinition } from './handPose-DlcTtqgx.cjs';
|
|
5
5
|
|
|
@@ -1538,6 +1538,41 @@ declare class XRRigComponent extends Component {
|
|
|
1538
1538
|
constructor(options?: XRRigOptions);
|
|
1539
1539
|
}
|
|
1540
1540
|
|
|
1541
|
+
/** Optional initializer for {@link XRAnchorComponent}. */
|
|
1542
|
+
type XRAnchorOptions = {
|
|
1543
|
+
/** Whether the entity should anchor at all. Defaults to `true`. */
|
|
1544
|
+
enabled?: boolean;
|
|
1545
|
+
};
|
|
1546
|
+
/**
|
|
1547
|
+
* Pins an entity to a real-world position.
|
|
1548
|
+
*
|
|
1549
|
+
* A headset's idea of where the room is keeps being refined while a session
|
|
1550
|
+
* runs — it re-recognises the space, corrects drift, and quietly shifts its
|
|
1551
|
+
* coordinate system by a few centimetres. Content placed at fixed scene
|
|
1552
|
+
* coordinates does not move with those corrections, so a vase carefully set on a
|
|
1553
|
+
* real table gradually slides off it.
|
|
1554
|
+
*
|
|
1555
|
+
* An anchor is the runtime's own handle on a point in the room. Attaching this
|
|
1556
|
+
* component hands the entity's pose over to that handle, so the entity moves
|
|
1557
|
+
* exactly as the runtime's understanding of the room moves and stays put
|
|
1558
|
+
* relative to the real world.
|
|
1559
|
+
*
|
|
1560
|
+
* Because the anchor OWNS the transform once created, moving the entity by
|
|
1561
|
+
* script or by physics has no lasting effect — release it first if you want to
|
|
1562
|
+
* move it, then re-anchor.
|
|
1563
|
+
*
|
|
1564
|
+
* Anchors last only as long as the session. Persisting one across launches
|
|
1565
|
+
* needs `requestPersistentHandle`, which is still a draft extension and not
|
|
1566
|
+
* supported here.
|
|
1567
|
+
*
|
|
1568
|
+
* @category Components
|
|
1569
|
+
*/
|
|
1570
|
+
declare class XRAnchorComponent extends Component {
|
|
1571
|
+
/** Whether the entity should anchor. Turning this off releases the anchor. */
|
|
1572
|
+
enabled: boolean;
|
|
1573
|
+
constructor(options?: XRAnchorOptions);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1541
1576
|
/**
|
|
1542
1577
|
* What is rendered at the user's hands.
|
|
1543
1578
|
*
|
|
@@ -1702,4 +1737,4 @@ declare class XRHandPoseComponent extends Component {
|
|
|
1702
1737
|
constructor(options?: XRHandPoseOptions);
|
|
1703
1738
|
}
|
|
1704
1739
|
|
|
1705
|
-
export { Selectable as $, AnimationComponent as A, type MaterialValueState as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, MeshComponent as F, MeshGeometryComponent as G, type MeshGeometryParameters as H, ImageComponent as I, type MeshGeometryParametersByKind as J, ModelComponent as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type PhysicsState as Q, type PlaneMeshParameters as R, type RadiusHeightMeshParameters as S, type RadiusMeshParameters as T, type RigidbodyState as U, type RigidbodyType as V, ScriptComponent as W, type ScriptEntry as X, ScriptObjectComponent as Y, type ScriptObjectComponentInput as Z, type ScriptObjectRuntimeState as _, type AnimationComponentOptions as a, SelectionTransformState as a0, SpriteComponent as a1, type TextureFilteringValue as a2, type TransformModeValue as a3, type TransformSpaceValue as a4, VRTeleportAreaComponent as a5, type VRTeleportAreaOptions as a6, VideoComponent as a7, type VrTeleportShape as a8,
|
|
1740
|
+
export { Selectable as $, AnimationComponent as A, type MaterialValueState as B, CameraComponent as C, DEFAULT_COLLIDER_STATE as D, type EditableMeshObjectKind as E, MeshComponent as F, MeshGeometryComponent as G, type MeshGeometryParameters as H, ImageComponent as I, type MeshGeometryParametersByKind as J, ModelComponent as K, LightComponent as L, MaterialComponent as M, Name as N, Object3DRef as O, PhysicsComponent as P, type PhysicsState as Q, type PlaneMeshParameters as R, type RadiusHeightMeshParameters as S, type RadiusMeshParameters as T, type RigidbodyState as U, type RigidbodyType as V, ScriptComponent as W, type ScriptEntry as X, ScriptObjectComponent as Y, type ScriptObjectComponentInput as Z, type ScriptObjectRuntimeState as _, type AnimationComponentOptions as a, SelectionTransformState as a0, SpriteComponent as a1, type TextureFilteringValue as a2, type TransformModeValue as a3, type TransformSpaceValue as a4, VRTeleportAreaComponent as a5, type VRTeleportAreaOptions as a6, VideoComponent as a7, type VrTeleportShape as a8, XRAnchorComponent as a9, handPoseDefinitionFor as aA, normalizePhysicsState as aB, setPhysicsLiveRef as aC, type AnimationStateCallbacks as aD, AnimationStateMachine as aE, AnimationStateManager as aF, type StateMachine as aG, type XRAnchorOptions as aa, XRHandPoseComponent as ab, type XRHandPoseOptions as ac, XRInteractableComponent as ad, type XRInteractableOptions as ae, XRInteractorComponent as af, type XRInteractorOptions as ag, XRInteractorSideComponent as ah, XRRigComponent as ai, type XRRigOptions as aj, type XrAttachPoint as ak, type XrDistanceGrabBehavior as al, type XrEnvironmentPhysics as am, type XrGrabGesture as an, type XrGrabHands as ao, type XrGrabReach as ap, type XrHandPoseEntry as aq, type XrHandPreset as ar, type XrInteractorSide as as, type XrInteractorType as at, type XrLocomotionMode as au, type XrTrackingOrigin as av, type XrTwoHandRotation as aw, createAttachPoint as ax, createHandPoseEntry as ay, defaultMaterialValue as az, 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_INSTANCED_MESH_PARAMETERS as i, DEFAULT_INSTANCE_TRANSFORM as j, DEFAULT_MESH_GEOMETRY_PARAMETERS as k, DEFAULT_PHYSICS_STATE as l, DEFAULT_POSE_CURLS as m, DEFAULT_POSE_DIRECTIONS as n, DEFAULT_RIGIDBODY_STATE as o, EntityType as p, ImageTarget as q, ImageTargetAnchor as r, type ImageTargetAnchorOptions as s, type ImageTargetReference as t, InstanceSlotComponent as u, type InstanceTransform as v, InstancedMeshComponent as w, type InstancedMeshKind as x, type LightValueState as y, type MaterialTypeValue as z };
|
|
@@ -2293,5 +2293,5 @@ __name(_XRHandPoseComponent, "XRHandPoseComponent");
|
|
|
2293
2293
|
var XRHandPoseComponent = _XRHandPoseComponent;
|
|
2294
2294
|
|
|
2295
2295
|
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_POSE_CURLS, DEFAULT_POSE_DIRECTIONS, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, HAND_POSE_PRESETS, HAND_POSE_PRESET_IDS, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VRTeleportAreaComponent, VideoComponent, XRAnchorComponent, XREnvironmentComponent, XRHandPoseComponent, XRInteractableComponent, XRInteractorComponent, XRInteractorSideComponent, XRRigComponent, cloneHandPose, components_exports, createAttachPoint, createHandPoseEntry, defaultMaterialValue, getHandPosePreset, handPoseDefinitionFor, handPoseFromCurls, normalizePhysicsState, setPhysicsLiveRef };
|
|
2296
|
-
//# sourceMappingURL=chunk-
|
|
2297
|
-
//# sourceMappingURL=chunk-
|
|
2296
|
+
//# sourceMappingURL=chunk-4AK4I3QF.js.map
|
|
2297
|
+
//# sourceMappingURL=chunk-4AK4I3QF.js.map
|