@relu-interactives/spatial-ecs 0.2.15 → 0.2.17
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/docs/guide/accessing-components.md +9 -9
- package/dist/docs/guide/camera-rigs.md +525 -0
- package/dist/docs/guide/components/animation.md +5 -5
- package/dist/docs/guide/components/entity-type.md +2 -2
- package/dist/docs/guide/components/image.md +2 -2
- package/dist/docs/guide/components/instanced-mesh.md +3 -3
- package/dist/docs/guide/components/mesh-geometry.md +3 -3
- package/dist/docs/guide/components/mesh.md +3 -3
- package/dist/docs/guide/components/model.md +2 -2
- package/dist/docs/guide/components/name.md +4 -4
- package/dist/docs/guide/components/object3d-ref.md +2 -2
- package/dist/docs/guide/components/parent-id.md +2 -2
- package/dist/docs/guide/components/video.md +2 -2
- package/dist/docs/guide/world-api.md +3 -2
- 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
|
@@ -39,11 +39,11 @@ Expose a boolean that shows or hides the entity's scene object at runtime.
|
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
import { Behaviour, Object3DRef } from "@relu-interactives/spatial-ecs";
|
|
42
|
-
import type {
|
|
42
|
+
import type { ToggleInput } from "@relu-interactives/spatial-ecs";
|
|
43
43
|
|
|
44
44
|
export default class VisibilityDriver extends Behaviour {
|
|
45
45
|
data = {
|
|
46
|
-
visible: true as
|
|
46
|
+
visible: true as ToggleInput,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
protected onUpdate() {
|
|
@@ -54,11 +54,11 @@ Assign a new parent entity ID to move the entity (and its children) under a diff
|
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
56
|
import { Behaviour, ParentId, Name, KeyboardKeys } from "@relu-interactives/spatial-ecs";
|
|
57
|
-
import type {
|
|
57
|
+
import type { TextInput } from "@relu-interactives/spatial-ecs";
|
|
58
58
|
|
|
59
59
|
export default class Reparenter extends Behaviour {
|
|
60
60
|
data = {
|
|
61
|
-
newParentName: "Holder" as
|
|
61
|
+
newParentName: "Holder" as TextInput,
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
protected onUpdate() {
|
|
@@ -73,12 +73,12 @@ Expose volume and loop settings as inspector fields so they can be tuned without
|
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
import { Behaviour, VideoComponent } from "@relu-interactives/spatial-ecs";
|
|
76
|
-
import type { FloatInput,
|
|
76
|
+
import type { FloatInput, ToggleInput } from "@relu-interactives/spatial-ecs";
|
|
77
77
|
|
|
78
78
|
export default class VideoSettings extends Behaviour {
|
|
79
79
|
data = {
|
|
80
80
|
volume: 1 as FloatInput,
|
|
81
|
-
loop: true as
|
|
81
|
+
loop: true as ToggleInput,
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
protected onUpdate() {
|
|
@@ -283,7 +283,8 @@ intersected mesh sorted by distance. Each hit carries the owning `entityId`
|
|
|
283
283
|
so you can drive game logic from the result.
|
|
284
284
|
|
|
285
285
|
```ts
|
|
286
|
-
import { Behaviour
|
|
286
|
+
import { Behaviour } from "@relu-interactives/spatial-ecs";
|
|
287
|
+
import { Name } from "@relu-interactives/spatial-ecs/components";
|
|
287
288
|
import * as THREE from "three";
|
|
288
289
|
|
|
289
290
|
export default class ClickToInspect extends Behaviour {
|
|
@@ -299,7 +300,7 @@ export default class ClickToInspect extends Behaviour {
|
|
|
299
300
|
const first = hits.find((hit) => hit.entityId !== null);
|
|
300
301
|
if (!first || first.entityId === null) return;
|
|
301
302
|
|
|
302
|
-
const name = this.world.getComponent(first.entityId,
|
|
303
|
+
const name = this.world.getComponent(first.entityId, Name);
|
|
303
304
|
console.log(
|
|
304
305
|
"clicked",
|
|
305
306
|
name?.value ?? first.entityId,
|