@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,82 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / PhysicsComponent
|
|
6
|
+
|
|
7
|
+
# Class: PhysicsComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Physics.ts:350](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L350)
|
|
10
|
+
|
|
11
|
+
Unified physics component combining a Rapier rigid body and a Rapier
|
|
12
|
+
collider into a single authoring and runtime container.
|
|
13
|
+
|
|
14
|
+
Use `values.rigidbody` to configure body type, mass, damping, locks, etc.
|
|
15
|
+
Use `values.collider` to configure collider shape, size, offset, material
|
|
16
|
+
properties, and sensor mode.
|
|
17
|
+
|
|
18
|
+
The runtime `rigidBody` and `collider` references are created by the physics
|
|
19
|
+
system when the project loads and are `null` until physics is initialized.
|
|
20
|
+
|
|
21
|
+
## Extends
|
|
22
|
+
|
|
23
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
24
|
+
|
|
25
|
+
## Constructors
|
|
26
|
+
|
|
27
|
+
### Constructor
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
new PhysicsComponent(values?): PhysicsComponent;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [components/Physics.ts:358](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L358)
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
| Parameter | Type |
|
|
38
|
+
| ------ | ------ |
|
|
39
|
+
| `values?` | \{ `rigidbody?`: `Partial`\<[`RigidbodyState`](../type-aliases/RigidbodyState.md)\>; `collider?`: `Partial`\<[`ColliderState`](../type-aliases/ColliderState.md)\>; \} |
|
|
40
|
+
| `values.rigidbody?` | `Partial`\<[`RigidbodyState`](../type-aliases/RigidbodyState.md)\> |
|
|
41
|
+
| `values.collider?` | `Partial`\<[`ColliderState`](../type-aliases/ColliderState.md)\> |
|
|
42
|
+
|
|
43
|
+
#### Returns
|
|
44
|
+
|
|
45
|
+
`PhysicsComponent`
|
|
46
|
+
|
|
47
|
+
#### Overrides
|
|
48
|
+
|
|
49
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
| Property | Type | Description | Defined in |
|
|
54
|
+
| ------ | ------ | ------ | ------ |
|
|
55
|
+
| <a id="values"></a> `values` | [`PhysicsState`](../type-aliases/PhysicsState.md) | Authoring state. Saved with the project. | [components/Physics.ts:352](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L352) |
|
|
56
|
+
| <a id="rigidbody"></a> `rigidBody` | `RigidBody` \| `null` | Live Rapier rigid body. `null` until physics is initialized. | [components/Physics.ts:354](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L354) |
|
|
57
|
+
| <a id="collider"></a> `collider` | `Collider` \| `null` | Live Rapier collider. `null` until physics is initialized. | [components/Physics.ts:356](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L356) |
|
|
58
|
+
|
|
59
|
+
## Methods
|
|
60
|
+
|
|
61
|
+
### setValues()
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
setValues(patch): void;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Defined in: [components/Physics.ts:369](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Physics.ts#L369)
|
|
68
|
+
|
|
69
|
+
Patch rigidbody and/or collider state. Each sub-object is deep-merged
|
|
70
|
+
with the current values via the respective normalizer.
|
|
71
|
+
|
|
72
|
+
#### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type |
|
|
75
|
+
| ------ | ------ |
|
|
76
|
+
| `patch` | \{ `rigidbody?`: `Partial`\<[`RigidbodyState`](../type-aliases/RigidbodyState.md)\>; `collider?`: `Partial`\<[`ColliderState`](../type-aliases/ColliderState.md)\>; \} |
|
|
77
|
+
| `patch.rigidbody?` | `Partial`\<[`RigidbodyState`](../type-aliases/RigidbodyState.md)\> |
|
|
78
|
+
| `patch.collider?` | `Partial`\<[`ColliderState`](../type-aliases/ColliderState.md)\> |
|
|
79
|
+
|
|
80
|
+
#### Returns
|
|
81
|
+
|
|
82
|
+
`void`
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / Postprocessing
|
|
6
|
+
|
|
7
|
+
# Class: Postprocessing
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Postprocessing.ts:427](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Postprocessing.ts#L427)
|
|
10
|
+
|
|
11
|
+
Postprocessing stack settings (depth-of-field, bloom, vignette, chromatic
|
|
12
|
+
aberration, noise, pixelation, tone mapping, hue/saturation, sepia, SMAA,
|
|
13
|
+
SSAO, dot-screen, glitch). The render system applies enabled effects in a
|
|
14
|
+
`postprocessing`-library composer when `postEnabled` is `true`. Singleton-
|
|
15
|
+
style — attached to one entity per scene.
|
|
16
|
+
|
|
17
|
+
## Extends
|
|
18
|
+
|
|
19
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
20
|
+
|
|
21
|
+
## Constructors
|
|
22
|
+
|
|
23
|
+
### Constructor
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
new Postprocessing(values?): Postprocessing;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Defined in: [components/Postprocessing.ts:431](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Postprocessing.ts#L431)
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
| Parameter | Type |
|
|
34
|
+
| ------ | ------ |
|
|
35
|
+
| `values?` | `Partial`\<[`PostprocessingState`](../type-aliases/PostprocessingState.md)\> |
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`Postprocessing`
|
|
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="values"></a> `values` | [`PostprocessingState`](../type-aliases/PostprocessingState.md) | Aggregated post-processing state. Saved with the project. | [components/Postprocessing.ts:429](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Postprocessing.ts#L429) |
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / ScriptComponent
|
|
6
|
+
|
|
7
|
+
# Class: ScriptComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/ScriptComponent.ts:42](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/ScriptComponent.ts#L42)
|
|
10
|
+
|
|
11
|
+
Component holding the list of [scripts](../type-aliases/ScriptEntry.md) attached to an
|
|
12
|
+
entity. Loaded from the saved project; the runtime-side fields
|
|
13
|
+
(`scriptInstance`, `scriptInstances`) are non-enumerable so they never leak
|
|
14
|
+
into save data or undo history.
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
Authored scripts subclass [Behaviour](../../Behaviour/index.md).
|
|
19
|
+
|
|
20
|
+
## Extends
|
|
21
|
+
|
|
22
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
23
|
+
|
|
24
|
+
## Constructors
|
|
25
|
+
|
|
26
|
+
### Constructor
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
new ScriptComponent(entries?): ScriptComponent;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Defined in: [components/ScriptComponent.ts:50](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/ScriptComponent.ts#L50)
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Parameter | Type | Default value |
|
|
37
|
+
| ------ | ------ | ------ |
|
|
38
|
+
| `entries` | [`ScriptEntry`](../type-aliases/ScriptEntry.md)[] | `[]` |
|
|
39
|
+
|
|
40
|
+
#### Returns
|
|
41
|
+
|
|
42
|
+
`ScriptComponent`
|
|
43
|
+
|
|
44
|
+
#### Overrides
|
|
45
|
+
|
|
46
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
47
|
+
|
|
48
|
+
## Properties
|
|
49
|
+
|
|
50
|
+
| Property | Type | Description | Defined in |
|
|
51
|
+
| ------ | ------ | ------ | ------ |
|
|
52
|
+
| <a id="entries"></a> `entries` | [`ScriptEntry`](../type-aliases/ScriptEntry.md)[] | Authored script entries attached to the entity. Each entry references a class by name plus its inspector field overrides. Saved with the project. | [components/ScriptComponent.ts:44](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/ScriptComponent.ts#L44) |
|
|
53
|
+
| <a id="scriptinstance"></a> `scriptInstance` | `unknown` | First live behaviour instance after compile/load. Non-enumerable, so it does not appear in save data. `null` when no script is loaded. | [components/ScriptComponent.ts:46](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/ScriptComponent.ts#L46) |
|
|
54
|
+
| <a id="scriptinstances"></a> `scriptInstances` | `Map`\<`number`, `unknown`\> | Map of `entityId` to its compiled behaviour instance (one entry per script bound to the entity). Non-enumerable, so it does not appear in save data. | [components/ScriptComponent.ts:48](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/ScriptComponent.ts#L48) |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / Selectable
|
|
6
|
+
|
|
7
|
+
# Class: Selectable
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Selectable.ts:9](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Selectable.ts#L9)
|
|
10
|
+
|
|
11
|
+
Toggles whether the editor selection system can pick this entity. When
|
|
12
|
+
`enabled` is `false`, the entity is excluded from raycast hit tests.
|
|
13
|
+
|
|
14
|
+
## Extends
|
|
15
|
+
|
|
16
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### Constructor
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
new Selectable(enabled?): Selectable;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Defined in: [components/Selectable.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Selectable.ts#L13)
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type | Default value |
|
|
31
|
+
| ------ | ------ | ------ |
|
|
32
|
+
| `enabled` | `boolean` | `true` |
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`Selectable`
|
|
37
|
+
|
|
38
|
+
#### Overrides
|
|
39
|
+
|
|
40
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
41
|
+
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
| Property | Type | Description | Defined in |
|
|
45
|
+
| ------ | ------ | ------ | ------ |
|
|
46
|
+
| <a id="enabled"></a> `enabled` | `boolean` | When `false`, the editor selection raycaster ignores this entity. | [components/Selectable.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Selectable.ts#L11) |
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / SelectionTransformState
|
|
6
|
+
|
|
7
|
+
# Class: SelectionTransformState
|
|
8
|
+
|
|
9
|
+
Defined in: [components/SelectionTransformState.ts:16](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/SelectionTransformState.ts#L16)
|
|
10
|
+
|
|
11
|
+
Singleton-style component (attached once to a system entity) that mirrors
|
|
12
|
+
the editor's current transform-gizmo state into the ECS world. Persisted in
|
|
13
|
+
snapshots so undo/redo restores the exact gizmo configuration.
|
|
14
|
+
|
|
15
|
+
## Extends
|
|
16
|
+
|
|
17
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
18
|
+
|
|
19
|
+
## Constructors
|
|
20
|
+
|
|
21
|
+
### Constructor
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
new SelectionTransformState(
|
|
25
|
+
transform?,
|
|
26
|
+
space?,
|
|
27
|
+
selectedEntityId?): SelectionTransformState;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Defined in: [components/SelectionTransformState.ts:24](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/SelectionTransformState.ts#L24)
|
|
31
|
+
|
|
32
|
+
#### Parameters
|
|
33
|
+
|
|
34
|
+
| Parameter | Type | Default value |
|
|
35
|
+
| ------ | ------ | ------ |
|
|
36
|
+
| `transform` | [`TransformModeValue`](../type-aliases/TransformModeValue.md) | `"translate"` |
|
|
37
|
+
| `space` | [`TransformSpaceValue`](../type-aliases/TransformSpaceValue.md) | `"world"` |
|
|
38
|
+
| `selectedEntityId` | `number` \| `null` | `null` |
|
|
39
|
+
|
|
40
|
+
#### Returns
|
|
41
|
+
|
|
42
|
+
`SelectionTransformState`
|
|
43
|
+
|
|
44
|
+
#### Overrides
|
|
45
|
+
|
|
46
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
47
|
+
|
|
48
|
+
## Properties
|
|
49
|
+
|
|
50
|
+
| Property | Type | Description | Defined in |
|
|
51
|
+
| ------ | ------ | ------ | ------ |
|
|
52
|
+
| <a id="transform"></a> `transform` | [`TransformModeValue`](../type-aliases/TransformModeValue.md) | Active gizmo mode (`translate`, `rotate`, or `scale`). | [components/SelectionTransformState.ts:18](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/SelectionTransformState.ts#L18) |
|
|
53
|
+
| <a id="space"></a> `space` | [`TransformSpaceValue`](../type-aliases/TransformSpaceValue.md) | Reference frame for the gizmo (`world` or `local`). | [components/SelectionTransformState.ts:20](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/SelectionTransformState.ts#L20) |
|
|
54
|
+
| <a id="selectedentityid"></a> `selectedEntityId` | `number` \| `null` | Currently selected entity id, or `null` if nothing is selected. | [components/SelectionTransformState.ts:22](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/SelectionTransformState.ts#L22) |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / SpriteComponent
|
|
6
|
+
|
|
7
|
+
# Class: SpriteComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Sprite.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L11)
|
|
10
|
+
|
|
11
|
+
Camera-facing 2D sprite. Unlike [ImageComponent](ImageComponent.md), sprites use
|
|
12
|
+
`THREE.Sprite` and always render as billboards.
|
|
13
|
+
|
|
14
|
+
## Extends
|
|
15
|
+
|
|
16
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### Constructor
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
new SpriteComponent(
|
|
24
|
+
path,
|
|
25
|
+
width?,
|
|
26
|
+
height?): SpriteComponent;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Defined in: [components/Sprite.ts:23](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L23)
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
| Parameter | Type | Default value |
|
|
34
|
+
| ------ | ------ | ------ |
|
|
35
|
+
| `path` | `string` | `undefined` |
|
|
36
|
+
| `width` | `number` | `1` |
|
|
37
|
+
| `height` | `number` | `1` |
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`SpriteComponent`
|
|
42
|
+
|
|
43
|
+
#### Overrides
|
|
44
|
+
|
|
45
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
46
|
+
|
|
47
|
+
## Properties
|
|
48
|
+
|
|
49
|
+
| Property | Type | Description | Defined in |
|
|
50
|
+
| ------ | ------ | ------ | ------ |
|
|
51
|
+
| <a id="path"></a> `path` | `string` | Source URL or `localasset://` path of the sprite image. | [components/Sprite.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L13) |
|
|
52
|
+
| <a id="width"></a> `width` | `number` | Width of the sprite in world units. | [components/Sprite.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L15) |
|
|
53
|
+
| <a id="height"></a> `height` | `number` | Height of the sprite in world units. | [components/Sprite.ts:17](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L17) |
|
|
54
|
+
| <a id="texture"></a> `texture` | `Texture` \| `null` | Loaded texture, populated asynchronously. `null` until loaded. | [components/Sprite.ts:19](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L19) |
|
|
55
|
+
| <a id="object"></a> `object` | `Sprite`\<`Object3DEventMap`\> \| `null` | Live `THREE.Sprite` placed in the scene. `null` until built. | [components/Sprite.ts:21](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Sprite.ts#L21) |
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / TransformComponent
|
|
6
|
+
|
|
7
|
+
# Class: TransformComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Transform.ts:50](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L50)
|
|
10
|
+
|
|
11
|
+
Position, rotation, and scale of an entity in its parent's local space.
|
|
12
|
+
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
Rotation is stored in **radians** (Euler XYZ). The editor inspector converts
|
|
16
|
+
to/from degrees for display — do not store degrees in this component.
|
|
17
|
+
Mutations should go through the `setPosition` / `setRotation` / `setScale`
|
|
18
|
+
helpers so dependent systems pick up the change.
|
|
19
|
+
|
|
20
|
+
## Extends
|
|
21
|
+
|
|
22
|
+
- [`Component`](../../Component/classes/Component.md)
|
|
23
|
+
|
|
24
|
+
## Constructors
|
|
25
|
+
|
|
26
|
+
### Constructor
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
new TransformComponent(data?): TransformComponent;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Defined in: [components/Transform.ts:58](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L58)
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Parameter | Type |
|
|
37
|
+
| ------ | ------ |
|
|
38
|
+
| `data` | [`TransformData`](../type-aliases/TransformData.md) |
|
|
39
|
+
|
|
40
|
+
#### Returns
|
|
41
|
+
|
|
42
|
+
`TransformComponent`
|
|
43
|
+
|
|
44
|
+
#### Overrides
|
|
45
|
+
|
|
46
|
+
[`Component`](../../Component/classes/Component.md).[`constructor`](../../Component/classes/Component.md#constructor)
|
|
47
|
+
|
|
48
|
+
## Properties
|
|
49
|
+
|
|
50
|
+
| Property | Type | Description | Defined in |
|
|
51
|
+
| ------ | ------ | ------ | ------ |
|
|
52
|
+
| <a id="position"></a> `position` | [`Vec3`](../type-aliases/Vec3.md) | Local position relative to the parent (or world if no parent). | [components/Transform.ts:52](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L52) |
|
|
53
|
+
| <a id="rotation"></a> `rotation` | [`Vec3`](../type-aliases/Vec3.md) | Local rotation as Euler XYZ in **radians**. | [components/Transform.ts:54](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L54) |
|
|
54
|
+
| <a id="scale"></a> `scale` | [`Vec3`](../type-aliases/Vec3.md) | Local scale factors per axis (`1` = identity). | [components/Transform.ts:56](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L56) |
|
|
55
|
+
|
|
56
|
+
## Methods
|
|
57
|
+
|
|
58
|
+
### toPositionVector3()
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
toPositionVector3(target?): Vector3;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Defined in: [components/Transform.ts:84](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L84)
|
|
65
|
+
|
|
66
|
+
#### Parameters
|
|
67
|
+
|
|
68
|
+
| Parameter | Type |
|
|
69
|
+
| ------ | ------ |
|
|
70
|
+
| `target` | `Vector3` |
|
|
71
|
+
|
|
72
|
+
#### Returns
|
|
73
|
+
|
|
74
|
+
`Vector3`
|
|
75
|
+
|
|
76
|
+
***
|
|
77
|
+
|
|
78
|
+
### toRotationEuler()
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
toRotationEuler(target?, order?): Euler;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Defined in: [components/Transform.ts:88](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L88)
|
|
85
|
+
|
|
86
|
+
#### Parameters
|
|
87
|
+
|
|
88
|
+
| Parameter | Type | Default value |
|
|
89
|
+
| ------ | ------ | ------ |
|
|
90
|
+
| `target` | `Euler` | `...` |
|
|
91
|
+
| `order` | `EulerOrder` | `"XYZ"` |
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Euler`
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### toRotationQuaternion()
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
toRotationQuaternion(target?, order?): Quaternion;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Defined in: [components/Transform.ts:95](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L95)
|
|
106
|
+
|
|
107
|
+
#### Parameters
|
|
108
|
+
|
|
109
|
+
| Parameter | Type | Default value |
|
|
110
|
+
| ------ | ------ | ------ |
|
|
111
|
+
| `target` | `Quaternion` | `...` |
|
|
112
|
+
| `order` | `EulerOrder` | `"XYZ"` |
|
|
113
|
+
|
|
114
|
+
#### Returns
|
|
115
|
+
|
|
116
|
+
`Quaternion`
|
|
117
|
+
|
|
118
|
+
***
|
|
119
|
+
|
|
120
|
+
### toScaleVector3()
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
toScaleVector3(target?): Vector3;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Defined in: [components/Transform.ts:108](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L108)
|
|
127
|
+
|
|
128
|
+
#### Parameters
|
|
129
|
+
|
|
130
|
+
| Parameter | Type |
|
|
131
|
+
| ------ | ------ |
|
|
132
|
+
| `target` | `Vector3` |
|
|
133
|
+
|
|
134
|
+
#### Returns
|
|
135
|
+
|
|
136
|
+
`Vector3`
|
|
137
|
+
|
|
138
|
+
***
|
|
139
|
+
|
|
140
|
+
### setPosition()
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
setPosition(input): this;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Defined in: [components/Transform.ts:112](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L112)
|
|
147
|
+
|
|
148
|
+
#### Parameters
|
|
149
|
+
|
|
150
|
+
| Parameter | Type |
|
|
151
|
+
| ------ | ------ |
|
|
152
|
+
| `input` | `TransformInput` |
|
|
153
|
+
|
|
154
|
+
#### Returns
|
|
155
|
+
|
|
156
|
+
`this`
|
|
157
|
+
|
|
158
|
+
***
|
|
159
|
+
|
|
160
|
+
### setScale()
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
setScale(input): this;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Defined in: [components/Transform.ts:120](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L120)
|
|
167
|
+
|
|
168
|
+
#### Parameters
|
|
169
|
+
|
|
170
|
+
| Parameter | Type |
|
|
171
|
+
| ------ | ------ |
|
|
172
|
+
| `input` | `TransformInput` |
|
|
173
|
+
|
|
174
|
+
#### Returns
|
|
175
|
+
|
|
176
|
+
`this`
|
|
177
|
+
|
|
178
|
+
***
|
|
179
|
+
|
|
180
|
+
### setRotation()
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
setRotation(input, order?): this;
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Defined in: [components/Transform.ts:128](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Transform.ts#L128)
|
|
187
|
+
|
|
188
|
+
#### Parameters
|
|
189
|
+
|
|
190
|
+
| Parameter | Type | Default value |
|
|
191
|
+
| ------ | ------ | ------ |
|
|
192
|
+
| `input` | `TransformInput` | `undefined` |
|
|
193
|
+
| `order` | `EulerOrder` | `"XYZ"` |
|
|
194
|
+
|
|
195
|
+
#### Returns
|
|
196
|
+
|
|
197
|
+
`this`
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
[**@relu-interactives/spatial-ecs**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@relu-interactives/spatial-ecs](../../index.md) / [components](../index.md) / VideoComponent
|
|
6
|
+
|
|
7
|
+
# Class: VideoComponent
|
|
8
|
+
|
|
9
|
+
Defined in: [components/Video.ts:37](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L37)
|
|
10
|
+
|
|
11
|
+
Plays a video file as a texture on a quad. Supports green-screen keying
|
|
12
|
+
(`isGreenScreen`, `backgroundColor`, `similarity`, `smoothness`, `spill`).
|
|
13
|
+
The video element, texture, and material are runtime-only and re-created
|
|
14
|
+
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 VideoComponent(path, options?): VideoComponent;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Defined in: [components/Video.ts:90](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L90)
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `path` | `string` |
|
|
35
|
+
| `options` | `Partial`\<*typeof* `DEFAULT_VIDEO_OPTIONS`\> |
|
|
36
|
+
|
|
37
|
+
#### Returns
|
|
38
|
+
|
|
39
|
+
`VideoComponent`
|
|
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 video file. | [components/Video.ts:39](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L39) |
|
|
50
|
+
| <a id="options"></a> `options` | \{ `autoplay`: `boolean`; `loop`: `boolean`; `volume`: `number`; `width`: `number`; `height`: `number`; `isGreenScreen`: `boolean`; `backgroundColor`: `string`; `similarity`: `number`; `smoothness`: `number`; `spill`: `number`; `positional`: `boolean`; `refDistance`: `number`; `distanceModel`: `string`; `rolloffFactor`: `number`; \} | 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. | | [components/Video.ts:60](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L60) |
|
|
51
|
+
| `options.autoplay` | `boolean` | - | [components/Video.ts:9](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L9) |
|
|
52
|
+
| `options.loop` | `boolean` | - | [components/Video.ts:10](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L10) |
|
|
53
|
+
| `options.volume` | `number` | - | [components/Video.ts:11](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L11) |
|
|
54
|
+
| `options.width` | `number` | - | [components/Video.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L12) |
|
|
55
|
+
| `options.height` | `number` | - | [components/Video.ts:13](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L13) |
|
|
56
|
+
| `options.isGreenScreen` | `boolean` | - | [components/Video.ts:14](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L14) |
|
|
57
|
+
| `options.backgroundColor` | `string` | - | [components/Video.ts:15](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L15) |
|
|
58
|
+
| `options.similarity` | `number` | - | [components/Video.ts:16](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L16) |
|
|
59
|
+
| `options.smoothness` | `number` | - | [components/Video.ts:17](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L17) |
|
|
60
|
+
| `options.spill` | `number` | - | [components/Video.ts:18](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L18) |
|
|
61
|
+
| `options.positional` | `boolean` | When `true`, the video's audio stream is spatialized using the entity's transform. | [components/Video.ts:20](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L20) |
|
|
62
|
+
| `options.refDistance` | `number` | Distance at which volume is unattenuated (positional only). | [components/Video.ts:22](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L22) |
|
|
63
|
+
| `options.distanceModel` | `string` | WebAudio distance model (`linear`, `inverse`, `exponential`). Positional only. | [components/Video.ts:24](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L24) |
|
|
64
|
+
| `options.rolloffFactor` | `number` | How quickly volume falls off past `refDistance`. Positional only. | [components/Video.ts:26](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L26) |
|
|
65
|
+
| <a id="object"></a> `object` | `Object3D`\<`Object3DEventMap`\> \| `null` | Live three.js object hosting the video quad. `null` until built. | [components/Video.ts:62](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L62) |
|
|
66
|
+
| <a id="videoelement"></a> `videoElement` | `HTMLVideoElement` \| `null` | Underlying HTML video element. `null` until built. | [components/Video.ts:64](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L64) |
|
|
67
|
+
| <a id="texture"></a> `texture` | `VideoTexture` \| `null` | Three.js texture sampling the video element. `null` until built. | [components/Video.ts:66](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L66) |
|
|
68
|
+
| <a id="material"></a> `material` | `Material` \| `null` | Material rendering the video texture (with green-screen shader when enabled). `null` until built. | [components/Video.ts:68](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L68) |
|
|
69
|
+
| <a id="audionode"></a> `audioNode` | `Audio`\<`GainNode`\> \| `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. | [components/Video.ts:74](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L74) |
|
|
70
|
+
| <a id="isplaying"></a> `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](#play) / [stop](#stop). | [components/Video.ts:81](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L81) |
|
|
71
|
+
| <a id="ispaused"></a> `isPaused` | `boolean` | Whether the video 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/Video.ts:88](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L88) |
|
|
72
|
+
|
|
73
|
+
## Methods
|
|
74
|
+
|
|
75
|
+
### play()
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
play(): void;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Defined in: [components/Video.ts:127](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L127)
|
|
82
|
+
|
|
83
|
+
Signals `VideoSystem` to start (or resume) playback.
|
|
84
|
+
Has no direct effect in the editor — `VideoSystem` drives the actual
|
|
85
|
+
HTML video element call in preview.
|
|
86
|
+
|
|
87
|
+
#### Returns
|
|
88
|
+
|
|
89
|
+
`void`
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### pause()
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
pause(): void;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Defined in: [components/Video.ts:137](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L137)
|
|
100
|
+
|
|
101
|
+
Signals `VideoSystem` to pause playback, preserving the current position.
|
|
102
|
+
Calling [play](#play) afterwards resumes from where it paused.
|
|
103
|
+
No-op if not currently playing.
|
|
104
|
+
|
|
105
|
+
#### Returns
|
|
106
|
+
|
|
107
|
+
`void`
|
|
108
|
+
|
|
109
|
+
***
|
|
110
|
+
|
|
111
|
+
### stop()
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
stop(): void;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Defined in: [components/Video.ts:146](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/d7abe871a8dd71d2e6e1dff3235da21d5376bd8f/core/components/Video.ts#L146)
|
|
118
|
+
|
|
119
|
+
Signals `VideoSystem` to stop playback and reset the playback position.
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
`void`
|