@relu-interactives/spatial-ecs 0.2.25 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-J6736FFO.js → chunk-7BPHZWQ6.js} +45 -13
- package/dist/chunk-7BPHZWQ6.js.map +1 -0
- package/dist/{chunk-3P3ZBP7K.js → chunk-7JFSEV7A.js} +5 -4
- package/dist/chunk-7JFSEV7A.js.map +1 -0
- package/dist/{chunk-RJ4J5UEX.js → chunk-AT5SPSPM.js} +4 -4
- package/dist/{chunk-RJ4J5UEX.js.map → chunk-AT5SPSPM.js.map} +1 -1
- package/dist/{chunk-XFD74BQL.js → chunk-PZ4CAALA.js} +3 -3
- package/dist/{chunk-XFD74BQL.js.map → chunk-PZ4CAALA.js.map} +1 -1
- package/dist/components/index.cjs +43 -11
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/docs/api/Behaviour/classes/Behaviour.md +98 -51
- package/dist/docs/api/Component/classes/Component.md +4 -1
- package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
- package/dist/docs/api/components/classes/AudioComponent.md +19 -19
- package/dist/docs/api/components/classes/CameraComponent.md +14 -14
- package/dist/docs/api/components/classes/EntityType.md +4 -4
- package/dist/docs/api/components/classes/Environment.md +3 -3
- package/dist/docs/api/components/classes/ImageComponent.md +7 -7
- package/dist/docs/api/components/classes/ImageTarget.md +7 -7
- package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
- package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
- package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
- package/dist/docs/api/components/classes/LightComponent.md +6 -6
- package/dist/docs/api/components/classes/MaterialComponent.md +57 -11
- package/dist/docs/api/components/classes/MeshComponent.md +3 -3
- package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
- package/dist/docs/api/components/classes/ModelComponent.md +4 -4
- package/dist/docs/api/components/classes/Name.md +3 -3
- package/dist/docs/api/components/classes/Object3DRef.md +4 -4
- package/dist/docs/api/components/classes/ParentId.md +3 -3
- package/dist/docs/api/components/classes/PhysicsComponent.md +12 -13
- package/dist/docs/api/components/classes/Postprocessing.md +3 -3
- package/dist/docs/api/components/classes/PrefabInstance.md +80 -0
- package/dist/docs/api/components/classes/PrefabNode.md +54 -0
- package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
- package/dist/docs/api/components/classes/ScriptObjectComponent.md +55 -0
- package/dist/docs/api/components/classes/Selectable.md +3 -3
- package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
- package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
- package/dist/docs/api/components/classes/TransformComponent.md +12 -12
- package/dist/docs/api/components/classes/VideoComponent.md +28 -28
- package/dist/docs/api/components/functions/defaultMaterialValue.md +17 -0
- package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
- package/dist/docs/api/components/functions/setPhysicsLiveRef.md +34 -0
- package/dist/docs/api/components/index.md +8 -1
- package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
- package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
- package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
- package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
- package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
- package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
- package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +7 -7
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentState.md +5 -5
- package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
- package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
- package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
- package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
- package/dist/docs/api/components/type-aliases/LightValueState.md +11 -11
- package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
- package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
- package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
- package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
- package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
- package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
- package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
- package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
- package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -10
- package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +20 -0
- package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +13 -0
- package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
- package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
- package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
- package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
- package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
- package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
- package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
- package/dist/docs/api/index/classes/AudioSystem.md +4 -4
- package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/InputSystem.md +33 -33
- package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
- package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
- package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
- package/dist/docs/api/index/classes/ObjectManagementSystem.md +14 -14
- package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
- package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/RenderSystem.md +3 -3
- package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +5 -5
- package/dist/docs/api/index/classes/ScriptObject.md +156 -0
- package/dist/docs/api/index/classes/ScriptObjectSystem.md +129 -0
- package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/VideoSystem.md +4 -4
- package/dist/docs/api/index/classes/World.md +183 -86
- package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +32 -0
- package/dist/docs/api/index/functions/buildComponentValueMaps.md +23 -0
- package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +25 -0
- package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +23 -0
- package/dist/docs/api/index/functions/canonicalizeComponentValue.md +38 -0
- package/dist/docs/api/index/functions/clearModelCache.md +26 -0
- package/dist/docs/api/index/functions/clearPrefabCache.md +25 -0
- package/dist/docs/api/index/functions/collectDiffPaths.md +38 -0
- package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +27 -0
- package/dist/docs/api/index/functions/collectEntitySubtree.md +29 -0
- package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +26 -0
- package/dist/docs/api/index/functions/computeInstanceOverrides.md +44 -0
- package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
- package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
- package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
- package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
- package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createLightComponent.md +1 -1
- package/dist/docs/api/index/functions/createMaterialComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
- package/dist/docs/api/index/functions/createModelComponent.md +1 -1
- package/dist/docs/api/index/functions/createNameComponent.md +1 -1
- package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
- package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
- package/dist/docs/api/index/functions/createPhysicsComponent.md +2 -4
- package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptObjectComponent.md +28 -0
- package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
- package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
- package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
- package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
- package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
- package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +28 -0
- package/dist/docs/api/index/functions/despawnPrefab.md +32 -0
- package/dist/docs/api/index/functions/encodeOverride.md +28 -0
- package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +25 -0
- package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +28 -0
- package/dist/docs/api/index/functions/groupOverridePaths.md +25 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +4 -2
- package/dist/docs/api/index/functions/indexSnapshotByEntity.md +25 -0
- package/dist/docs/api/index/functions/instantiateSubtree.md +32 -0
- package/dist/docs/api/index/functions/loadPrefab.md +28 -0
- package/dist/docs/api/index/functions/loadSharedGltf.md +29 -0
- package/dist/docs/api/index/functions/mergeComponentValue.md +32 -0
- package/dist/docs/api/index/functions/parseOverride.md +34 -0
- package/dist/docs/api/index/functions/parsePrefabAsset.md +25 -0
- package/dist/docs/api/index/functions/prefabFileVersionFor.md +25 -0
- package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
- package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
- package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +46 -0
- package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +17 -0
- package/dist/docs/api/index/functions/restoreComponentState.md +34 -0
- package/dist/docs/api/index/functions/restorePostCreateComponents.md +36 -0
- package/dist/docs/api/index/functions/serializeEntitySubtree.md +35 -0
- package/dist/docs/api/index/functions/setDracoDecoderPath.md +30 -0
- package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +30 -0
- package/dist/docs/api/index/functions/spawnPrefab.md +36 -0
- package/dist/docs/api/index/index.md +65 -0
- package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
- package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
- package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
- package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +23 -0
- package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
- package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +69 -0
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +2 -1
- package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
- package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
- package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +7 -5
- package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +23 -0
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
- package/dist/docs/api/index/type-aliases/ModuleLoader.md +25 -0
- package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
- package/dist/docs/api/index/type-aliases/NestedRegion.md +27 -0
- package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +30 -0
- package/dist/docs/api/index/type-aliases/NodeMaps.md +25 -0
- package/dist/docs/api/index/type-aliases/PrefabAsset.md +32 -0
- package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +21 -0
- package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
- package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +25 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +19 -0
- package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +43 -0
- package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +19 -0
- package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
- package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
- package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +13 -0
- package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +15 -0
- package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +16 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +13 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +15 -0
- package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +15 -0
- package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +17 -0
- package/dist/docs/api/typedoc-sidebar.json +1 -1
- package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
- package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
- package/dist/docs/api/types/type-aliases/ComponentKind.md +2 -1
- package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
- package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
- package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
- package/dist/docs/api/types/type-aliases/EcsEntityKind.md +3 -2
- package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
- package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
- package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
- package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
- package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
- package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
- package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
- package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
- package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
- package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
- package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
- package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
- package/dist/docs/guide/components/_sidebar.json +4 -0
- package/dist/docs/guide/components/material.md +1 -0
- package/dist/docs/guide/components/script-object.md +32 -0
- package/dist/factories/index.cjs +43 -11
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.js +3 -3
- package/dist/index.cjs +44 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/systems/index.cjs +44 -11
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.js +3 -3
- package/package.json +4 -4
- package/dist/chunk-3P3ZBP7K.js.map +0 -1
- package/dist/chunk-J6736FFO.js.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AnimationComponent, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, defaultMaterialValue, normalizePhysicsState, setPhysicsLiveRef } from '../chunk-
|
|
1
|
+
export { AnimationComponent, AudioComponent, CameraComponent, DEFAULT_COLLIDER_STATE, DEFAULT_ENVIRONMENT_STATE, DEFAULT_INSTANCED_MESH_PARAMETERS, DEFAULT_INSTANCE_TRANSFORM, DEFAULT_MESH_GEOMETRY_PARAMETERS, DEFAULT_PHYSICS_STATE, DEFAULT_POSTPROCESSING_STATE, DEFAULT_RIGIDBODY_STATE, EntityType, Environment, ImageComponent, ImageTarget, ImageTargetAnchor, InstanceSlotComponent, InstancedMeshComponent, LightComponent, MaterialComponent, MeshComponent, MeshGeometryComponent, ModelComponent, Name, Object3DRef, ParentId, PhysicsComponent, Postprocessing, PrefabInstance, PrefabNode, ScriptComponent, ScriptObjectComponent, Selectable, SelectionTransformState, SpriteComponent, TransformComponent, VideoComponent, defaultMaterialValue, normalizePhysicsState, setPhysicsLiveRef } from '../chunk-7BPHZWQ6.js';
|
|
2
2
|
import '../chunk-OY7ZODZP.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Behaviour
|
|
8
8
|
|
|
9
|
-
Defined in: [Behaviour.ts:
|
|
9
|
+
Defined in: [Behaviour.ts:64](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L64)
|
|
10
10
|
|
|
11
11
|
Base class for all user-authored scripts attached to an entity through a
|
|
12
12
|
`ScriptComponent`. Subclass `Behaviour` to drive per-frame logic on a single
|
|
@@ -20,15 +20,10 @@ order: [Behaviour.init](#init) (first frame only) → [Behaviour.onUpdate](#onup
|
|
|
20
20
|
Override [Behaviour.onUpdate](#onupdate) for per-frame logic — never override
|
|
21
21
|
[Behaviour.update](#update), which is the engine-managed entry point.
|
|
22
22
|
|
|
23
|
-
**Editor
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
via [World.getScene](../../index/classes/World.md#getscene), [World.getCamera](../../index/classes/World.md#getcamera), and
|
|
28
|
-
[World.getRenderer](../../index/classes/World.md#getrenderer) — useful for custom shaders, procedural geometry,
|
|
29
|
-
grass, and any Three.js feature the editor's object palette does not expose.
|
|
30
|
-
Avoid mutating ECS component state every frame in editor mode, as it creates
|
|
31
|
-
undo history entries on every tick.
|
|
23
|
+
**Editor vs runtime**: `Behaviour` subclasses run ONLY at preview/runtime —
|
|
24
|
+
they never execute in the editor. For a visual that must render and animate
|
|
25
|
+
inside the editor (custom shaders, procedural geometry, grass, anything the
|
|
26
|
+
object palette can't produce), use [ScriptObject](../../index/classes/ScriptObject.md) instead.
|
|
32
27
|
|
|
33
28
|
The runtime recognizes a script by its **default export** plus the
|
|
34
29
|
inherited static marker `__reluBehaviourClass`. Do not override the marker.
|
|
@@ -76,7 +71,7 @@ new Behaviour(
|
|
|
76
71
|
component): Behaviour;
|
|
77
72
|
```
|
|
78
73
|
|
|
79
|
-
Defined in: [Behaviour.ts:
|
|
74
|
+
Defined in: [Behaviour.ts:122](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L122)
|
|
80
75
|
|
|
81
76
|
Engine-managed constructor. Hosts (`ScriptBehaviourSystem`) instantiate
|
|
82
77
|
subclasses with the owning world, the entity id, and the script's `data`
|
|
@@ -98,13 +93,13 @@ payload. User code should not call this directly.
|
|
|
98
93
|
|
|
99
94
|
| Property | Type | Default value | Description | Defined in |
|
|
100
95
|
| ------ | ------ | ------ | ------ | ------ |
|
|
101
|
-
| <a id="data"></a> `data` | \| [`Component`](../../Component/classes/Component.md) \| `Record`\<`string`, `unknown`\> | `undefined` | Inspector-bound payload from the entity's `ScriptComponent`. Override the type on subclasses with `declare data: MyDataShape` to get type safety inside hooks. Saved with the project so values persist across reloads. | [Behaviour.ts:
|
|
102
|
-
| <a id="entityid"></a> `entityId` | `number` | `undefined` | Numeric id of the entity this script is attached to. | [Behaviour.ts:
|
|
103
|
-
| <a id="entity"></a> `entity` | `WorldEntityView` | `undefined` | View of the owning entity (id + components) at construction time. | [Behaviour.ts:
|
|
104
|
-
| <a id="threeref"></a> `threeRef` | [`Object3DRef`](../../components/classes/Object3DRef.md) | `undefined` | Live three.js object wrapper for the entity. May be `null` for entities with no scene presence; helpers on this class return `null` in that case. | [Behaviour.ts:
|
|
105
|
-
| <a id="transform"></a> `transform` | [`TransformComponent`](../../components/classes/TransformComponent.md) | `undefined` | The entity's [TransformComponent](../../components/classes/TransformComponent.md). Mutating `position`, `rotation`, or `scale` here is picked up the same frame by `TransformSyncSystem`. | [Behaviour.ts:
|
|
106
|
-
| <a id="world"></a> `world` | [`World`](../../index/classes/World.md) | `undefined` | The owning [World](../../index/classes/World.md). Refreshed each frame in [Behaviour.update](#update). Use it to query other entities or components. | [Behaviour.ts:
|
|
107
|
-
| <a id="deltatime"></a> `deltaTime` | `number` | `0` | Seconds elapsed since the last frame. Set by the engine before each [Behaviour.onUpdate](#onupdate). | [Behaviour.ts:
|
|
96
|
+
| <a id="data"></a> `data` | \| [`Component`](../../Component/classes/Component.md) \| `Record`\<`string`, `unknown`\> | `undefined` | Inspector-bound payload from the entity's `ScriptComponent`. Override the type on subclasses with `declare data: MyDataShape` to get type safety inside hooks. Saved with the project so values persist across reloads. | [Behaviour.ts:80](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L80) |
|
|
97
|
+
| <a id="entityid"></a> `entityId` | `number` | `undefined` | Numeric id of the entity this script is attached to. | [Behaviour.ts:83](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L83) |
|
|
98
|
+
| <a id="entity"></a> `entity` | `WorldEntityView` | `undefined` | View of the owning entity (id + components) at construction time. | [Behaviour.ts:86](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L86) |
|
|
99
|
+
| <a id="threeref"></a> `threeRef` | [`Object3DRef`](../../components/classes/Object3DRef.md) | `undefined` | Live three.js object wrapper for the entity. May be `null` for entities with no scene presence; helpers on this class return `null` in that case. | [Behaviour.ts:92](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L92) |
|
|
100
|
+
| <a id="transform"></a> `transform` | [`TransformComponent`](../../components/classes/TransformComponent.md) | `undefined` | The entity's [TransformComponent](../../components/classes/TransformComponent.md). Mutating `position`, `rotation`, or `scale` here is picked up the same frame by `TransformSyncSystem`. | [Behaviour.ts:98](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L98) |
|
|
101
|
+
| <a id="world"></a> `world` | [`World`](../../index/classes/World.md) | `undefined` | The owning [World](../../index/classes/World.md). Refreshed each frame in [Behaviour.update](#update). Use it to query other entities or components. | [Behaviour.ts:104](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L104) |
|
|
102
|
+
| <a id="deltatime"></a> `deltaTime` | `number` | `0` | Seconds elapsed since the last frame. Set by the engine before each [Behaviour.onUpdate](#onupdate). | [Behaviour.ts:110](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L110) |
|
|
108
103
|
|
|
109
104
|
## Methods
|
|
110
105
|
|
|
@@ -114,7 +109,7 @@ payload. User code should not call this directly.
|
|
|
114
109
|
update(world, deltaTime): void;
|
|
115
110
|
```
|
|
116
111
|
|
|
117
|
-
Defined in: [Behaviour.ts:
|
|
112
|
+
Defined in: [Behaviour.ts:146](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L146)
|
|
118
113
|
|
|
119
114
|
Engine-managed per-frame entry point. Refreshes [Behaviour.deltaTime](#deltatime)
|
|
120
115
|
and delegates to [Behaviour.onUpdate](#onupdate).
|
|
@@ -149,7 +144,7 @@ CustomEcsSystem.update
|
|
|
149
144
|
optional dispose(world): void;
|
|
150
145
|
```
|
|
151
146
|
|
|
152
|
-
Defined in: [Behaviour.ts:
|
|
147
|
+
Defined in: [Behaviour.ts:158](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L158)
|
|
153
148
|
|
|
154
149
|
Optional cleanup hook invoked when the script is detached or the entity
|
|
155
150
|
is destroyed. Override to release timers, listeners, or other resources.
|
|
@@ -172,13 +167,75 @@ CustomEcsSystem.dispose
|
|
|
172
167
|
|
|
173
168
|
***
|
|
174
169
|
|
|
170
|
+
### spawnPrefab()
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
spawnPrefab(source, options?): Promise<number>;
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Defined in: [Behaviour.ts:181](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L181)
|
|
177
|
+
|
|
178
|
+
Instantiate a prefab asset into the world at runtime.
|
|
179
|
+
|
|
180
|
+
`source` is typically an `AssetInput` field from this script's `data`
|
|
181
|
+
(drag a `.prefab` from the asset browser onto the field in the editor),
|
|
182
|
+
a URL string, or a pre-loaded `PrefabAsset`. Resolves with the new root
|
|
183
|
+
entity id.
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
data = { enemyPrefab: { path: "", type: "prefab" } };
|
|
187
|
+
async onUpdate() {
|
|
188
|
+
if (shouldSpawn) {
|
|
189
|
+
const id = await this.spawnPrefab(this.data.enemyPrefab, {
|
|
190
|
+
position: { x: 0, y: 0, z: -5 },
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Parameters
|
|
197
|
+
|
|
198
|
+
| Parameter | Type |
|
|
199
|
+
| ------ | ------ |
|
|
200
|
+
| `source` | [`SpawnPrefabSource`](../../index/type-aliases/SpawnPrefabSource.md) |
|
|
201
|
+
| `options?` | [`SpawnPrefabOptions`](../../index/type-aliases/SpawnPrefabOptions.md) |
|
|
202
|
+
|
|
203
|
+
#### Returns
|
|
204
|
+
|
|
205
|
+
`Promise`\<`number`\>
|
|
206
|
+
|
|
207
|
+
***
|
|
208
|
+
|
|
209
|
+
### despawn()
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
despawn(rootEntityId): number;
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Defined in: [Behaviour.ts:192](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L192)
|
|
216
|
+
|
|
217
|
+
Remove a spawned prefab instance (the root entity and all descendants).
|
|
218
|
+
Returns the number of entities removed.
|
|
219
|
+
|
|
220
|
+
#### Parameters
|
|
221
|
+
|
|
222
|
+
| Parameter | Type |
|
|
223
|
+
| ------ | ------ |
|
|
224
|
+
| `rootEntityId` | `number` |
|
|
225
|
+
|
|
226
|
+
#### Returns
|
|
227
|
+
|
|
228
|
+
`number`
|
|
229
|
+
|
|
230
|
+
***
|
|
231
|
+
|
|
175
232
|
### getWorldPosition()
|
|
176
233
|
|
|
177
234
|
```ts
|
|
178
235
|
getWorldPosition(): Vector3 | null;
|
|
179
236
|
```
|
|
180
237
|
|
|
181
|
-
Defined in: [Behaviour.ts:
|
|
238
|
+
Defined in: [Behaviour.ts:200](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L200)
|
|
182
239
|
|
|
183
240
|
Returns the entity's world-space position as a new `THREE.Vector3`, or
|
|
184
241
|
`null` if the entity has no scene presence.
|
|
@@ -195,7 +252,7 @@ Returns the entity's world-space position as a new `THREE.Vector3`, or
|
|
|
195
252
|
getWorldDirection(): Vector3 | null;
|
|
196
253
|
```
|
|
197
254
|
|
|
198
|
-
Defined in: [Behaviour.ts:
|
|
255
|
+
Defined in: [Behaviour.ts:215](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L215)
|
|
199
256
|
|
|
200
257
|
Returns the entity's forward direction in world space (the +Z axis of its
|
|
201
258
|
world matrix), or `null` if the entity has no scene presence.
|
|
@@ -212,7 +269,7 @@ world matrix), or `null` if the entity has no scene presence.
|
|
|
212
269
|
directionTo(targetPosition): Vector3 | null;
|
|
213
270
|
```
|
|
214
271
|
|
|
215
|
-
Defined in: [Behaviour.ts:
|
|
272
|
+
Defined in: [Behaviour.ts:232](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L232)
|
|
216
273
|
|
|
217
274
|
Returns a unit vector pointing from this entity toward the given world
|
|
218
275
|
position, or `null` if the entity has no scene presence.
|
|
@@ -235,7 +292,7 @@ position, or `null` if the entity has no scene presence.
|
|
|
235
292
|
distanceTo(targetPosition): number | null;
|
|
236
293
|
```
|
|
237
294
|
|
|
238
|
-
Defined in: [Behaviour.ts:
|
|
295
|
+
Defined in: [Behaviour.ts:247](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L247)
|
|
239
296
|
|
|
240
297
|
Returns the world-space distance from this entity to the given position,
|
|
241
298
|
or `null` if the entity has no scene presence.
|
|
@@ -258,7 +315,7 @@ or `null` if the entity has no scene presence.
|
|
|
258
315
|
lerpTo(targetPosition, alpha): void;
|
|
259
316
|
```
|
|
260
317
|
|
|
261
|
-
Defined in: [Behaviour.ts:
|
|
318
|
+
Defined in: [Behaviour.ts:265](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L265)
|
|
262
319
|
|
|
263
320
|
Linearly interpolates the entity's position toward `targetPosition` and
|
|
264
321
|
writes the result back through [TransformComponent](../../components/classes/TransformComponent.md). No-op if the
|
|
@@ -283,7 +340,7 @@ entity has no scene presence.
|
|
|
283
340
|
slerpTo(targetRotation, alpha): void;
|
|
284
341
|
```
|
|
285
342
|
|
|
286
|
-
Defined in: [Behaviour.ts:
|
|
343
|
+
Defined in: [Behaviour.ts:287](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L287)
|
|
287
344
|
|
|
288
345
|
Spherically interpolates the entity's rotation toward `targetRotation`
|
|
289
346
|
and writes the result back through [TransformComponent](../../components/classes/TransformComponent.md). No-op if
|
|
@@ -308,7 +365,7 @@ the entity has no scene presence.
|
|
|
308
365
|
lookAt(targetPosition): void;
|
|
309
366
|
```
|
|
310
367
|
|
|
311
|
-
Defined in: [Behaviour.ts:
|
|
368
|
+
Defined in: [Behaviour.ts:306](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L306)
|
|
312
369
|
|
|
313
370
|
Rotates the entity to face `targetPosition` in world space and writes the
|
|
314
371
|
resulting orientation back through [TransformComponent](../../components/classes/TransformComponent.md). No-op if
|
|
@@ -332,7 +389,7 @@ the entity has no scene presence.
|
|
|
332
389
|
getComponents(): Component[];
|
|
333
390
|
```
|
|
334
391
|
|
|
335
|
-
Defined in: [Behaviour.ts:
|
|
392
|
+
Defined in: [Behaviour.ts:320](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L320)
|
|
336
393
|
|
|
337
394
|
Returns every component currently attached to this entity.
|
|
338
395
|
|
|
@@ -348,7 +405,7 @@ Returns every component currently attached to this entity.
|
|
|
348
405
|
getComponent<T>(componentClass): T | null;
|
|
349
406
|
```
|
|
350
407
|
|
|
351
|
-
Defined in: [Behaviour.ts:
|
|
408
|
+
Defined in: [Behaviour.ts:337](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L337)
|
|
352
409
|
|
|
353
410
|
Returns the entity's component of the given class, or `null` if it has
|
|
354
411
|
no such component.
|
|
@@ -384,7 +441,7 @@ if (mesh) console.log(mesh.geometryRef);
|
|
|
384
441
|
getEntity(): WorldEntityView | null;
|
|
385
442
|
```
|
|
386
443
|
|
|
387
|
-
Defined in: [Behaviour.ts:
|
|
444
|
+
Defined in: [Behaviour.ts:347](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L347)
|
|
388
445
|
|
|
389
446
|
Returns the latest [WorldEntityView](../../types/type-aliases/WorldEntityView.md) snapshot for this entity, or
|
|
390
447
|
`null` if it was destroyed.
|
|
@@ -401,7 +458,7 @@ Returns the latest [WorldEntityView](../../types/type-aliases/WorldEntityView.md
|
|
|
401
458
|
getParent(): ParentLookup;
|
|
402
459
|
```
|
|
403
460
|
|
|
404
|
-
Defined in: [Behaviour.ts:
|
|
461
|
+
Defined in: [Behaviour.ts:357](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L357)
|
|
405
462
|
|
|
406
463
|
Resolves the entity's parent from the [ParentId](../../components/classes/ParentId.md) component, if any.
|
|
407
464
|
|
|
@@ -420,7 +477,7 @@ A [ParentLookup](../../types/type-aliases/ParentLookup.md) with the parent compo
|
|
|
420
477
|
getChildren(): WorldEntityView[];
|
|
421
478
|
```
|
|
422
479
|
|
|
423
|
-
Defined in: [Behaviour.ts:
|
|
480
|
+
Defined in: [Behaviour.ts:378](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L378)
|
|
424
481
|
|
|
425
482
|
Returns every direct child entity of this one (entities whose
|
|
426
483
|
[ParentId](../../components/classes/ParentId.md) matches `entityId`).
|
|
@@ -437,21 +494,16 @@ Returns every direct child entity of this one (entities whose
|
|
|
437
494
|
protected init(): void;
|
|
438
495
|
```
|
|
439
496
|
|
|
440
|
-
Defined in: [Behaviour.ts:
|
|
497
|
+
Defined in: [Behaviour.ts:393](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L393)
|
|
441
498
|
|
|
442
499
|
Called once before the first [Behaviour.onUpdate](#onupdate). Override to
|
|
443
500
|
default and validate [Behaviour.data](#data), cache references, or set
|
|
444
|
-
initial state.
|
|
501
|
+
initial state. Runs at preview/runtime only — never in the editor.
|
|
445
502
|
|
|
446
503
|
#### Returns
|
|
447
504
|
|
|
448
505
|
`void`
|
|
449
506
|
|
|
450
|
-
#### Remarks
|
|
451
|
-
|
|
452
|
-
Also called in editor mode when `executeInEditor` is `true` on the script
|
|
453
|
-
entry.
|
|
454
|
-
|
|
455
507
|
***
|
|
456
508
|
|
|
457
509
|
### onUpdate()
|
|
@@ -460,21 +512,16 @@ entry.
|
|
|
460
512
|
protected onUpdate(): void;
|
|
461
513
|
```
|
|
462
514
|
|
|
463
|
-
Defined in: [Behaviour.ts:
|
|
515
|
+
Defined in: [Behaviour.ts:402](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L402)
|
|
464
516
|
|
|
465
517
|
Called every frame while the script is enabled. Override with the
|
|
466
|
-
script's main per-frame logic.
|
|
518
|
+
script's main per-frame logic. Runs at preview/runtime only — never in the
|
|
519
|
+
editor (use [ScriptObject](../../index/classes/ScriptObject.md) for editor-visible visuals).
|
|
467
520
|
|
|
468
521
|
#### Returns
|
|
469
522
|
|
|
470
523
|
`void`
|
|
471
524
|
|
|
472
|
-
#### Remarks
|
|
473
|
-
|
|
474
|
-
Also called every frame in editor mode when `executeInEditor` is `true`.
|
|
475
|
-
Access the Three.js scene with `this.world.getScene()` for editor-only
|
|
476
|
-
rendering work such as custom shaders or procedural geometry.
|
|
477
|
-
|
|
478
525
|
***
|
|
479
526
|
|
|
480
527
|
### onSelect()
|
|
@@ -483,7 +530,7 @@ rendering work such as custom shaders or procedural geometry.
|
|
|
483
530
|
onSelect(): void;
|
|
484
531
|
```
|
|
485
532
|
|
|
486
|
-
Defined in: [Behaviour.ts:
|
|
533
|
+
Defined in: [Behaviour.ts:407](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L407)
|
|
487
534
|
|
|
488
535
|
Called when the editor selects this entity. Optional UX hook.
|
|
489
536
|
|
|
@@ -499,7 +546,7 @@ Called when the editor selects this entity. Optional UX hook.
|
|
|
499
546
|
onDeselect(): void;
|
|
500
547
|
```
|
|
501
548
|
|
|
502
|
-
Defined in: [Behaviour.ts:
|
|
549
|
+
Defined in: [Behaviour.ts:412](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L412)
|
|
503
550
|
|
|
504
551
|
Called when the editor deselects this entity. Optional UX hook.
|
|
505
552
|
|
|
@@ -515,7 +562,7 @@ Called when the editor deselects this entity. Optional UX hook.
|
|
|
515
562
|
onTargetFound(target): void;
|
|
516
563
|
```
|
|
517
564
|
|
|
518
|
-
Defined in: [Behaviour.ts:
|
|
565
|
+
Defined in: [Behaviour.ts:422](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L422)
|
|
519
566
|
|
|
520
567
|
Called when an image-tracking target this entity depends on becomes
|
|
521
568
|
visible. Optional AR hook.
|
|
@@ -538,7 +585,7 @@ visible. Optional AR hook.
|
|
|
538
585
|
onTargetLost(target): void;
|
|
539
586
|
```
|
|
540
587
|
|
|
541
|
-
Defined in: [Behaviour.ts:
|
|
588
|
+
Defined in: [Behaviour.ts:432](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Behaviour.ts#L432)
|
|
542
589
|
|
|
543
590
|
Called when an image-tracking target this entity depends on is lost.
|
|
544
591
|
Optional AR hook.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Component
|
|
8
8
|
|
|
9
|
-
Defined in: [Component.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
9
|
+
Defined in: [Component.ts:12](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/Component.ts#L12)
|
|
10
10
|
|
|
11
11
|
Marker base class for every ECS component. Subclass `Component` to declare
|
|
12
12
|
a typed data container that systems can query.
|
|
@@ -39,7 +39,10 @@ asset URLs).
|
|
|
39
39
|
- [`Name`](../../components/classes/Name.md)
|
|
40
40
|
- [`Object3DRef`](../../components/classes/Object3DRef.md)
|
|
41
41
|
- [`ParentId`](../../components/classes/ParentId.md)
|
|
42
|
+
- [`PrefabInstance`](../../components/classes/PrefabInstance.md)
|
|
43
|
+
- [`PrefabNode`](../../components/classes/PrefabNode.md)
|
|
42
44
|
- [`ScriptComponent`](../../components/classes/ScriptComponent.md)
|
|
45
|
+
- [`ScriptObjectComponent`](../../components/classes/ScriptObjectComponent.md)
|
|
43
46
|
- [`Selectable`](../../components/classes/Selectable.md)
|
|
44
47
|
- [`SpriteComponent`](../../components/classes/SpriteComponent.md)
|
|
45
48
|
- [`SelectionTransformState`](../../components/classes/SelectionTransformState.md)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: AnimationComponent
|
|
8
8
|
|
|
9
|
-
Defined in: [components/Animation.ts:71](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
9
|
+
Defined in: [components/Animation.ts:71](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L71)
|
|
10
10
|
|
|
11
11
|
Animation catalog and runtime state for an entity. Combines clips imported
|
|
12
12
|
from a model with externally added clips, exposes a state machine for
|
|
@@ -30,7 +30,7 @@ machine directly so the animation system observes transitions.
|
|
|
30
30
|
new AnimationComponent(options?): AnimationComponent;
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Defined in: [components/Animation.ts:102](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
33
|
+
Defined in: [components/Animation.ts:102](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L102)
|
|
34
34
|
|
|
35
35
|
#### Parameters
|
|
36
36
|
|
|
@@ -50,18 +50,18 @@ Defined in: [components/Animation.ts:102](https://github.com/Relu-Interactives/r
|
|
|
50
50
|
|
|
51
51
|
| Property | Type | Description | Defined in |
|
|
52
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/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/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L100) |
|
|
65
65
|
|
|
66
66
|
## Methods
|
|
67
67
|
|
|
@@ -71,7 +71,7 @@ Defined in: [components/Animation.ts:102](https://github.com/Relu-Interactives/r
|
|
|
71
71
|
setModelClips(clips): void;
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Defined in: [components/Animation.ts:234](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
74
|
+
Defined in: [components/Animation.ts:234](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L234)
|
|
75
75
|
|
|
76
76
|
#### Parameters
|
|
77
77
|
|
|
@@ -91,7 +91,7 @@ Defined in: [components/Animation.ts:234](https://github.com/Relu-Interactives/r
|
|
|
91
91
|
setImportedClips(clips): void;
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
Defined in: [components/Animation.ts:239](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
94
|
+
Defined in: [components/Animation.ts:239](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L239)
|
|
95
95
|
|
|
96
96
|
#### Parameters
|
|
97
97
|
|
|
@@ -111,7 +111,7 @@ Defined in: [components/Animation.ts:239](https://github.com/Relu-Interactives/r
|
|
|
111
111
|
setExternalClipSources(sources): void;
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
Defined in: [components/Animation.ts:276](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
114
|
+
Defined in: [components/Animation.ts:276](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L276)
|
|
115
115
|
|
|
116
116
|
#### Parameters
|
|
117
117
|
|
|
@@ -136,7 +136,7 @@ addState(
|
|
|
136
136
|
| null;
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Defined in: [components/Animation.ts:301](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
139
|
+
Defined in: [components/Animation.ts:301](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L301)
|
|
140
140
|
|
|
141
141
|
#### Parameters
|
|
142
142
|
|
|
@@ -159,7 +159,7 @@ Defined in: [components/Animation.ts:301](https://github.com/Relu-Interactives/r
|
|
|
159
159
|
setStates(states): void;
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
Defined in: [components/Animation.ts:316](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
162
|
+
Defined in: [components/Animation.ts:316](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L316)
|
|
163
163
|
|
|
164
164
|
#### Parameters
|
|
165
165
|
|
|
@@ -184,7 +184,7 @@ getStateConfigs(): {
|
|
|
184
184
|
}[];
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
Defined in: [components/Animation.ts:343](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
187
|
+
Defined in: [components/Animation.ts:343](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L343)
|
|
188
188
|
|
|
189
189
|
#### Returns
|
|
190
190
|
|
|
@@ -203,7 +203,7 @@ Defined in: [components/Animation.ts:343](https://github.com/Relu-Interactives/r
|
|
|
203
203
|
setActiveState(name, autoPlay?): boolean;
|
|
204
204
|
```
|
|
205
205
|
|
|
206
|
-
Defined in: [components/Animation.ts:352](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
206
|
+
Defined in: [components/Animation.ts:352](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L352)
|
|
207
207
|
|
|
208
208
|
#### Parameters
|
|
209
209
|
|
|
@@ -224,7 +224,7 @@ Defined in: [components/Animation.ts:352](https://github.com/Relu-Interactives/r
|
|
|
224
224
|
removeState(name): boolean;
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
Defined in: [components/Animation.ts:363](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
227
|
+
Defined in: [components/Animation.ts:363](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L363)
|
|
228
228
|
|
|
229
229
|
#### Parameters
|
|
230
230
|
|
|
@@ -244,7 +244,7 @@ Defined in: [components/Animation.ts:363](https://github.com/Relu-Interactives/r
|
|
|
244
244
|
switchState(name, autoPlay?): boolean;
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
Defined in: [components/Animation.ts:371](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
247
|
+
Defined in: [components/Animation.ts:371](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L371)
|
|
248
248
|
|
|
249
249
|
#### Parameters
|
|
250
250
|
|
|
@@ -265,7 +265,7 @@ Defined in: [components/Animation.ts:371](https://github.com/Relu-Interactives/r
|
|
|
265
265
|
playState(name?): boolean;
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
Defined in: [components/Animation.ts:382](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
268
|
+
Defined in: [components/Animation.ts:382](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L382)
|
|
269
269
|
|
|
270
270
|
#### Parameters
|
|
271
271
|
|
|
@@ -285,7 +285,7 @@ Defined in: [components/Animation.ts:382](https://github.com/Relu-Interactives/r
|
|
|
285
285
|
pauseState(name?): boolean;
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
Defined in: [components/Animation.ts:393](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
288
|
+
Defined in: [components/Animation.ts:393](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L393)
|
|
289
289
|
|
|
290
290
|
#### Parameters
|
|
291
291
|
|
|
@@ -305,7 +305,7 @@ Defined in: [components/Animation.ts:393](https://github.com/Relu-Interactives/r
|
|
|
305
305
|
stopState(name?): boolean;
|
|
306
306
|
```
|
|
307
307
|
|
|
308
|
-
Defined in: [components/Animation.ts:404](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/
|
|
308
|
+
Defined in: [components/Animation.ts:404](https://github.com/Relu-Interactives/relu-spatial-ecs-engine/blob/020795472520adb990c488982ca8572cbf8580db/core/components/Animation.ts#L404)
|
|
309
309
|
|
|
310
310
|
#### Parameters
|
|
311
311
|
|