@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,318 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / AnimationComponent
|
|
6
|
+
|
|
7
|
+
# Class: AnimationComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Animation.ts:71](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L71)
|
|
10
|
+
|
|
11
|
+
Animation catalog and runtime state for an entity. Combines clips imported
|
|
12
|
+
from a model with externally added clips, exposes a state machine for
|
|
13
|
+
named transitions, and is queried each frame by the animation system to
|
|
14
|
+
advance mixer time.
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
Use the `addState` / `switchState` helpers rather than mutating the state
|
|
19
|
+
machine directly so the animation system observes transitions.
|
|
20
|
+
|
|
21
|
+
## Extends
|
|
22
|
+
|
|
23
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
24
|
+
|
|
25
|
+
## Constructors
|
|
26
|
+
|
|
27
|
+
### Constructor
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
new AnimationComponent(options?): AnimationComponent;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [components/Animation.ts:102](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L102)
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
| Parameter | Type |
|
|
38
|
+
| ------ | ------ |
|
|
39
|
+
| `options` | [`AnimationComponentOptions`](../type-aliases/AnimationComponentOptions.md) |
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`AnimationComponent`
|
|
44
|
+
|
|
45
|
+
#### Overrides
|
|
46
|
+
|
|
47
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
48
|
+
|
|
49
|
+
## Properties
|
|
50
|
+
|
|
51
|
+
| Property | Type | Description | Defined in |
|
|
52
|
+
| ------ | ------ | ------ | ------ |
|
|
53
|
+
| <a id="clips"></a> `clips` | `AnimationClip`[] | Combined ordered list of clips (model + external) currently loaded. | [components/Animation.ts:78](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L78) |
|
|
54
|
+
| <a id="clipcatalog"></a> `clipCatalog` | `AnimationClipCatalogEntry`[] | Per-clip metadata used by the inspector. | [components/Animation.ts:80](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L80) |
|
|
55
|
+
| <a id="availableclips"></a> `availableClips` | `string`[] | Display names of clips available for state-machine bindings. | [components/Animation.ts:82](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L82) |
|
|
56
|
+
| <a id="externalclipsources"></a> `externalClipSources` | `string`[] | URLs/paths of external clip sources (saved with the project). | [components/Animation.ts:84](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L84) |
|
|
57
|
+
| <a id="paused"></a> `paused` | `boolean` | Whether playback is currently paused. | [components/Animation.ts:86](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L86) |
|
|
58
|
+
| <a id="reverse"></a> `reverse` | `boolean` | Play the active clip in reverse. | [components/Animation.ts:88](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L88) |
|
|
59
|
+
| <a id="timescale"></a> `timeScale` | `number` | Playback speed multiplier (`1` = real-time). | [components/Animation.ts:90](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L90) |
|
|
60
|
+
| <a id="crossfadeduration"></a> `crossFadeDuration` | `number` | Default cross-fade duration in seconds when switching states. | [components/Animation.ts:92](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L92) |
|
|
61
|
+
| <a id="states"></a> `states` | [`AnimationStateMachine`](../../index/classes/AnimationStateMachine.md)[] | All state-machine entries authored on this entity. | [components/Animation.ts:94](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L94) |
|
|
62
|
+
| <a id="active"></a> `active` | \| [`AnimationStateMachine`](../../index/classes/AnimationStateMachine.md) \| `null` | State currently being played, or `null` if none. | [components/Animation.ts:96](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L96) |
|
|
63
|
+
| <a id="activestatename"></a> `activeStateName` | `string` \| `null` | Name of the [active](#active) state, or `null` if none. | [components/Animation.ts:98](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L98) |
|
|
64
|
+
| <a id="statemanager"></a> `stateManager` | [`AnimationStateManager`](../../index/classes/AnimationStateManager.md) | Manager that drives state transitions; mutate via [addState](#addstate)/[switchState](#switchstate). | [components/Animation.ts:100](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L100) |
|
|
65
|
+
|
|
66
|
+
## Methods
|
|
67
|
+
|
|
68
|
+
### setModelClips()
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
setModelClips(clips): void;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Defined in: [components/Animation.ts:234](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L234)
|
|
75
|
+
|
|
76
|
+
#### Parameters
|
|
77
|
+
|
|
78
|
+
| Parameter | Type |
|
|
79
|
+
| ------ | ------ |
|
|
80
|
+
| `clips` | `AnimationClip`[] |
|
|
81
|
+
|
|
82
|
+
#### Returns
|
|
83
|
+
|
|
84
|
+
`void`
|
|
85
|
+
|
|
86
|
+
***
|
|
87
|
+
|
|
88
|
+
### setImportedClips()
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
setImportedClips(clips): void;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Defined in: [components/Animation.ts:239](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L239)
|
|
95
|
+
|
|
96
|
+
#### Parameters
|
|
97
|
+
|
|
98
|
+
| Parameter | Type |
|
|
99
|
+
| ------ | ------ |
|
|
100
|
+
| `clips` | `AnimationClip`[] \| `ImportedClipEntry`[] |
|
|
101
|
+
|
|
102
|
+
#### Returns
|
|
103
|
+
|
|
104
|
+
`void`
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
108
|
+
### setExternalClipSources()
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
setExternalClipSources(sources): void;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Defined in: [components/Animation.ts:276](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L276)
|
|
115
|
+
|
|
116
|
+
#### Parameters
|
|
117
|
+
|
|
118
|
+
| Parameter | Type |
|
|
119
|
+
| ------ | ------ |
|
|
120
|
+
| `sources` | `string`[] |
|
|
121
|
+
|
|
122
|
+
#### Returns
|
|
123
|
+
|
|
124
|
+
`void`
|
|
125
|
+
|
|
126
|
+
***
|
|
127
|
+
|
|
128
|
+
### addState()
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
addState(
|
|
132
|
+
name,
|
|
133
|
+
clipRef,
|
|
134
|
+
loop?):
|
|
135
|
+
| AnimationStateMachine
|
|
136
|
+
| null;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Defined in: [components/Animation.ts:301](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L301)
|
|
140
|
+
|
|
141
|
+
#### Parameters
|
|
142
|
+
|
|
143
|
+
| Parameter | Type | Default value |
|
|
144
|
+
| ------ | ------ | ------ |
|
|
145
|
+
| `name` | `string` | `undefined` |
|
|
146
|
+
| `clipRef` | `string` | `undefined` |
|
|
147
|
+
| `loop` | `boolean` | `false` |
|
|
148
|
+
|
|
149
|
+
#### Returns
|
|
150
|
+
|
|
151
|
+
\| [`AnimationStateMachine`](../../index/classes/AnimationStateMachine.md)
|
|
152
|
+
\| `null`
|
|
153
|
+
|
|
154
|
+
***
|
|
155
|
+
|
|
156
|
+
### setStates()
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
setStates(states): void;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Defined in: [components/Animation.ts:316](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L316)
|
|
163
|
+
|
|
164
|
+
#### Parameters
|
|
165
|
+
|
|
166
|
+
| Parameter | Type |
|
|
167
|
+
| ------ | ------ |
|
|
168
|
+
| `states` | \{ `name`: `string`; `clip`: `string`; `clipId?`: `string`; `loop?`: `boolean`; \}[] |
|
|
169
|
+
|
|
170
|
+
#### Returns
|
|
171
|
+
|
|
172
|
+
`void`
|
|
173
|
+
|
|
174
|
+
***
|
|
175
|
+
|
|
176
|
+
### getStateConfigs()
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
getStateConfigs(): {
|
|
180
|
+
name: string;
|
|
181
|
+
clip: string;
|
|
182
|
+
clipId: string | null;
|
|
183
|
+
loop: boolean;
|
|
184
|
+
}[];
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Defined in: [components/Animation.ts:343](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L343)
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
\{
|
|
192
|
+
`name`: `string`;
|
|
193
|
+
`clip`: `string`;
|
|
194
|
+
`clipId`: `string` \| `null`;
|
|
195
|
+
`loop`: `boolean`;
|
|
196
|
+
\}[]
|
|
197
|
+
|
|
198
|
+
***
|
|
199
|
+
|
|
200
|
+
### setActiveState()
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
setActiveState(name, autoPlay?): boolean;
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Defined in: [components/Animation.ts:352](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L352)
|
|
207
|
+
|
|
208
|
+
#### Parameters
|
|
209
|
+
|
|
210
|
+
| Parameter | Type | Default value |
|
|
211
|
+
| ------ | ------ | ------ |
|
|
212
|
+
| `name` | `string` \| `null` | `undefined` |
|
|
213
|
+
| `autoPlay` | `boolean` | `true` |
|
|
214
|
+
|
|
215
|
+
#### Returns
|
|
216
|
+
|
|
217
|
+
`boolean`
|
|
218
|
+
|
|
219
|
+
***
|
|
220
|
+
|
|
221
|
+
### removeState()
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
removeState(name): boolean;
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Defined in: [components/Animation.ts:363](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L363)
|
|
228
|
+
|
|
229
|
+
#### Parameters
|
|
230
|
+
|
|
231
|
+
| Parameter | Type |
|
|
232
|
+
| ------ | ------ |
|
|
233
|
+
| `name` | `string` |
|
|
234
|
+
|
|
235
|
+
#### Returns
|
|
236
|
+
|
|
237
|
+
`boolean`
|
|
238
|
+
|
|
239
|
+
***
|
|
240
|
+
|
|
241
|
+
### switchState()
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
switchState(name, autoPlay?): boolean;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Defined in: [components/Animation.ts:371](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L371)
|
|
248
|
+
|
|
249
|
+
#### Parameters
|
|
250
|
+
|
|
251
|
+
| Parameter | Type | Default value |
|
|
252
|
+
| ------ | ------ | ------ |
|
|
253
|
+
| `name` | `string` | `undefined` |
|
|
254
|
+
| `autoPlay` | `boolean` | `true` |
|
|
255
|
+
|
|
256
|
+
#### Returns
|
|
257
|
+
|
|
258
|
+
`boolean`
|
|
259
|
+
|
|
260
|
+
***
|
|
261
|
+
|
|
262
|
+
### playState()
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
playState(name?): boolean;
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Defined in: [components/Animation.ts:382](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L382)
|
|
269
|
+
|
|
270
|
+
#### Parameters
|
|
271
|
+
|
|
272
|
+
| Parameter | Type |
|
|
273
|
+
| ------ | ------ |
|
|
274
|
+
| `name?` | `string` |
|
|
275
|
+
|
|
276
|
+
#### Returns
|
|
277
|
+
|
|
278
|
+
`boolean`
|
|
279
|
+
|
|
280
|
+
***
|
|
281
|
+
|
|
282
|
+
### pauseState()
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
pauseState(name?): boolean;
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Defined in: [components/Animation.ts:393](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L393)
|
|
289
|
+
|
|
290
|
+
#### Parameters
|
|
291
|
+
|
|
292
|
+
| Parameter | Type |
|
|
293
|
+
| ------ | ------ |
|
|
294
|
+
| `name?` | `string` |
|
|
295
|
+
|
|
296
|
+
#### Returns
|
|
297
|
+
|
|
298
|
+
`boolean`
|
|
299
|
+
|
|
300
|
+
***
|
|
301
|
+
|
|
302
|
+
### stopState()
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
stopState(name?): boolean;
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Defined in: [components/Animation.ts:404](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Animation.ts#L404)
|
|
309
|
+
|
|
310
|
+
#### Parameters
|
|
311
|
+
|
|
312
|
+
| Parameter | Type |
|
|
313
|
+
| ------ | ------ |
|
|
314
|
+
| `name?` | `string` |
|
|
315
|
+
|
|
316
|
+
#### Returns
|
|
317
|
+
|
|
318
|
+
`boolean`
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / AudioComponent
|
|
6
|
+
|
|
7
|
+
# Class: AudioComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Audio.ts:27](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L27)
|
|
10
|
+
|
|
11
|
+
Plays an audio clip from `path`. Supports both global stereo (`positional:
|
|
12
|
+
false`) and 3D positional audio with the configured distance model.
|
|
13
|
+
Runtime fields (`object`, `audio`, `isPlaying`, `isPaused`) are recreated
|
|
14
|
+
when the project loads and are never persisted to saved snapshots.
|
|
15
|
+
|
|
16
|
+
## Extends
|
|
17
|
+
|
|
18
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
### Constructor
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
new AudioComponent(path, options?): AudioComponent;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Defined in: [components/Audio.ts:64](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L64)
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `path` | `string` |
|
|
35
|
+
| `options` | `Partial`\<*typeof* `DEFAULT_AUDIO_OPTIONS`\> |
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`AudioComponent`
|
|
40
|
+
|
|
41
|
+
#### Overrides
|
|
42
|
+
|
|
43
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
44
|
+
|
|
45
|
+
## Properties
|
|
46
|
+
|
|
47
|
+
| Property | Type | Description | Defined in |
|
|
48
|
+
| ------ | ------ | ------ | ------ |
|
|
49
|
+
| <a id="path"></a> `path` | `string` | Source URL or `localasset://` path of the audio file. | [components/Audio.ts:29](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L29) |
|
|
50
|
+
| <a id="options"></a> `options` | \{ `autoplay`: `boolean`; `loop`: `boolean`; `pitch`: `number`; `volume`: `number`; `positional`: `boolean`; `refDistance`: `number`; `distanceModel`: `string`; `rolloffFactor`: `number`; \} | Playback options. | Field | Default | Description | |---|---|---| | `autoplay` | `false` | Start playback as soon as the clip is loaded. | | `loop` | `false` | Loop playback indefinitely. | | `pitch` | `1` | Playback rate multiplier (`1` = normal speed/pitch). | | `volume` | `1` | Linear gain in `[0, 1]`. | | `positional` | `false` | When `true`, audio is spatialized using the entity's transform. | | `refDistance` | `1` | Distance at which volume is unattenuated (positional only). | | `distanceModel` | `"inverse"` | WebAudio distance model (`linear`, `inverse`, `exponential`). | | `rolloffFactor` | `1` | How quickly volume falls off past `refDistance`. | | [components/Audio.ts:44](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L44) |
|
|
51
|
+
| `options.autoplay` | `boolean` | - | [components/Audio.ts:9](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L9) |
|
|
52
|
+
| `options.loop` | `boolean` | - | [components/Audio.ts:10](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L10) |
|
|
53
|
+
| `options.pitch` | `number` | - | [components/Audio.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L11) |
|
|
54
|
+
| `options.volume` | `number` | - | [components/Audio.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L12) |
|
|
55
|
+
| `options.positional` | `boolean` | - | [components/Audio.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L13) |
|
|
56
|
+
| `options.refDistance` | `number` | - | [components/Audio.ts:14](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L14) |
|
|
57
|
+
| `options.distanceModel` | `string` | - | [components/Audio.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L15) |
|
|
58
|
+
| `options.rolloffFactor` | `number` | - | [components/Audio.ts:16](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L16) |
|
|
59
|
+
| <a id="object"></a> `object` | `Object3D`\<`Object3DEventMap`\> \| `null` | Live three.js object hosting the audio (a parented `Audio`/`PositionalAudio`). `null` until built. | [components/Audio.ts:46](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L46) |
|
|
60
|
+
| <a id="audio"></a> `audio` | `Audio`\<`GainNode`\> \| `PositionalAudio` \| `null` | Live three.js audio source. `null` until built. Recreated when the project loads. | [components/Audio.ts:48](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L48) |
|
|
61
|
+
| <a id="isplaying"></a> `isPlaying` | `boolean` | Whether the audio should be playing. Managed by `AudioSystem` in preview. Non-enumerable — not persisted to snapshots or save data. Set via [play](#play) / [stop](#stop). | [components/Audio.ts:55](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L55) |
|
|
62
|
+
| <a id="ispaused"></a> `isPaused` | `boolean` | Whether the audio is paused mid-playback (position is preserved). Non-enumerable — not persisted to snapshots or save data. Set via [pause](#pause) / [play](#play) / [stop](#stop). | [components/Audio.ts:62](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L62) |
|
|
63
|
+
|
|
64
|
+
## Methods
|
|
65
|
+
|
|
66
|
+
### play()
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
play(): void;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Defined in: [components/Audio.ts:98](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L98)
|
|
73
|
+
|
|
74
|
+
Signals `AudioSystem` to start (or resume) playback.
|
|
75
|
+
Has no direct effect in the editor — `AudioSystem` drives the actual
|
|
76
|
+
THREE.js call in preview.
|
|
77
|
+
|
|
78
|
+
#### Returns
|
|
79
|
+
|
|
80
|
+
`void`
|
|
81
|
+
|
|
82
|
+
***
|
|
83
|
+
|
|
84
|
+
### pause()
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
pause(): void;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Defined in: [components/Audio.ts:108](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L108)
|
|
91
|
+
|
|
92
|
+
Signals `AudioSystem` to pause playback, preserving the current position.
|
|
93
|
+
Calling [play](#play) afterwards resumes from where it paused.
|
|
94
|
+
No-op if not currently playing.
|
|
95
|
+
|
|
96
|
+
#### Returns
|
|
97
|
+
|
|
98
|
+
`void`
|
|
99
|
+
|
|
100
|
+
***
|
|
101
|
+
|
|
102
|
+
### stop()
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
stop(): void;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Defined in: [components/Audio.ts:117](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Audio.ts#L117)
|
|
109
|
+
|
|
110
|
+
Signals `AudioSystem` to stop playback and reset the playback position.
|
|
111
|
+
|
|
112
|
+
#### Returns
|
|
113
|
+
|
|
114
|
+
`void`
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / CameraComponent
|
|
6
|
+
|
|
7
|
+
# Class: CameraComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Camera.ts:160](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L160)
|
|
10
|
+
|
|
11
|
+
Camera entity state. Supports perspective and orthographic projections, a
|
|
12
|
+
`3d` or `ar` runtime type, and an `isDefault` flag for the camera that the
|
|
13
|
+
preview/editor renders through. Field-of-view, near/far, ortho frustum, and
|
|
14
|
+
zoom are persisted; the live `THREE.Camera` is recreated when the project loads.
|
|
15
|
+
|
|
16
|
+
## Extends
|
|
17
|
+
|
|
18
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
### Constructor
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
new CameraComponent(payload?): CameraComponent;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Defined in: [components/Camera.ts:186](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L186)
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `payload` | [`CameraComponentOptions`](../type-aliases/CameraComponentOptions.md) |
|
|
35
|
+
|
|
36
|
+
#### Returns
|
|
37
|
+
|
|
38
|
+
`CameraComponent`
|
|
39
|
+
|
|
40
|
+
#### Overrides
|
|
41
|
+
|
|
42
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
43
|
+
|
|
44
|
+
## Properties
|
|
45
|
+
|
|
46
|
+
| Property | Type | Description | Defined in |
|
|
47
|
+
| ------ | ------ | ------ | ------ |
|
|
48
|
+
| <a id="camera"></a> `camera` | `Camera` | Live three.js camera. Recreated when the project loads to match [projection](#projection). | [components/Camera.ts:162](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L162) |
|
|
49
|
+
| <a id="type"></a> `type` | [`CameraRuntimeType`](../type-aliases/CameraRuntimeType.md) | Runtime camera mode (`3d` or `ar`). | [components/Camera.ts:164](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L164) |
|
|
50
|
+
| <a id="isdefault"></a> `isDefault` | `boolean` | When `true`, this is the active rendering camera. Only one camera per scene should be the default. | [components/Camera.ts:166](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L166) |
|
|
51
|
+
| <a id="projection"></a> `projection` | [`CameraProjection`](../type-aliases/CameraProjection.md) | Active projection model (`perspective` or `orthographic`). | [components/Camera.ts:168](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L168) |
|
|
52
|
+
| <a id="fov"></a> `fov` | `number` | Vertical field of view in **degrees**. Used when [projection](#projection) is `perspective`. | [components/Camera.ts:170](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L170) |
|
|
53
|
+
| <a id="near"></a> `near` | `number` | Near clip plane in world units. | [components/Camera.ts:172](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L172) |
|
|
54
|
+
| <a id="far"></a> `far` | `number` | Far clip plane in world units. | [components/Camera.ts:174](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L174) |
|
|
55
|
+
| <a id="left"></a> `left` | `number` | Left edge of the orthographic frustum (orthographic only). | [components/Camera.ts:176](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L176) |
|
|
56
|
+
| <a id="right"></a> `right` | `number` | Right edge of the orthographic frustum (orthographic only). | [components/Camera.ts:178](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L178) |
|
|
57
|
+
| <a id="top"></a> `top` | `number` | Top edge of the orthographic frustum (orthographic only). | [components/Camera.ts:180](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L180) |
|
|
58
|
+
| <a id="bottom"></a> `bottom` | `number` | Bottom edge of the orthographic frustum (orthographic only). | [components/Camera.ts:182](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L182) |
|
|
59
|
+
| <a id="zoom"></a> `zoom` | `number` | Zoom multiplier applied to the projection. | [components/Camera.ts:184](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Camera.ts#L184) |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / EntityType
|
|
6
|
+
|
|
7
|
+
# Class: EntityType
|
|
8
|
+
|
|
9
|
+
Defined in: [components/EntityType.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/EntityType.ts#L12)
|
|
10
|
+
|
|
11
|
+
Tags an entity with the kind it was created from (`cube`, `sphere`,
|
|
12
|
+
`model`, `directionalLight`, etc.). Factories use this to drive
|
|
13
|
+
kind-specific behavior; the editor inspector uses it to select component
|
|
14
|
+
editors.
|
|
15
|
+
|
|
16
|
+
## Extends
|
|
17
|
+
|
|
18
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
### Constructor
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
new EntityType(value): EntityType;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Defined in: [components/EntityType.ts:16](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/EntityType.ts#L16)
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `value` | \| `"model"` \| `"image"` \| `"capsule"` \| `"cylinder"` \| `"cube"` \| `"sphere"` \| `"plane"` \| `"empty"` \| `"imageTarget"` \| `"sprite"` \| `"audio"` \| `"camera"` \| `"video"` \| `"ambientLight"` \| `"directionalLight"` \| `"pointLight"` \| `"spotLight"` \| `"areaLight"` \| `"editorUtility"` |
|
|
35
|
+
|
|
36
|
+
#### Returns
|
|
37
|
+
|
|
38
|
+
`EntityType`
|
|
39
|
+
|
|
40
|
+
#### Overrides
|
|
41
|
+
|
|
42
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
43
|
+
|
|
44
|
+
## Properties
|
|
45
|
+
|
|
46
|
+
| Property | Type | Description | Defined in |
|
|
47
|
+
| ------ | ------ | ------ | ------ |
|
|
48
|
+
| <a id="value"></a> `value` | \| `"model"` \| `"image"` \| `"capsule"` \| `"cylinder"` \| `"cube"` \| `"sphere"` \| `"plane"` \| `"empty"` \| `"imageTarget"` \| `"sprite"` \| `"audio"` \| `"camera"` \| `"video"` \| `"ambientLight"` \| `"directionalLight"` \| `"pointLight"` \| `"spotLight"` \| `"areaLight"` \| `"editorUtility"` | Kind tag identifying which factory created this entity (e.g. `cube`, `directionalLight`, `model`). | [components/EntityType.ts:14](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/EntityType.ts#L14) |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / Environment
|
|
6
|
+
|
|
7
|
+
# Class: Environment
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Environment.ts:160](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Environment.ts#L160)
|
|
10
|
+
|
|
11
|
+
Scene environment settings: skybox (gradient/color/image), fog
|
|
12
|
+
(linear/exponential), and gravity vector for the physics world.
|
|
13
|
+
Singleton-style — attached to one environment entity per scene.
|
|
14
|
+
|
|
15
|
+
## Extends
|
|
16
|
+
|
|
17
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
18
|
+
|
|
19
|
+
## Constructors
|
|
20
|
+
|
|
21
|
+
### Constructor
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
new Environment(values?): Environment;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Defined in: [components/Environment.ts:164](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Environment.ts#L164)
|
|
28
|
+
|
|
29
|
+
#### Parameters
|
|
30
|
+
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| ------ | ------ |
|
|
33
|
+
| `values?` | `Partial`\<[`EnvironmentState`](../type-aliases/EnvironmentState.md)\> |
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`Environment`
|
|
38
|
+
|
|
39
|
+
#### Overrides
|
|
40
|
+
|
|
41
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
42
|
+
|
|
43
|
+
## Properties
|
|
44
|
+
|
|
45
|
+
| Property | Type | Description | Defined in |
|
|
46
|
+
| ------ | ------ | ------ | ------ |
|
|
47
|
+
| <a id="values"></a> `values` | [`EnvironmentState`](../type-aliases/EnvironmentState.md) | Aggregated environment authoring state (skybox, fog, gravity). Saved with the project. | [components/Environment.ts:162](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Environment.ts#L162) |
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / ImageComponent
|
|
6
|
+
|
|
7
|
+
# Class: ImageComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Image.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L13)
|
|
10
|
+
|
|
11
|
+
Renders a 2D image as a textured quad in the scene. Width/height are in
|
|
12
|
+
world units. Texture loading is handled by the image system, which
|
|
13
|
+
populates [ImageComponent.texture](#texture) and [ImageComponent.object](#object)
|
|
14
|
+
asynchronously.
|
|
15
|
+
|
|
16
|
+
## Extends
|
|
17
|
+
|
|
18
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
### Constructor
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
new ImageComponent(
|
|
26
|
+
path,
|
|
27
|
+
width?,
|
|
28
|
+
height?): ImageComponent;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Defined in: [components/Image.ts:25](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L25)
|
|
32
|
+
|
|
33
|
+
#### Parameters
|
|
34
|
+
|
|
35
|
+
| Parameter | Type | Default value |
|
|
36
|
+
| ------ | ------ | ------ |
|
|
37
|
+
| `path` | `string` | `undefined` |
|
|
38
|
+
| `width` | `number` | `1` |
|
|
39
|
+
| `height` | `number` | `1` |
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`ImageComponent`
|
|
44
|
+
|
|
45
|
+
#### Overrides
|
|
46
|
+
|
|
47
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
48
|
+
|
|
49
|
+
## Properties
|
|
50
|
+
|
|
51
|
+
| Property | Type | Description | Defined in |
|
|
52
|
+
| ------ | ------ | ------ | ------ |
|
|
53
|
+
| <a id="path"></a> `path` | `string` | Source URL or `localasset://` path of the image file. | [components/Image.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L15) |
|
|
54
|
+
| <a id="width"></a> `width` | `number` | Width of the rendered quad in world units. | [components/Image.ts:17](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L17) |
|
|
55
|
+
| <a id="height"></a> `height` | `number` | Height of the rendered quad in world units. | [components/Image.ts:19](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L19) |
|
|
56
|
+
| <a id="texture"></a> `texture` | `Texture` \| `null` | Loaded texture, populated asynchronously by the image system. `null` until loaded. | [components/Image.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L21) |
|
|
57
|
+
| <a id="object"></a> `object` | `Object3D`\<`Object3DEventMap`\> \| `null` | Live three.js object representing the textured quad. `null` until built. | [components/Image.ts:23](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Image.ts#L23) |
|