@relu-interactives/spatial-ecs 0.2.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/README.md +125 -0
- package/dist/System-rXAmagXA.d.cts +659 -0
- package/dist/System-rXAmagXA.d.ts +659 -0
- package/dist/Video-CDemv74U.d.cts +1261 -0
- package/dist/Video-ChKV1UI7.d.ts +1261 -0
- package/dist/assets/draco/draco_decoder.js +34 -0
- package/dist/assets/draco/draco_decoder.wasm +0 -0
- package/dist/assets/draco/draco_wasm_wrapper.js +117 -0
- package/dist/chunk-AYEF3X2P.js +223 -0
- package/dist/chunk-AYEF3X2P.js.map +1 -0
- package/dist/chunk-MAWBTMCG.js +1722 -0
- package/dist/chunk-MAWBTMCG.js.map +1 -0
- package/dist/chunk-NFDTIYR4.js +248 -0
- package/dist/chunk-NFDTIYR4.js.map +1 -0
- package/dist/chunk-OY7ZODZP.js +16 -0
- package/dist/chunk-OY7ZODZP.js.map +1 -0
- package/dist/chunk-P2YDX5DB.js +3304 -0
- package/dist/chunk-P2YDX5DB.js.map +1 -0
- package/dist/chunk-QHILSPT4.js +3 -0
- package/dist/chunk-QHILSPT4.js.map +1 -0
- package/dist/chunk-XWIEEJ7Z.js +1315 -0
- package/dist/chunk-XWIEEJ7Z.js.map +1 -0
- package/dist/components/index.cjs +1745 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +4 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -0
- package/dist/docs/api/Behaviour/classes/Behaviour.md +554 -0
- package/dist/docs/api/Behaviour/index.md +15 -0
- package/dist/docs/api/Component/classes/Component.md +57 -0
- package/dist/docs/api/Component/index.md +15 -0
- package/dist/docs/api/components/classes/AnimationComponent.md +318 -0
- package/dist/docs/api/components/classes/AudioComponent.md +114 -0
- package/dist/docs/api/components/classes/CameraComponent.md +59 -0
- package/dist/docs/api/components/classes/EntityType.md +48 -0
- package/dist/docs/api/components/classes/Environment.md +47 -0
- package/dist/docs/api/components/classes/ImageComponent.md +57 -0
- package/dist/docs/api/components/classes/ImageTarget.md +60 -0
- package/dist/docs/api/components/classes/ImageTargetAnchor.md +48 -0
- package/dist/docs/api/components/classes/LightComponent.md +70 -0
- package/dist/docs/api/components/classes/MaterialComponent.md +181 -0
- package/dist/docs/api/components/classes/MeshComponent.md +48 -0
- package/dist/docs/api/components/classes/MeshGeometryComponent.md +64 -0
- package/dist/docs/api/components/classes/ModelComponent.md +49 -0
- package/dist/docs/api/components/classes/Name.md +46 -0
- package/dist/docs/api/components/classes/Object3DRef.md +54 -0
- package/dist/docs/api/components/classes/ParentId.md +47 -0
- package/dist/docs/api/components/classes/PhysicsComponent.md +82 -0
- package/dist/docs/api/components/classes/Postprocessing.md +49 -0
- package/dist/docs/api/components/classes/ScriptComponent.md +54 -0
- package/dist/docs/api/components/classes/Selectable.md +46 -0
- package/dist/docs/api/components/classes/SelectionTransformState.md +54 -0
- package/dist/docs/api/components/classes/SpriteComponent.md +55 -0
- package/dist/docs/api/components/classes/TransformComponent.md +197 -0
- package/dist/docs/api/components/classes/VideoComponent.md +123 -0
- package/dist/docs/api/components/functions/normalizePhysicsState.md +23 -0
- package/dist/docs/api/components/index.md +94 -0
- package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +42 -0
- package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +45 -0
- package/dist/docs/api/components/type-aliases/CameraProjection.md +15 -0
- package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +15 -0
- package/dist/docs/api/components/type-aliases/ColliderShape.md +15 -0
- package/dist/docs/api/components/type-aliases/ColliderState.md +62 -0
- package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +27 -0
- package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +15 -0
- package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +37 -0
- package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +15 -0
- package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +15 -0
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +34 -0
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +15 -0
- package/dist/docs/api/components/type-aliases/EnvironmentState.md +29 -0
- package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +25 -0
- package/dist/docs/api/components/type-aliases/ImageTargetReference.md +33 -0
- package/dist/docs/api/components/type-aliases/LightValueState.md +41 -0
- package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +15 -0
- package/dist/docs/api/components/type-aliases/MaterialValueState.md +75 -0
- package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +13 -0
- package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +33 -0
- package/dist/docs/api/components/type-aliases/PhysicsState.md +25 -0
- package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +25 -0
- package/dist/docs/api/components/type-aliases/PostprocessingState.md +164 -0
- package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +25 -0
- package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +23 -0
- package/dist/docs/api/components/type-aliases/RigidbodyState.md +53 -0
- package/dist/docs/api/components/type-aliases/RigidbodyType.md +19 -0
- package/dist/docs/api/components/type-aliases/ScriptEntry.md +38 -0
- package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +15 -0
- package/dist/docs/api/components/type-aliases/TransformData.md +27 -0
- package/dist/docs/api/components/type-aliases/TransformModeValue.md +15 -0
- package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +15 -0
- package/dist/docs/api/components/type-aliases/Vec3.md +27 -0
- package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +13 -0
- package/dist/docs/api/index/classes/AnimationStateMachine.md +201 -0
- package/dist/docs/api/index/classes/AnimationStateManager.md +253 -0
- package/dist/docs/api/index/classes/AnimationSystem.md +68 -0
- package/dist/docs/api/index/classes/AudioSystem.md +98 -0
- package/dist/docs/api/index/classes/CameraSyncSystem.md +49 -0
- package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +75 -0
- package/dist/docs/api/index/classes/InputSystem.md +449 -0
- package/dist/docs/api/index/classes/LightSyncSystem.md +49 -0
- package/dist/docs/api/index/classes/MaterialSyncSystem.md +67 -0
- package/dist/docs/api/index/classes/MeshGeometrySystem.md +49 -0
- package/dist/docs/api/index/classes/ObjectManagementSystem.md +298 -0
- package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +49 -0
- package/dist/docs/api/index/classes/PhysicsSyncSystem.md +83 -0
- package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +80 -0
- package/dist/docs/api/index/classes/RenderSystem.md +64 -0
- package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +83 -0
- package/dist/docs/api/index/classes/TransformSyncSystem.md +49 -0
- package/dist/docs/api/index/classes/VideoSystem.md +97 -0
- package/dist/docs/api/index/classes/World.md +1405 -0
- package/dist/docs/api/index/functions/createAnimationComponent.md +28 -0
- package/dist/docs/api/index/functions/createAudioComponent.md +32 -0
- package/dist/docs/api/index/functions/createCameraComponent.md +28 -0
- package/dist/docs/api/index/functions/createEntityTypeComponent.md +28 -0
- package/dist/docs/api/index/functions/createEnvironmentComponent.md +28 -0
- package/dist/docs/api/index/functions/createImageComponent.md +28 -0
- package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +28 -0
- package/dist/docs/api/index/functions/createImageTargetComponent.md +28 -0
- package/dist/docs/api/index/functions/createLightComponent.md +28 -0
- package/dist/docs/api/index/functions/createMaterialComponent.md +28 -0
- package/dist/docs/api/index/functions/createMeshComponent.md +28 -0
- package/dist/docs/api/index/functions/createMeshGeometryComponent.md +28 -0
- package/dist/docs/api/index/functions/createModelComponent.md +28 -0
- package/dist/docs/api/index/functions/createNameComponent.md +28 -0
- package/dist/docs/api/index/functions/createObject3DRefComponent.md +28 -0
- package/dist/docs/api/index/functions/createParentIdComponent.md +28 -0
- package/dist/docs/api/index/functions/createPhysicsComponent.md +30 -0
- package/dist/docs/api/index/functions/createPostprocessingComponent.md +28 -0
- package/dist/docs/api/index/functions/createScriptComponent.md +28 -0
- package/dist/docs/api/index/functions/createSelectableComponent.md +28 -0
- package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +28 -0
- package/dist/docs/api/index/functions/createSpriteComponent.md +28 -0
- package/dist/docs/api/index/functions/createTransformComponent.md +28 -0
- package/dist/docs/api/index/functions/createVideoComponent.md +28 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +28 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +28 -0
- package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +23 -0
- package/dist/docs/api/index/functions/registerDefaultFactories.md +23 -0
- package/dist/docs/api/index/index.md +249 -0
- package/dist/docs/api/index/interfaces/EcsSystem.md +50 -0
- package/dist/docs/api/index/interfaces/StateMachine.md +26 -0
- package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +25 -0
- package/dist/docs/api/index/type-aliases/ComponentFactory.md +25 -0
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +37 -0
- package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +26 -0
- package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +25 -0
- package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +23 -0
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +13 -0
- package/dist/docs/api/index/type-aliases/MouseButton.md +13 -0
- package/dist/docs/api/index/type-aliases/SelectionContext.md +31 -0
- package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +13 -0
- package/dist/docs/api/index/variables/KeyboardKeys.md +195 -0
- package/dist/docs/api/index.md +15 -0
- package/dist/docs/api/typedoc-sidebar.json +1 -0
- package/dist/docs/api/types/index.md +34 -0
- package/dist/docs/api/types/type-aliases/AssetInput.md +23 -0
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +13 -0
- package/dist/docs/api/types/type-aliases/ColorInput.md +13 -0
- package/dist/docs/api/types/type-aliases/ComponentInput.md +52 -0
- package/dist/docs/api/types/type-aliases/ComponentKind.md +37 -0
- package/dist/docs/api/types/type-aliases/DropdownInput.md +23 -0
- package/dist/docs/api/types/type-aliases/DropdownOption.md +23 -0
- package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +15 -0
- package/dist/docs/api/types/type-aliases/EcsEntityKind.md +35 -0
- package/dist/docs/api/types/type-aliases/EntityId.md +16 -0
- package/dist/docs/api/types/type-aliases/EntityInput.md +23 -0
- package/dist/docs/api/types/type-aliases/FloatInput.md +13 -0
- package/dist/docs/api/types/type-aliases/IntersectionResult.md +29 -0
- package/dist/docs/api/types/type-aliases/ParentLookup.md +26 -0
- package/dist/docs/api/types/type-aliases/SelectionListener.md +25 -0
- package/dist/docs/api/types/type-aliases/SliderInput.md +27 -0
- package/dist/docs/api/types/type-aliases/TextInput.md +13 -0
- package/dist/docs/api/types/type-aliases/ToggleInput.md +13 -0
- package/dist/docs/api/types/type-aliases/Vec3.md +23 -0
- package/dist/docs/api/types/type-aliases/Vector2Input.md +23 -0
- package/dist/docs/api/types/type-aliases/Vector3Input.md +25 -0
- package/dist/docs/api/types/type-aliases/WorldEntityView.md +17 -0
- package/dist/docs/guide/accessing-components.md +399 -0
- package/dist/docs/guide/authoring-a-behaviour.md +166 -0
- package/dist/docs/guide/behaviour-lifecycle.md +43 -0
- package/dist/docs/guide/component-catalog.md +59 -0
- package/dist/docs/guide/components/_sidebar.json +78 -0
- package/dist/docs/guide/components/animation.md +171 -0
- package/dist/docs/guide/components/audio.md +181 -0
- package/dist/docs/guide/components/camera.md +179 -0
- package/dist/docs/guide/components/entity-type.md +141 -0
- package/dist/docs/guide/components/image-target-anchor.md +103 -0
- package/dist/docs/guide/components/image-target.md +122 -0
- package/dist/docs/guide/components/image.md +146 -0
- package/dist/docs/guide/components/light.md +157 -0
- package/dist/docs/guide/components/material.md +161 -0
- package/dist/docs/guide/components/mesh-geometry.md +153 -0
- package/dist/docs/guide/components/mesh.md +151 -0
- package/dist/docs/guide/components/model.md +96 -0
- package/dist/docs/guide/components/name.md +121 -0
- package/dist/docs/guide/components/object3d-ref.md +115 -0
- package/dist/docs/guide/components/parent-id.md +108 -0
- package/dist/docs/guide/components/physics.md +163 -0
- package/dist/docs/guide/components/script.md +142 -0
- package/dist/docs/guide/components/sprite.md +155 -0
- package/dist/docs/guide/components/transform.md +155 -0
- package/dist/docs/guide/components/video.md +153 -0
- package/dist/docs/guide/concepts.md +34 -0
- package/dist/docs/guide/getting-started/creating-objects.md +50 -0
- package/dist/docs/guide/getting-started/editing-objects.md +62 -0
- package/dist/docs/guide/getting-started/editor/assets-browser.md +55 -0
- package/dist/docs/guide/getting-started/editor/hierarchy.md +47 -0
- package/dist/docs/guide/getting-started/editor/index.md +16 -0
- package/dist/docs/guide/getting-started/editor/inspector.md +36 -0
- package/dist/docs/guide/getting-started/editor/modules.md +35 -0
- package/dist/docs/guide/getting-started/editor/scene-inspector.md +64 -0
- package/dist/docs/guide/getting-started/editor/toolbar.md +39 -0
- package/dist/docs/guide/getting-started/editor/viewport.md +43 -0
- package/dist/docs/guide/getting-started/first-launch.md +17 -0
- package/dist/docs/guide/getting-started/index.md +37 -0
- package/dist/docs/guide/getting-started/installation.md +59 -0
- package/dist/docs/guide/getting-started/preview-and-test.md +55 -0
- package/dist/docs/guide/getting-started/project-types/3d.md +30 -0
- package/dist/docs/guide/getting-started/project-types/ar.md +6 -0
- package/dist/docs/guide/getting-started/project-types/face-tracking.md +6 -0
- package/dist/docs/guide/getting-started/project-types/image-tracking.md +42 -0
- package/dist/docs/guide/getting-started/project-types/index.md +25 -0
- package/dist/docs/guide/getting-started/project-types/vr.md +6 -0
- package/dist/docs/guide/getting-started/projects.md +53 -0
- package/dist/docs/guide/getting-started/shortcuts.md +43 -0
- package/dist/docs/guide/inspector-data-binding.md +367 -0
- package/dist/docs/guide/reading-input.md +202 -0
- package/dist/docs/guide/scene/environment.md +101 -0
- package/dist/docs/guide/scene/index.md +36 -0
- package/dist/docs/guide/scene/postprocessing.md +108 -0
- package/dist/docs/guide/spawning/ambient-light.md +28 -0
- package/dist/docs/guide/spawning/area-light.md +32 -0
- package/dist/docs/guide/spawning/audio.md +42 -0
- package/dist/docs/guide/spawning/camera.md +50 -0
- package/dist/docs/guide/spawning/capsule.md +29 -0
- package/dist/docs/guide/spawning/cube.md +31 -0
- package/dist/docs/guide/spawning/cylinder.md +29 -0
- package/dist/docs/guide/spawning/directional-light.md +32 -0
- package/dist/docs/guide/spawning/empty.md +31 -0
- package/dist/docs/guide/spawning/image-target.md +48 -0
- package/dist/docs/guide/spawning/image.md +33 -0
- package/dist/docs/guide/spawning/index.md +79 -0
- package/dist/docs/guide/spawning/model.md +31 -0
- package/dist/docs/guide/spawning/plane.md +31 -0
- package/dist/docs/guide/spawning/point-light.md +32 -0
- package/dist/docs/guide/spawning/sphere.md +29 -0
- package/dist/docs/guide/spawning/spot-light.md +32 -0
- package/dist/docs/guide/spawning/sprite.md +31 -0
- package/dist/docs/guide/spawning/video.md +53 -0
- package/dist/docs/guide/system-overview.md +73 -0
- package/dist/docs/guide/systems/_sidebar.json +66 -0
- package/dist/docs/guide/systems/animation-system.md +32 -0
- package/dist/docs/guide/systems/audio-system.md +28 -0
- package/dist/docs/guide/systems/camera-sync-system.md +31 -0
- package/dist/docs/guide/systems/environment-sync-system.md +31 -0
- package/dist/docs/guide/systems/input-system.md +217 -0
- package/dist/docs/guide/systems/light-sync-system.md +29 -0
- package/dist/docs/guide/systems/material-sync-system.md +32 -0
- package/dist/docs/guide/systems/mesh-geometry-system.md +40 -0
- package/dist/docs/guide/systems/object-management-system.md +38 -0
- package/dist/docs/guide/systems/object-visibility-system.md +26 -0
- package/dist/docs/guide/systems/physics-sync-system.md +56 -0
- package/dist/docs/guide/systems/postprocessing-sync-system.md +43 -0
- package/dist/docs/guide/systems/render-system.md +22 -0
- package/dist/docs/guide/systems/script-behaviour-system.md +59 -0
- package/dist/docs/guide/systems/transform-sync-system.md +29 -0
- package/dist/docs/guide/systems/video-system.md +30 -0
- package/dist/docs/guide/world-api.md +405 -0
- package/dist/factories/index.cjs +3077 -0
- package/dist/factories/index.cjs.map +1 -0
- package/dist/factories/index.d.cts +69 -0
- package/dist/factories/index.d.ts +69 -0
- package/dist/factories/index.js +6 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/index-B4-YyUNR.d.cts +73 -0
- package/dist/index-BZUOKeTO.d.ts +73 -0
- package/dist/index.cjs +8584 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +283 -0
- package/dist/index.d.ts +283 -0
- package/dist/index.js +1729 -0
- package/dist/index.js.map +1 -0
- package/dist/systems/index.cjs +5119 -0
- package/dist/systems/index.cjs.map +1 -0
- package/dist/systems/index.d.cts +200 -0
- package/dist/systems/index.d.ts +200 -0
- package/dist/systems/index.js +6 -0
- package/dist/systems/index.js.map +1 -0
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +3 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/worldSnapshotUtils.cjs +259 -0
- package/dist/worldSnapshotUtils.cjs.map +1 -0
- package/dist/worldSnapshotUtils.d.cts +3 -0
- package/dist/worldSnapshotUtils.d.ts +3 -0
- package/dist/worldSnapshotUtils.js +4 -0
- package/dist/worldSnapshotUtils.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Transform
|
|
2
|
+
|
|
3
|
+
Position, rotation, and scale of an entity in its parent's local space. Rotation is stored in **radians** (Euler XYZ). The editor inspector converts to/from degrees for display — do not store degrees in this component. Mutations should go through the `setPosition` / `setRotation` / `setScale` helpers so dependent systems pick up the change.
|
|
4
|
+
|
|
5
|
+
> **Managed by:** [`TransformSyncSystem`](../systems/transform-sync-system)
|
|
6
|
+
|
|
7
|
+
## Editor inspector
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
| Property | Type | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `position` | `Vec3` | Local position relative to the parent (or world if no parent). |
|
|
16
|
+
| `rotation` | `Vec3` | Local rotation as Euler XYZ in **radians**. |
|
|
17
|
+
| `scale` | `Vec3` | Local scale factors per axis (`1` = identity). |
|
|
18
|
+
|
|
19
|
+
## API reference
|
|
20
|
+
|
|
21
|
+
- Class: [`TransformComponent`](../../api/components/classes/TransformComponent.md)
|
|
22
|
+
- Source: [`core/components/Transform.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/Transform.ts)
|
|
23
|
+
|
|
24
|
+
## Scripting examples
|
|
25
|
+
|
|
26
|
+
::: tip Component access patterns
|
|
27
|
+
Use `this.getComponent(X)` to access a component on the **entity this script is attached to**. Use `this.world.getEntityByName` to find another entity by name, then `this.world.getComponent` to read its component:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// Component on the entity this script is on
|
|
31
|
+
const transform = this.getComponent(TransformComponent);
|
|
32
|
+
|
|
33
|
+
// Component on another entity, found by its scene name
|
|
34
|
+
const other = this.world.getEntityByName("Target");
|
|
35
|
+
if (other) {
|
|
36
|
+
const transform = this.world.getComponent(other.entityId, TransformComponent);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For `TransformComponent` specifically, `this.transform` is a built-in shorthand — the same component, no lookup needed.
|
|
41
|
+
:::
|
|
42
|
+
|
|
43
|
+
### Continuous rotation
|
|
44
|
+
|
|
45
|
+
Rotate an entity on any combination of axes at inspector-controlled speeds.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { Behaviour } from "@relu-interactives/spatial-ecs";
|
|
49
|
+
import type { FloatInput } from "@relu-interactives/spatial-ecs";
|
|
50
|
+
|
|
51
|
+
export default class Rotator extends Behaviour {
|
|
52
|
+
data = {
|
|
53
|
+
speedX: 0 as FloatInput,
|
|
54
|
+
speedY: 1 as FloatInput,
|
|
55
|
+
speedZ: 0 as FloatInput,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
protected onUpdate() {
|
|
59
|
+
this.transform.rotation.x += this.data.speedX * this.deltaTime;
|
|
60
|
+
this.transform.rotation.y += this.data.speedY * this.deltaTime;
|
|
61
|
+
this.transform.rotation.z += this.data.speedZ * this.deltaTime;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Sine-wave bobbing
|
|
67
|
+
|
|
68
|
+
Animate the entity's Y position with a configurable sine wave, useful for floating objects or UI indicators.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { Behaviour } from "@relu-interactives/spatial-ecs";
|
|
72
|
+
import type { FloatInput } from "@relu-interactives/spatial-ecs";
|
|
73
|
+
|
|
74
|
+
export default class Bobber extends Behaviour {
|
|
75
|
+
data = {
|
|
76
|
+
amplitude: 0.5 as FloatInput,
|
|
77
|
+
frequency: 1 as FloatInput,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
private elapsed = 0;
|
|
81
|
+
private originY = 0;
|
|
82
|
+
|
|
83
|
+
protected init() {
|
|
84
|
+
this.originY = this.transform.position.y;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
protected onUpdate() {
|
|
88
|
+
this.elapsed += this.deltaTime;
|
|
89
|
+
this.transform.position.y =
|
|
90
|
+
this.originY + Math.sin(this.elapsed * this.data.frequency) * this.data.amplitude;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Via `ComponentInput` in the inspector
|
|
96
|
+
|
|
97
|
+
You can also pick this component from the inspector using a `ComponentInput` field. Assign any entity in the inspector and the field resolves to the live `TransformComponent` instance at runtime.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import {
|
|
101
|
+
Behaviour,
|
|
102
|
+
TransformComponent,
|
|
103
|
+
type ComponentInput,
|
|
104
|
+
} from "@relu-interactives/spatial-ecs";
|
|
105
|
+
|
|
106
|
+
export default class Example extends Behaviour {
|
|
107
|
+
data = {
|
|
108
|
+
targetTransform: {
|
|
109
|
+
type: "component",
|
|
110
|
+
value: null,
|
|
111
|
+
} as unknown as ComponentInput,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
protected onUpdate() {
|
|
115
|
+
const transform = this.data.targetTransform.value as TransformComponent | null;
|
|
116
|
+
if (!transform) return;
|
|
117
|
+
// Use the live component instance.
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Via `EntityInput` in the inspector
|
|
123
|
+
|
|
124
|
+
Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import {
|
|
128
|
+
Behaviour,
|
|
129
|
+
TransformComponent,
|
|
130
|
+
type EntityInput,
|
|
131
|
+
type WorldEntityView,
|
|
132
|
+
} from "@relu-interactives/spatial-ecs";
|
|
133
|
+
|
|
134
|
+
export default class Example extends Behaviour {
|
|
135
|
+
data = {
|
|
136
|
+
targetEntity: { type: "entity", value: null } as unknown as EntityInput,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
protected onUpdate() {
|
|
140
|
+
const entity = this.data.targetEntity.value as WorldEntityView | null;
|
|
141
|
+
if (!entity) return;
|
|
142
|
+
|
|
143
|
+
const transform = this.world.getComponent(
|
|
144
|
+
entity.entityId,
|
|
145
|
+
TransformComponent,
|
|
146
|
+
) as TransformComponent | null;
|
|
147
|
+
if (!transform) return;
|
|
148
|
+
// Use the component on the picked entity.
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
::: tip Rotation units
|
|
154
|
+
Rotation is stored and mutated in **radians**. The editor inspector displays degrees — convert with `Math.PI / 180` if you need to enter degree values in code.
|
|
155
|
+
:::
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Video
|
|
2
|
+
|
|
3
|
+
Plays a video file as a texture on a quad. Supports green-screen keying (`isGreenScreen`, `backgroundColor`, `similarity`, `smoothness`, `spill`). The video element, texture, and material are runtime-only and re-created when the project loads.
|
|
4
|
+
|
|
5
|
+
> **Managed by:** [`VideoSystem`](../systems/video-system)
|
|
6
|
+
|
|
7
|
+
## Editor inspector
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
| Property | Type | Description |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `path` | `string` | Source URL or `localasset://` path of the video file. |
|
|
16
|
+
| `options` | `typeof DEFAULT_VIDEO_OPTIONS` | Playback + green-screen options. | Field | Default | Description | |---|---|---| | `autoplay` | `false` | Start playback as soon as the video is ready. | | `loop` | `true` | Loop playback indefinitely. | | `volume` | `1` | Linear gain in `[0, 1]`. | | `width` | `1` | Quad width in world units. | | `height` | `1` | Quad height in world units. | | `isGreenScreen` | `false` | Enable chroma keying using the fields below. | | `backgroundColor` | `"#00ff00"` | Color to key out (CSS color string). | | `similarity` | `0.4` | How close a pixel must be to the key to be removed (`0`–`1`). | | `smoothness` | `0.08` | Soft-edge thickness around the key threshold. | | `spill` | `0.12` | Amount of color spill suppression near edges. | | `positional` | `false` | When `true`, the video's audio stream is spatialized using the entity's 3D position. | | `refDistance` | `1` | Distance at which volume is unattenuated (positional only). | | `distanceModel` | `"inverse"` | WebAudio distance model (`linear`, `inverse`, `exponential`). Positional only. | | `rolloffFactor` | `1` | How quickly volume falls off past `refDistance`. Positional only. | |
|
|
17
|
+
| `object` | `THREE.Object3D \| null` | Live three.js object hosting the video quad. `null` until built. |
|
|
18
|
+
| `videoElement` | `HTMLVideoElement \| null` | Underlying HTML video element. `null` until built. |
|
|
19
|
+
| `texture` | `THREE.VideoTexture \| null` | Three.js texture sampling the video element. `null` until built. |
|
|
20
|
+
| `material` | `THREE.Material \| null` | Material rendering the video texture (with green-screen shader when enabled). `null` until built. |
|
|
21
|
+
| `audioNode` | `THREE.Audio<GainNode> \| THREE.PositionalAudio \| null` | THREE.js audio node connected to this video's audio stream via `setMediaElementSource`. Present only in preview when the camera listener is available. `null` in editor mode. |
|
|
22
|
+
| `isPlaying` | `boolean` | Whether the video should be playing. Managed by `VideoSystem` in preview. Non-enumerable — not persisted to snapshots or save data. Set via `play` / `stop`. |
|
|
23
|
+
| `isPaused` | `boolean` | Whether the video is paused mid-playback (position is preserved). Non-enumerable — not persisted to snapshots or save data. Set via `pause` / `play` / `stop`. |
|
|
24
|
+
|
|
25
|
+
## API reference
|
|
26
|
+
|
|
27
|
+
- Class: [`VideoComponent`](../../api/components/classes/VideoComponent.md)
|
|
28
|
+
- Source: [`core/components/Video.ts`](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/main/core/components/Video.ts)
|
|
29
|
+
|
|
30
|
+
## Scripting examples
|
|
31
|
+
|
|
32
|
+
::: tip Component access patterns
|
|
33
|
+
Use `this.getComponent(X)` to access a component on the **entity this script is attached to**. Use `this.world.getEntityByName` to find another entity by name, then `this.world.getComponent` to read its component:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// Component on the entity this script is on
|
|
37
|
+
const video = this.getComponent(VideoComponent);
|
|
38
|
+
|
|
39
|
+
// Component on another entity, found by its scene name
|
|
40
|
+
const other = this.world.getEntityByName("Screen");
|
|
41
|
+
if (other) {
|
|
42
|
+
const video = this.world.getComponent(other.entityId, VideoComponent);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
:::
|
|
46
|
+
|
|
47
|
+
### Play / pause on key press
|
|
48
|
+
|
|
49
|
+
Toggle video playback when the player presses Space.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { Behaviour, VideoComponent, KeyboardKeys } from "@relu-interactives/spatial-ecs";
|
|
53
|
+
|
|
54
|
+
export default class VideoController extends Behaviour {
|
|
55
|
+
protected onUpdate() {
|
|
56
|
+
const video = this.getComponent(VideoComponent);
|
|
57
|
+
if (!video) return;
|
|
58
|
+
|
|
59
|
+
if (this.world.getKeyDown(KeyboardKeys.Space)) {
|
|
60
|
+
if (video.isPlaying) {
|
|
61
|
+
video.pause();
|
|
62
|
+
} else {
|
|
63
|
+
video.play();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Inspector-driven volume and loop
|
|
71
|
+
|
|
72
|
+
Expose volume and loop settings as inspector fields so they can be tuned without re-entering the code.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { Behaviour, VideoComponent } from "@relu-interactives/spatial-ecs";
|
|
76
|
+
import type { FloatInput, BooleanInput } from "@relu-interactives/spatial-ecs";
|
|
77
|
+
|
|
78
|
+
export default class VideoSettings extends Behaviour {
|
|
79
|
+
data = {
|
|
80
|
+
volume: 1 as FloatInput,
|
|
81
|
+
loop: true as BooleanInput,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
protected onUpdate() {
|
|
85
|
+
const video = this.getComponent(VideoComponent);
|
|
86
|
+
if (!video) return;
|
|
87
|
+
video.options.volume = this.data.volume;
|
|
88
|
+
video.options.loop = this.data.loop;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Via `ComponentInput` in the inspector
|
|
94
|
+
|
|
95
|
+
You can also pick this component from the inspector using a `ComponentInput` field. Assign any entity in the inspector and the field resolves to the live `VideoComponent` instance at runtime.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import {
|
|
99
|
+
Behaviour,
|
|
100
|
+
VideoComponent,
|
|
101
|
+
type ComponentInput,
|
|
102
|
+
} from "@relu-interactives/spatial-ecs";
|
|
103
|
+
|
|
104
|
+
export default class Example extends Behaviour {
|
|
105
|
+
data = {
|
|
106
|
+
targetVideo: {
|
|
107
|
+
type: "component",
|
|
108
|
+
value: null,
|
|
109
|
+
} as unknown as ComponentInput,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
protected onUpdate() {
|
|
113
|
+
const video = this.data.targetVideo.value as VideoComponent | null;
|
|
114
|
+
if (!video) return;
|
|
115
|
+
// Use the live component instance.
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Via `EntityInput` in the inspector
|
|
121
|
+
|
|
122
|
+
Alternatively, pick an entity from the inspector using an `EntityInput` field and then read the component off that entity via `world.getComponent`:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import {
|
|
126
|
+
Behaviour,
|
|
127
|
+
VideoComponent,
|
|
128
|
+
type EntityInput,
|
|
129
|
+
type WorldEntityView,
|
|
130
|
+
} from "@relu-interactives/spatial-ecs";
|
|
131
|
+
|
|
132
|
+
export default class Example extends Behaviour {
|
|
133
|
+
data = {
|
|
134
|
+
targetEntity: { type: "entity", value: null } as unknown as EntityInput,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
protected onUpdate() {
|
|
138
|
+
const entity = this.data.targetEntity.value as WorldEntityView | null;
|
|
139
|
+
if (!entity) return;
|
|
140
|
+
|
|
141
|
+
const video = this.world.getComponent(
|
|
142
|
+
entity.entityId,
|
|
143
|
+
VideoComponent,
|
|
144
|
+
) as VideoComponent | null;
|
|
145
|
+
if (!video) return;
|
|
146
|
+
// Use the component on the picked entity.
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
::: tip Playback methods
|
|
152
|
+
Use `video.play()`, `video.pause()`, and `video.stop()` to control playback. These update `isPlaying` / `isPaused` so the `VideoSystem` applies the correct HTML video element call in preview.
|
|
153
|
+
:::
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Concepts
|
|
2
|
+
|
|
3
|
+
The ECS is organized around three primitives.
|
|
4
|
+
|
|
5
|
+
## Entity
|
|
6
|
+
|
|
7
|
+
An **entity** is just an integer id. It owns no logic and no data on its own, everything is attached as components.
|
|
8
|
+
|
|
9
|
+
## Component
|
|
10
|
+
|
|
11
|
+
A **component** is a typed data container. Built-in components include `TransformComponent`, `MeshComponent`, `LightComponent`, `PhysicsComponent`, and many more. Each component:
|
|
12
|
+
|
|
13
|
+
- Extends the base [`Component`](/api/Component/classes/Component) class.
|
|
14
|
+
- Holds plain state (numbers, strings, vectors, asset URLs).
|
|
15
|
+
|
|
16
|
+
See the [Component Catalog](./component-catalog) for an alphabetical list with field-level docs.
|
|
17
|
+
|
|
18
|
+
## System
|
|
19
|
+
|
|
20
|
+
A **system** queries entities by component shape and applies side effects each frame. Built-in systems handle object management, geometry, transforms, animation, rendering, and so on. As a script author you rarely interact with systems directly — you read and mutate components, and the systems do the rest.
|
|
21
|
+
|
|
22
|
+
## Behaviour (Scripting)
|
|
23
|
+
|
|
24
|
+
A **Behaviour** is a user-authored class that runs per-frame logic on a single entity. It has full access to `world`, the entity's `transform`, its three.js `Object3D`, and helpers for hierarchy and math.
|
|
25
|
+
|
|
26
|
+
By default, Behaviours only execute at preview or runtime. Enable the **Execute in editor** toggle on a script entry in the inspector to run the full lifecycle inside the editor as well. This gives direct access to `this.world.getScene()`, `getCamera()`, and `getRenderer()` — useful for custom shaders, procedural geometry, grass, and other Three.js features the editor palette does not expose.
|
|
27
|
+
|
|
28
|
+
See [Custom Behaviours](./authoring-a-behaviour) and [Running scripts in the editor](./authoring-a-behaviour#running-scripts-in-the-editor).
|
|
29
|
+
|
|
30
|
+
## World
|
|
31
|
+
|
|
32
|
+
The [`World`](/api/index/classes/World) is the runtime gateway you reach from a script via `this.world`. Use it to find entities, read input, query components, and access the scene/camera/renderer.
|
|
33
|
+
|
|
34
|
+
See the [World](./world-api) for the full method list and recipes.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Creating Objects
|
|
2
|
+
|
|
3
|
+
Once your scene is open, you can populate it from three places.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## 1. From the toolbar
|
|
8
|
+
|
|
9
|
+
Click the **`+`** button in the [toolbar](./editor/toolbar). A menu lists every spawnable entity kind:
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
- **Primitives:** cube, sphere, plane, cone, cylinder, torus.
|
|
14
|
+
- **Lights:** directional, point, spot, ambient.
|
|
15
|
+
- **Cameras:** perspective, orthographic.
|
|
16
|
+
- **Anchors:** image target, face anchor, geo anchor (per project type).
|
|
17
|
+
- **Empty:** a transform-only entity used as a parent group.
|
|
18
|
+
|
|
19
|
+
Pick a kind. The editor spawns the entity at the world origin (or as a child of the current selection if it's an anchor type).
|
|
20
|
+
|
|
21
|
+
## 2. From the hierarchy
|
|
22
|
+
|
|
23
|
+
The hierarchy panel has its own **`+`** button that opens the same spawn menu.
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 3. From the assets browser
|
|
29
|
+
|
|
30
|
+
Drag any asset from the [assets browser](./editor/assets-browser) into the viewport or hierarchy:
|
|
31
|
+
|
|
32
|
+
- **`.glb` / `.gltf`** → spawns a `Model` entity.
|
|
33
|
+
- **`.png` / `.jpg` / `.webp`** → spawns a `Sprite` or `Image` entity (or sets it as a material texture if dropped on a mesh).
|
|
34
|
+
- **`.mp3` / `.wav`** → spawns an `Audio` entity.
|
|
35
|
+
- **`.mp4`** → spawns a `Video` entity.
|
|
36
|
+
- **Behaviour script** → attaches the script to the drop target.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## Selecting and arranging
|
|
41
|
+
|
|
42
|
+
- **Click** an entity in the viewport or hierarchy to select it.
|
|
43
|
+
- **Drag** the gizmo to move, rotate, or scale (toggle modes from the toolbar).
|
|
44
|
+
- **Drag in the hierarchy** to re-parent.
|
|
45
|
+
- **Delete** removes the selected entity (and its children).
|
|
46
|
+
|
|
47
|
+
## Next
|
|
48
|
+
|
|
49
|
+
- [Editing inspector values](./editing-objects) — fine-tune components on selected entities.
|
|
50
|
+
- [Spawning](../spawning/) — full reference of every spawnable kind.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Editing Inspector Values
|
|
2
|
+
|
|
3
|
+
Selecting an entity opens the [Inspector](./editor/inspector) on the right side of the editor. The inspector shows one panel per component attached to that entity, you change the entity's behavior by editing those panel values.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Common edits
|
|
8
|
+
|
|
9
|
+
### Transform
|
|
10
|
+
|
|
11
|
+
Every entity has a **Transform** panel: position, rotation, and scale. Rotation is shown in **degrees** in the UI but stored in radians at runtime. **Note:** you don't need to convert.
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
You can also drag the gizmo in the viewport instead of typing values.
|
|
16
|
+
|
|
17
|
+
### Material
|
|
18
|
+
|
|
19
|
+
For mesh entities, the **Material** panel exposes:
|
|
20
|
+
|
|
21
|
+
- **Type:** basic, lambert, phong, standard (PBR), physical.
|
|
22
|
+
- **Color / map:** solid color or texture.
|
|
23
|
+
- **Roughness / metalness** (PBR only).
|
|
24
|
+
- **Emissive:** self-illumination color and intensity.
|
|
25
|
+
- **Transparency / opacity / blending**.
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
> [!TIP]
|
|
31
|
+
> Drag a texture from the [assets browser](./editor/assets-browser) directly onto the **Color map** slot to assign it.
|
|
32
|
+
|
|
33
|
+
### Light
|
|
34
|
+
|
|
35
|
+
For light entities the **Light** panel exposes color, intensity, decay, and shadow settings.
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Script
|
|
41
|
+
|
|
42
|
+
Attaching a `Behaviour` script adds a **Script** panel. Any field you declared on the behaviour class shows up here as a typed input.
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
See [Custom Behaviours](../authoring-a-behaviour) for how to declare exposed fields.
|
|
47
|
+
|
|
48
|
+
## Adding components
|
|
49
|
+
|
|
50
|
+
Click **`+ Add component`** at the bottom of the inspector to attach additional components — collider, rigidbody, audio, animation, custom script, etc.
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Undo / redo
|
|
56
|
+
|
|
57
|
+
Every inspector edit pushes onto the undo stack. Use **⌘Z / Ctrl+Z** to revert and **⌘⇧Z / Ctrl+Shift+Z** to redo.
|
|
58
|
+
|
|
59
|
+
## Related
|
|
60
|
+
|
|
61
|
+
- [Inspector reference](./editor/inspector).
|
|
62
|
+
- [Component Catalog](../component-catalog) — every component and field.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Asset browser
|
|
2
|
+
|
|
3
|
+
The asset browser at the bottom of the editor lists every file in your project's `assets/` folder (models, images, audio, video, and scripts).
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Layout
|
|
8
|
+
|
|
9
|
+
- **Search bar:** fuzzy filter across the visible folder.
|
|
10
|
+
- **Type filters:** `All`, `Models`, `Images`, `Audios`, `Videos`, `Scripts`, `Other`.
|
|
11
|
+
- **Breadcrumb:** shows the current folder path. Click `← All assets` to go up.
|
|
12
|
+
- **`New folder`:** creates a folder under the current path.
|
|
13
|
+
- **Trash icon:** deletes the selected asset(s).
|
|
14
|
+
|
|
15
|
+
## Importing assets
|
|
16
|
+
|
|
17
|
+
There are three ways to import:
|
|
18
|
+
|
|
19
|
+
1. **Drag** a file from your OS into the asset browser. Files are copied into the project's local `assets/` folder.
|
|
20
|
+
2. **Drag** a file directly into the [viewport](./viewport). it imports **and** spawns a matching entity (model, image, video, audio).
|
|
21
|
+
3. **Right-click → Upload** in the asset browser.
|
|
22
|
+
|
|
23
|
+
Supported formats:
|
|
24
|
+
|
|
25
|
+
| Type | Formats |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Models | `.glb`, `.gltf`, `.fbx` |
|
|
28
|
+
| Images | `.png`, `.jpg`, `.jpeg`, `.webp`, `.hdr` (skybox) |
|
|
29
|
+
| Audio | `.mp3`, `.wav`, `.ogg` |
|
|
30
|
+
| Video | `.mp4`, `.webm` |
|
|
31
|
+
| Scripts | `.ts` (compiled by the editor on save) |
|
|
32
|
+
|
|
33
|
+
## Folders
|
|
34
|
+
|
|
35
|
+
Folders are real directories under `assets/`. You can:
|
|
36
|
+
|
|
37
|
+
- **Drag** an asset into a folder thumbnail to move it.
|
|
38
|
+
- **Right-click** a folder for rename / delete / new folder.
|
|
39
|
+
- Drag a folder onto another folder to nest it.
|
|
40
|
+
|
|
41
|
+
## Using assets in the scene
|
|
42
|
+
|
|
43
|
+
- **Drag a model / image / video / audio** onto the viewport to spawn an entity that uses it.
|
|
44
|
+
- **Drag onto an existing entity row** in the [hierarchy](./hierarchy) to assign the asset to that entity's matching component (for example, dropping a `.png` onto an entity with a `Image` component swaps its image).
|
|
45
|
+
- **Drag a clip onto the Animation panel** in the [inspector](./inspector) to add it as a clip source.
|
|
46
|
+
|
|
47
|
+
## Scripts
|
|
48
|
+
|
|
49
|
+
Right-click in the asset browser and pick **New Component** to create a `Behaviour` script in place. The editor compiles it and exposes it for attachment via the inspector's **Script** panel. See [Custom Behaviours](../../authoring-a-behaviour).
|
|
50
|
+
|
|
51
|
+
## Related
|
|
52
|
+
|
|
53
|
+
<!-- - [Modules](./modules) -->
|
|
54
|
+
- [Spawning](../../spawning/)
|
|
55
|
+
- [Custom Behaviours](../../authoring-a-behaviour)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Hierarchy
|
|
2
|
+
|
|
3
|
+
The hierarchy panel (top-left) is the tree of every entity in your scene. It is the canonical place to **select**, **rename**, **parent**, and **toggle visibility** of entities.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## What you see per row
|
|
8
|
+
|
|
9
|
+
Each row represents one entity:
|
|
10
|
+
|
|
11
|
+
- **Name:** editable label (`Name` component value).
|
|
12
|
+
- **Type tag:** the entity kind (`model`, `cube`, `directionalLight`, …) shown as muted text on the right.
|
|
13
|
+
- **Eye icon:** toggles visibility for that entity.
|
|
14
|
+
|
|
15
|
+
## Selection
|
|
16
|
+
|
|
17
|
+
- **Click a row** to select the entity. The viewport gizmo and inspector both update.
|
|
18
|
+
- **Click the empty area below the list** to deselect.
|
|
19
|
+
- Selecting an entity in the viewport also highlights its row.
|
|
20
|
+
|
|
21
|
+
## Searching
|
|
22
|
+
|
|
23
|
+
The search box above the tree filters rows by name. It searches the displayed name only — not component values.
|
|
24
|
+
|
|
25
|
+
## Adding entities
|
|
26
|
+
|
|
27
|
+
The `+` button at the top of the panel opens the same menu as the top-bar `+`.
|
|
28
|
+
|
|
29
|
+
## Parenting
|
|
30
|
+
|
|
31
|
+
Drag a row onto another row to **re-parent** it. The dragged entity becomes a child of the drop target, and its transform becomes local to the parent.
|
|
32
|
+
|
|
33
|
+
- Drop **onto** a row → child of that row.
|
|
34
|
+
- Drop **between** rows → reorder under the same parent.
|
|
35
|
+
- Drop on **empty space** → re-parent to the scene root.
|
|
36
|
+
|
|
37
|
+
> [!IMPORTANT]
|
|
38
|
+
> Some entities — for example image-target anchors — control their own children. Re-parenting them across different anchor groups can change runtime behavior. See the [Component Catalog](../../component-catalog) for component-specific notes.
|
|
39
|
+
|
|
40
|
+
## Renaming
|
|
41
|
+
|
|
42
|
+
Double-click a row's name to rename. The new value writes to the entity's `Name` component immediately and shows up in scripts that look entities up by name (`world.getEntityByName(...)`).
|
|
43
|
+
|
|
44
|
+
## Related
|
|
45
|
+
|
|
46
|
+
- [Inspector](./inspector)
|
|
47
|
+
- [Spawning](../../spawning/)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Understanding the Editor
|
|
2
|
+
|
|
3
|
+
The editor window is divided into a handful of regions. Each one has a dedicated page in this section.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
| Region | Purpose |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| [Hierarchy](./hierarchy) | The scene tree. Add, select, parent, and reorder entities. |
|
|
10
|
+
| [Toolbar](./toolbar) | Global actions — settings, transform tools, save, preview, publish. |
|
|
11
|
+
| [Viewport](./viewport) | The 3D scene view. Click to select, drag gizmos to transform. |
|
|
12
|
+
| [Inspector](./inspector) | Edit components on the selected entity. |
|
|
13
|
+
| [Assets Browser](./assets-browser) | Files in your project's `assets/` folder. Drag into the scene to add. |
|
|
14
|
+
<!-- | [Modules](./modules) | Optional per-project-type module panels. | -->
|
|
15
|
+
|
|
16
|
+
Read these in any order — most pages are short and focused on one region.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Inspector
|
|
2
|
+
|
|
3
|
+
The inspector (right panel) is where you edit the **components** of whatever is currently selected either an entity or the scene itself.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Two top-level tabs
|
|
8
|
+
|
|
9
|
+
At the top of the inspector are two tabs:
|
|
10
|
+
|
|
11
|
+
| Tab | Shows |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| **Object** | Components of the entity currently selected in the [hierarchy](./hierarchy). When nothing is selected, the tab is empty. |
|
|
14
|
+
| **Scene** | Scene wide singletons like skybox, fog, gravity, postprocessing. See [Scene → Environment](../../scene/environment) and [Scene → Postprocessing](../../scene/postprocessing). |
|
|
15
|
+
|
|
16
|
+
## Component panels
|
|
17
|
+
|
|
18
|
+
Each component on the selected entity is rendered as a collapsible panel. Common ones are:
|
|
19
|
+
|
|
20
|
+
- **Name:** the editable display name.
|
|
21
|
+
- **Transform:** position, rotation (degrees in the inspector, radians at runtime), and scale. Scale uniformly with the link icon.
|
|
22
|
+
- **Mesh:** geometry source and shadow flags (cast / receive).
|
|
23
|
+
- **Material:** color, texture, opacity, and shader-specific settings.
|
|
24
|
+
- **Animation:** active state plus a list of clip sources you can drop `.fbx`, `.glb`, or `.gltf` files onto.
|
|
25
|
+
- **Light:** type, color, intensity, range, shadow settings.
|
|
26
|
+
- **Rigidbody / Collider:** physics body type and collider shape.
|
|
27
|
+
- **Script:** attached `Behaviour` and its inspector-bound fields.
|
|
28
|
+
|
|
29
|
+
The panels you see depend on which components the entity actually has. The full catalog and field-level details are in the [Component Catalog](../../component-catalog).
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Hierarchy](./hierarchy)
|
|
35
|
+
- [Scene singletons](../../scene/)
|
|
36
|
+
- [Component Catalog](../../component-catalog)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Modules panel
|
|
2
|
+
|
|
3
|
+
The **Modules** panel sits in the lower-left of the editor, below the [hierarchy](./hierarchy). It is a library of **pre-built, ready-to-drop** behaviors and entity bundles you can drag into your scene.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## What is a module?
|
|
8
|
+
|
|
9
|
+
A module is a packaged group of one or more entities, components, and scripts that solve a recurring problem for example:
|
|
10
|
+
|
|
11
|
+
- **VR Teleport Area** a floor plane with a teleport-target script wired up.
|
|
12
|
+
- _More modules ship with the editor over time._
|
|
13
|
+
|
|
14
|
+
Compared to creating primitive from the [top bar `+` menu](./toolbar), a module brings its **components and scripts** along with it, so you do not need to wire anything up manually.
|
|
15
|
+
|
|
16
|
+
## Using a module
|
|
17
|
+
|
|
18
|
+
1. Find the module in the panel (use the **Search modules…** field if needed).
|
|
19
|
+
2. **Drag** the module card into the [viewport](./viewport) or onto a target row in the [hierarchy](./hierarchy).
|
|
20
|
+
3. The editor spawns the module's entities at the drop location.
|
|
21
|
+
4. Tune the spawned entities in the [inspector](./inspector) like any other entity.
|
|
22
|
+
|
|
23
|
+
## Module vs. asset vs. spawn
|
|
24
|
+
|
|
25
|
+
| Source | What you get | When to use |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| **Top bar `+`** | A single primitive entity with default components. | Building blocks. |
|
|
28
|
+
| **Asset browser** | An entity that references a media asset (model, image, …). | Bringing your own content in. |
|
|
29
|
+
| **Modules panel** | A bundle of entities + components + scripts wired together. | Reusing solved patterns. |
|
|
30
|
+
|
|
31
|
+
## Related
|
|
32
|
+
|
|
33
|
+
- [Top bar](./toolbar) — the `+` spawn menu.
|
|
34
|
+
- [Asset browser](./assets-browser) — importing your own files.
|
|
35
|
+
- [Spawning](../../spawning/) — every primitive spawn kind.
|