@relu-interactives/spatial-ecs 0.2.2 → 0.2.3
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/README.md +30 -99
- package/dist/{System-rXAmagXA.d.cts → System-BTyYvKVH.d.cts} +2 -0
- package/dist/{System-rXAmagXA.d.ts → System-BTyYvKVH.d.ts} +2 -0
- package/dist/{Video-ChKV1UI7.d.ts → Video-BWhbvVPg.d.ts} +1 -1
- package/dist/{Video-CDemv74U.d.cts → Video-D2H5H-K3.d.cts} +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/factories/index.d.cts +2 -2
- package/dist/factories/index.d.ts +2 -2
- package/dist/{index-BZUOKeTO.d.ts → index-Dm6zF1MY.d.ts} +2 -2
- package/dist/{index-B4-YyUNR.d.cts → index-KdEzEZox.d.cts} +2 -2
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.ts +2 -2
- 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/README.md
CHANGED
|
@@ -1,125 +1,56 @@
|
|
|
1
1
|
# @relu-interactives/spatial-ecs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared ECS (Entity-Component-System) engine powering the Relu Spatial editor and preview runtimes.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What it is
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Registry: GitHub Packages (`https://npm.pkg.github.com`)
|
|
9
|
-
- Publish workflow: `.github/workflows/publish-package.yml`
|
|
10
|
-
- Publish trigger: push tags matching `v*` (or manual workflow dispatch)
|
|
11
|
-
- Publish access: public (`npm publish --access public`)
|
|
7
|
+
`@relu-interactives/spatial-ecs` is the source of truth for entity/component/system behavior used across Relu Spatial experiences. It provides a deterministic, serializable scene graph that can be saved, hydrated, and executed identically in both the editor authoring environment and deployed AR/VR previews.
|
|
12
8
|
|
|
13
|
-
##
|
|
9
|
+
## What it contains
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
| Area | Path | Description |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **Components** | `core/components/**` | Runtime state containers (Transform, Model, Animation, Physics, Light, …) |
|
|
14
|
+
| **Component factories** | `core/factories/components/**` | APIs for creating and updating component instances |
|
|
15
|
+
| **Object factories** | `core/factories/objects/**` | Entity assembly — wires baseline components onto scene objects |
|
|
16
|
+
| **Systems** | `core/systems/**` | Frame-by-frame runtime behavior and scene synchronization |
|
|
17
|
+
| **World** | `core/World.ts` | ECS storage, lifecycle, system scheduling, snapshot and history management |
|
|
18
|
+
| **Hydration** | `core/hydration/**` | World reconstruction from saved snapshot data |
|
|
19
|
+
| **Snapshot utils** | `core/worldSnapshotUtils.ts` | Snapshot normalization, cloning, and debug helpers |
|
|
20
|
+
| **Scripting** | `core/Behaviour.ts`, `core/ScriptTemplate.ts` | Base classes for user-authored ECS scripts |
|
|
19
21
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
Install dependencies:
|
|
22
|
+
## Installation
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Build package:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm run build
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Type check:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm run typecheck
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Creating a Release Version
|
|
41
|
-
|
|
42
|
-
Use one of the version scripts:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npm run release:patch
|
|
46
|
-
# or
|
|
47
|
-
npm run release:minor
|
|
25
|
+
npm install @relu-interactives/spatial-ecs
|
|
48
26
|
# or
|
|
49
|
-
|
|
27
|
+
pnpm add @relu-interactives/spatial-ecs
|
|
50
28
|
```
|
|
51
29
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## Publishing via GitHub Actions (Recommended)
|
|
55
|
-
|
|
56
|
-
1. Commit your changes (including the version bump).
|
|
57
|
-
2. Push commit and tag.
|
|
30
|
+
`three` is a peer dependency and must be installed separately:
|
|
58
31
|
|
|
59
32
|
```bash
|
|
60
|
-
|
|
61
|
-
git commit -m "release: bump package version"
|
|
62
|
-
git push && git push --tags
|
|
63
|
-
git push --follow-tags
|
|
33
|
+
npm install three
|
|
64
34
|
```
|
|
65
35
|
|
|
66
|
-
|
|
67
|
-
4. Verify publish in:
|
|
68
|
-
- Repository `Actions` tab
|
|
69
|
-
- Repository `Packages` section
|
|
70
|
-
|
|
71
|
-
## Make Package Public (GitHub UI)
|
|
72
|
-
|
|
73
|
-
For already-published package versions, you may need a one-time visibility change in GitHub:
|
|
74
|
-
|
|
75
|
-
1. Open repository `Packages`.
|
|
76
|
-
2. Open package `@relu-interactives/spatial-ecs`.
|
|
77
|
-
3. Go to `Package settings`.
|
|
78
|
-
4. Under `Danger Zone`, change visibility to `Public`.
|
|
79
|
-
|
|
80
|
-
After this, new releases published by the workflow remain public.
|
|
81
|
-
|
|
82
|
-
## Manual Publish (Optional)
|
|
83
|
-
|
|
84
|
-
If needed, publish from your machine.
|
|
85
|
-
|
|
86
|
-
Create/update your user `.npmrc` with GitHub Packages auth:
|
|
87
|
-
|
|
88
|
-
```ini
|
|
89
|
-
@relu-interactives:registry=https://npm.pkg.github.com
|
|
90
|
-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
91
|
-
always-auth=true
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Then run:
|
|
36
|
+
## Local Development
|
|
95
37
|
|
|
96
38
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
39
|
+
pnpm install
|
|
40
|
+
pnpm run build
|
|
41
|
+
pnpm run typecheck
|
|
100
42
|
```
|
|
101
43
|
|
|
102
|
-
##
|
|
44
|
+
## Key Concepts
|
|
103
45
|
|
|
104
|
-
|
|
46
|
+
### Entities and Components
|
|
105
47
|
|
|
106
|
-
|
|
107
|
-
@relu-interactives:registry=https://npm.pkg.github.com
|
|
108
|
-
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}
|
|
109
|
-
always-auth=true
|
|
110
|
-
```
|
|
48
|
+
Entities are integer IDs. Components are plain data containers attached to entities and stored in the World. Systems query for entities that have specific component combinations and apply runtime behavior each frame.
|
|
111
49
|
|
|
112
|
-
|
|
50
|
+
### Snapshot and Hydration
|
|
113
51
|
|
|
114
|
-
|
|
115
|
-
npm install @relu-interactives/spatial-ecs
|
|
116
|
-
```
|
|
52
|
+
The world can be serialized to a plain JSON snapshot and fully reconstructed via `hydrateWorldFromSnapshotDetailed`. Snapshots are designed to be forward-compatible — hydration is tolerant of missing or legacy fields.
|
|
117
53
|
|
|
118
|
-
|
|
54
|
+
### Editor / Preview Parity
|
|
119
55
|
|
|
120
|
-
|
|
121
|
-
- Check token permissions (`read:packages` for install, `write:packages` for publish).
|
|
122
|
-
- `You cannot publish over the previously published versions`:
|
|
123
|
-
- Bump version before publishing.
|
|
124
|
-
- Workflow succeeds build but fails publish:
|
|
125
|
-
- Confirm package name scope matches workflow scope (`@relu-interactives`).
|
|
56
|
+
The same component contracts, factory logic, and hydration path are used by both the editor and the preview runtime. Changes to any of these must preserve behavior across both consumers.
|
|
@@ -464,6 +464,7 @@ declare class World {
|
|
|
464
464
|
private readonly featureFlags;
|
|
465
465
|
private components;
|
|
466
466
|
private inputSystem;
|
|
467
|
+
private objectManagementSystem;
|
|
467
468
|
private rapierModule;
|
|
468
469
|
private rapierModulePromise;
|
|
469
470
|
private physicsWorld;
|
|
@@ -590,6 +591,7 @@ declare class World {
|
|
|
590
591
|
getEntitiesByName(name: string): WorldEntityView[];
|
|
591
592
|
getEntityByName(name: string): WorldEntityView | null;
|
|
592
593
|
getEntityById(entityId: number): WorldEntityView | null;
|
|
594
|
+
getObjectManagementSystem(): ObjectManagementSystem;
|
|
593
595
|
/**
|
|
594
596
|
* Cast a ray from `origin` along `direction` and return every intersected
|
|
595
597
|
* entity-bound mesh, sorted by distance. Each result is a standard
|
|
@@ -464,6 +464,7 @@ declare class World {
|
|
|
464
464
|
private readonly featureFlags;
|
|
465
465
|
private components;
|
|
466
466
|
private inputSystem;
|
|
467
|
+
private objectManagementSystem;
|
|
467
468
|
private rapierModule;
|
|
468
469
|
private rapierModulePromise;
|
|
469
470
|
private physicsWorld;
|
|
@@ -590,6 +591,7 @@ declare class World {
|
|
|
590
591
|
getEntitiesByName(name: string): WorldEntityView[];
|
|
591
592
|
getEntityByName(name: string): WorldEntityView | null;
|
|
592
593
|
getEntityById(entityId: number): WorldEntityView | null;
|
|
594
|
+
getObjectManagementSystem(): ObjectManagementSystem;
|
|
593
595
|
/**
|
|
594
596
|
* Cast a ray from `origin` along `direction` and return every intersected
|
|
595
597
|
* entity-bound mesh, sorted by distance. Each result is a standard
|
|
@@ -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-BTyYvKVH.js';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
|
|
5
5
|
interface StateMachine {
|
|
@@ -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-BTyYvKVH.cjs';
|
|
3
3
|
import * as RAPIER from '@dimforge/rapier3d-compat';
|
|
4
4
|
|
|
5
5
|
interface StateMachine {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from '../Video-
|
|
2
|
-
export { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from '../System-
|
|
1
|
+
export { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from '../Video-D2H5H-K3.cjs';
|
|
2
|
+
export { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from '../System-BTyYvKVH.cjs';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from '../Video-
|
|
2
|
-
export { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from '../System-
|
|
1
|
+
export { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from '../Video-BWhbvVPg.js';
|
|
2
|
+
export { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from '../System-BTyYvKVH.js';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, X as RigidbodyState, g as ColliderState, Q as PhysicsComponent, u as EnvironmentState, o as Environment, n as EntityType, I as ImageComponent, w as ImageTargetAnchor, v as ImageTarget, L as LightComponent, M as MaterialComponent, G as MeshComponent, H as MeshGeometryComponent, N as ModelComponent, O as Name, P as Object3DRef, U as PostprocessingState, T as Postprocessing, _ as ScriptEntry, Z as ScriptComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a5 as VideoComponent } from '../Video-
|
|
2
|
-
import { b as World, P as ParentId, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, X as RigidbodyState, g as ColliderState, Q as PhysicsComponent, u as EnvironmentState, o as Environment, n as EntityType, I as ImageComponent, w as ImageTargetAnchor, v as ImageTarget, L as LightComponent, M as MaterialComponent, G as MeshComponent, H as MeshGeometryComponent, N as ModelComponent, O as Name, P as Object3DRef, U as PostprocessingState, T as Postprocessing, _ as ScriptEntry, Z as ScriptComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a5 as VideoComponent } from '../Video-D2H5H-K3.cjs';
|
|
2
|
+
import { b as World, P as ParentId, T as TransformComponent, O as ObjectManagementSystem } from '../System-BTyYvKVH.cjs';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, X as RigidbodyState, g as ColliderState, Q as PhysicsComponent, u as EnvironmentState, o as Environment, n as EntityType, I as ImageComponent, w as ImageTargetAnchor, v as ImageTarget, L as LightComponent, M as MaterialComponent, G as MeshComponent, H as MeshGeometryComponent, N as ModelComponent, O as Name, P as Object3DRef, U as PostprocessingState, T as Postprocessing, _ as ScriptEntry, Z as ScriptComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a5 as VideoComponent } from '../Video-
|
|
2
|
-
import { b as World, P as ParentId, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, X as RigidbodyState, g as ColliderState, Q as PhysicsComponent, u as EnvironmentState, o as Environment, n as EntityType, I as ImageComponent, w as ImageTargetAnchor, v as ImageTarget, L as LightComponent, M as MaterialComponent, G as MeshComponent, H as MeshGeometryComponent, N as ModelComponent, O as Name, P as Object3DRef, U as PostprocessingState, T as Postprocessing, _ as ScriptEntry, Z as ScriptComponent, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a5 as VideoComponent } from '../Video-BWhbvVPg.js';
|
|
2
|
+
import { b as World, P as ParentId, T as TransformComponent, O as ObjectManagementSystem } from '../System-BTyYvKVH.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from './Video-
|
|
2
|
-
import { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from './Video-BWhbvVPg.js';
|
|
2
|
+
import { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from './System-BTyYvKVH.js';
|
|
3
3
|
|
|
4
4
|
declare const index_AnimationComponent: typeof AnimationComponent;
|
|
5
5
|
declare const index_AnimationComponentOptions: typeof AnimationComponentOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from './Video-
|
|
2
|
-
import { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_ENVIRONMENT_STATE, j as DEFAULT_MESH_GEOMETRY_PARAMETERS, k as DEFAULT_PHYSICS_STATE, l as DEFAULT_POSTPROCESSING_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, n as EntityType, o as Environment, p as EnvironmentFogState, q as EnvironmentFogType, r as EnvironmentGradientEffect, s as EnvironmentSkyboxState, t as EnvironmentSkyboxType, u as EnvironmentState, I as ImageComponent, v as ImageTarget, w as ImageTargetAnchor, x as ImageTargetAnchorOptions, y as ImageTargetReference, L as LightComponent, z as LightValueState, M as MaterialComponent, B as MaterialTypeValue, F as MaterialValueState, G as MeshComponent, H as MeshGeometryComponent, J as MeshGeometryParameters, K as MeshGeometryParametersByKind, N as ModelComponent, O as Name, P as Object3DRef, Q as PhysicsComponent, R as PhysicsState, S as PlaneMeshParameters, T as Postprocessing, U as PostprocessingState, V as RadiusHeightMeshParameters, W as RadiusMeshParameters, X as RigidbodyState, Y as RigidbodyType, Z as ScriptComponent, _ as ScriptEntry, $ as Selectable, a0 as SelectionTransformState, a1 as SpriteComponent, a2 as TextureFilteringValue, a3 as TransformModeValue, a4 as TransformSpaceValue, a5 as VideoComponent, a6 as normalizePhysicsState } from './Video-D2H5H-K3.cjs';
|
|
2
|
+
import { P as ParentId, T as TransformComponent, a as TransformData, V as Vec3 } from './System-BTyYvKVH.cjs';
|
|
3
3
|
|
|
4
4
|
declare const index_AnimationComponent: typeof AnimationComponent;
|
|
5
5
|
declare const index_AnimationComponentOptions: typeof AnimationComponentOptions;
|
package/dist/index.cjs
CHANGED
|
@@ -6825,6 +6825,7 @@ var _World = class _World {
|
|
|
6825
6825
|
this.storeListeners = /* @__PURE__ */ new Set();
|
|
6826
6826
|
this.components = /* @__PURE__ */ new Map();
|
|
6827
6827
|
this.inputSystem = null;
|
|
6828
|
+
this.objectManagementSystem = null;
|
|
6828
6829
|
this.rapierModule = null;
|
|
6829
6830
|
this.rapierModulePromise = null;
|
|
6830
6831
|
this.physicsWorld = null;
|
|
@@ -7202,6 +7203,7 @@ var _World = class _World {
|
|
|
7202
7203
|
);
|
|
7203
7204
|
}
|
|
7204
7205
|
this.isEditor = isEditor ?? false;
|
|
7206
|
+
this.objectManagementSystem = objectManagementSystem;
|
|
7205
7207
|
return {
|
|
7206
7208
|
objectManagementSystem,
|
|
7207
7209
|
transformSyncSystem,
|
|
@@ -7352,6 +7354,14 @@ var _World = class _World {
|
|
|
7352
7354
|
}
|
|
7353
7355
|
return this.toEntityView(entityId);
|
|
7354
7356
|
}
|
|
7357
|
+
getObjectManagementSystem() {
|
|
7358
|
+
if (this.objectManagementSystem) return this.objectManagementSystem;
|
|
7359
|
+
const objectManagementSystem = this.systems.find(
|
|
7360
|
+
(system) => system.constructor.name === "ObjectManagementSystem"
|
|
7361
|
+
);
|
|
7362
|
+
this.objectManagementSystem = objectManagementSystem;
|
|
7363
|
+
return this.objectManagementSystem;
|
|
7364
|
+
}
|
|
7355
7365
|
/**
|
|
7356
7366
|
* Cast a ray from `origin` along `direction` and return every intersected
|
|
7357
7367
|
* entity-bound mesh, sorted by distance. Each result is a standard
|