@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index
index ​
Classes ​
Face tracking ​
| Class | Description |
|---|---|
| FaceGestureDetector | Turns frames of tracking into state and events. One per face. |
Other ​
| Class | Description |
|---|---|
| AnimationStateMachine | - |
| AnimationStateManager | - |
| World | - |
| AssetLoadError | What loadAssets rejects with. Every file that could load has loaded; failures says which didn't and why. Calling again retries only those. |
| AudioMixer | - |
| SlotChooser | Decides whether a slot sounds and which take: chance, cooldown, and never the same take twice running when there's another. No audio here, so it's testable. |
| CameraDirector | Takes the camera for cutscenes and gives it back. Reached with this.cameras from a Behaviour, or world.getCameraDirector(). |
| InputActions | - |
| TouchControls | - |
| QualitySystem | Applies graphics settings to the renderer: pixel ratio, shadows and post effects, from the player's preset or the device's recommendation, and keeps the frame rate up with dynamic resolution. Reads and writes world.settings.graphics. |
| OcclusionBuffer | A small CPU depth buffer for occlusion culling. |
| GameSettings | - |
| AnimationSystem | - |
| CameraRigSystem | Moves cameras, last of all before the render: CameraRigComponent and the cutscenes run through CameraDirector. |
| CameraSyncSystem | - |
| InputSystem | - |
| InstancedMeshSystem | Maintains the runtime geometry for entities with an InstancedMeshComponent. |
| LightSyncSystem | - |
| MaterialSyncSystem | - |
| MeshGeometrySystem | - |
| ObjectManagementSystem | - |
| ObjectVisibilitySystem | - |
| PhysicsSyncSystem | - |
| ScriptBehaviourSystem | - |
| ScriptLateUpdateSystem | Runs onLateUpdate on every Behaviour that has one, once everything else has moved for this frame: physics, scripts, animation, IK, and the transforms written to three.js. So a camera script reads where things will really be drawn, bones included, and can't trail by a frame depending on which script happened to run first. |
| TransformSyncSystem | - |
| UIInteractionSystem | - |
| UIPanelSystem | - |
| VRTeleportAreaSystem | - |
| XRAnchorSystem | - |
| XRControllerVisualSystem | - |
| XREnvironmentSystem | - |
| XRHandPoseSystem | - |
| XRHitTestSystem | - |
| XRHoverVisualSystem | - |
| XRInputSystem | - |
| XRInteractionSystem | - |
| XRLocomotionSystem | - |
| XRSessionSystem | Owns the immersive-session lifecycle and fans XR events out to Behaviours. |
| XRTeleportVisualSystem | - |
| Heightfield | - |
| UikitUiRenderer | - |
| HandPoseTracker | Turns a stream of per-frame confidences into clean start/end events. |
| TeleportAimGate | Decides when a teleport may actually commit. |
| ThrowVelocityTracker | Rolling buffer of hand positions used to recover throw velocity. |
Scripting ​
| Class | Description |
|---|---|
| ScriptObject | Base class for script objects — entities whose THREE.js visual is built entirely by user code (procedural geometry, shaders, particle systems, anything the editor can't author natively). |
Systems ​
| Class | Description |
|---|---|
| StreamingSystem | Loads and frees regions of a big world as the player moves: models under a StreamingComponent load when the player comes within its load distance and are freed once they're past its unload distance. Every model load in a world with streamed content goes through here, so models load nearest first. |
| AudioSystem | Reconciles AudioComponent state with the underlying THREE.js audio objects each frame. |
| BoneHoldSystem | Applies each BoneAttachmentComponent's holds for the clip its character is playing: which bone it rides, where, and whether it shows. Runs after the animation and before IK, so a hand can reach for something that just moved to a new hold. |
| EnvironmentSyncSystem | Applies the scene's Environment component to the three.js scene: skybox, fog, and (when values.lighting is present) image-based lighting, tone mapping and exposure. |
| FaceMeshSystem | Draws every FaceMeshComponent, the same way in the editor and at runtime: the only difference is the surface. An editor gives it the canonical face and a runtime the live one, so a texture lands in the same place on both. |
| IKSystem | Runs each IKComponent's chains after the animation: hands and feet reach their target entities. Bones the animation doesn't drive would keep last frame's IK pose and drift, so every bone IK touched is put back to its pre-IK rotation first unless the animation already overwrote it. A chain with clips fades with the clip that's playing. |
| LODSystem | Draws a simpler level of a model when it's small on screen, and nothing when it's past its cull size or distance (LODComponent). |
| OcclusionCullingSystem | Skips drawing objects hidden behind OccluderComponents. |
| PostprocessingSyncSystem | Builds the post-processing chain from the scene's Postprocessing component and hands it to RenderSystem through scene.userData: |
| RenderSystem | Draws the frame: through the post-processing chain in scene.userData.ecsPostprocessingComposer while scene.userData.ecsPostprocessingComposerActive is true, otherwise with renderer.render(scene, camera). Runs last in the default system list. |
| ScriptObjectSystem | Builds, ticks, and disposes ScriptObject scripts. Unlike ScriptBehaviourSystem, this runs in the editor AND at runtime — there is NO isEditorMode gating anywhere here. A script's build() output is attached under the entity's Object3DRef.object (so it inherits transform, selection and visibility). runtimeState is written on transitions only (never every frame). |
| VideoSystem | Reconciles VideoComponent state with the underlying HTML video element and THREE.js mesh/material each frame. |
| FoliageSystem | Grass, trees and rocks on terrains (GrassComponent, ScatterComponent). Both are built in chunks around the camera, nearest first and a few a frame, and dropped once far behind, so a huge terrain costs what's near. |
| TerrainSystem | Builds and draws terrains (TerrainComponent): makes the heightfield (from its file or its noise), splits it into chunks drawn simpler with distance, keeps a physics heightfield in step, and gives occlusion culling boxes for the solid ground under hills. |
Interfaces ​
Face tracking ​
| Interface | Description |
|---|---|
| Face | The face, as a script reads it: this.face in a face-tracking project. Everything FaceTracker has, and gestures. |
| FaceSurface | The face as something to paint on. A face-tracking runtime gives the one the tracker keeps moving, and an editor gives the canonical face, so both draw the same way with the same UVs. |
| FaceTracker | What a face-tracking runtime gives the world. The project's template provides one and sets it with World.setFaceTracker; there is none in the editor or in other kinds of project, so everything reading it has to cope with null. |
Hand tracking ​
| Interface | Description |
|---|---|
| HandSource | What a project gives the world to read hands. The project's template provides one and sets it with World.setHandTracker, and only in a project that has hand tracking on. |
| Hand | One hand in view. |
| Hands | Hands, as a script reads them: this.hands in a project with hand tracking on, and null anywhere else. |
Other ​
| Interface | Description |
|---|---|
| StateMachine | - |
| EcsSystem | - |
| SoundTake | One recording of a slot. file is an asset path; volume multiplies the slot's. |
| SoundSlot | A named sound the game asks for ("hit", "footstep"), played as a random take. |
| SoundBankAsset | The contents of a .soundbank.json asset. |
| HandTrackerRuntime | What World.setHandTracker takes: hands, and what the world needs to run them. |
| InputSourceReader | What the action layer reads each frame. InputSystem supplies the real one. |
| ColocationHandle | Colocation in mixed reality: this.network.colocation, null when the scene doesn't use it. |
| NetworkHandle | A Behaviour's view of the shared world: this.network, null in a single-player run. |
| PostprocessingPipeline | A built post-processing chain. RenderSystem calls render() in place of renderer.render() while it is active. |
| PostprocessingBuildContext | Everything a backend needs to build a post-processing chain. |
| ChromaKeyOptions | Green-screen settings, in the same units as VideoComponent.options. |
| RenderBackend | Everything renderer-specific the engine does, behind one small interface so a World can run on WebGL or WebGPU. |
Type Aliases ​
Face tracking ​
| Type Alias | Description |
|---|---|
| FaceGestureEvent | One gesture, as a script hears it. |
| FaceGestureThresholds | How easily gestures fire. Expression values are how far from this person's resting face, 0 to 1, so they mean the same on anyone. |
| FaceGestureName | Gestures a script can hear. |
| FaceCameraFrame | What the camera shows. The AR canvas is transparent over the video, so nothing drawn on it can darken the picture under it: a blend that has to read the camera reads this instead. |
Hand tracking ​
| Type Alias | Description |
|---|---|
| HandGestureName | Hand gestures a script can hear. |
Other ​
| Type Alias | Description |
|---|---|
| AnimationStateCallbacks | - |
| PauseOptions | What world.pause() leaves alone. Both default to "pause". |
| ModelBoneInfo | A bone of a loaded model, for bone pickers and attachment. |
| AssetSource | A path, or a script's AssetInput field. |
| AssetLoadProgress | - |
| LoadAssetsOptions | - |
| AssetLoadFailure | - |
| AssetReleaseResult | - |
| AudioUserLevels | The player's own levels, from settings: they multiply what the game sets. |
| AudioBus | The mixer's groups. Music dips while a voice plays. ui is for menus: a pause never holds it, so a menu keeps its clicks. |
| CameraMark | A place in a shot: an entity, by id, name or inspector field, or a position. |
| CameraEase | - |
| CameraShot | One camera move in a cutscene. |
| CameraPlayOptions | - |
| CameraPose | Where a camera is this frame. |
| FaceAttachPointId | Names of the places on a head. |
| FaceAttachPoint | One place on the head. |
| PictureSide | Which side of the picture. |
| GestureThreshold | One measured gesture's trigger: on above on, off again below off. |
| FaceGestureValues | Measured values, 0 to 1 from this person's resting face. |
| FaceGestureState | What's true of the face right now. |
| HeadAngles | The head's angles in degrees. yaw + is the nose to the picture's right, pitch + is looking down, roll + leans to the picture's left. |
| FaceGestureSample | One frame of tracking. |
| FaceSurfaceCuts | Which parts of the face a mesh leaves open. |
| FaceHeadFit | How a person's head compares with the average one. |
| FacePose | Where the head is on one frame of tracking. |
| ModelLoadGate | Something that decides when a model starts loading: the streaming system, which holds back models out of range and starts the rest nearest first. start begins the load. |
| Unsubscribe | Takes a listener back off. |
| ScreenPosition | A place on screen, in CSS pixels from the top left of the page, the same as a pointer event's clientX and clientY. |
| HandPoseName | Named poses. |
| HandPointName | A named place on a hand. |
| HandSide | Which hand. The person's own: left is their left hand, on any camera. |
| HandTrackingStatus | Whether hands can be read yet. |
| HandDetection | One hand on one frame of detection, from the runtime. |
| HandWorldOptions | How hands sit in the world. |
| HandGestureEvent | One gesture, as a script hears it. |
| HandAttachOptions | Which hand to attach to, and how. |
| ComponentValueMaps | - |
| EcsWorldComponentSnapshot | - |
| EcsWorldStateSnapshotLike | - |
| HydrateWorldFromSnapshotResult | - |
| HydrateOptions | Optional behavior tweaks for hydrateWorldFromSnapshotDetailed. Defaults preserve the historical full-world-load behavior; prefab/subtree instantiation passes stricter options. |
| InputTuning | How sticks and sensitivity feel. The settings store writes the player's part. |
| NavigationDirection | A menu step from the navigate action, with hold-to-repeat. |
| InputDevice | Where an input came from last. Prompts and touch controls follow it. |
| ParsedBinding | - |
| InputActionDefinition | A button press (kind: "button") or a direction (kind: "axis"). |
| InputActionMap | - |
| GamepadFamily | The kind of pad, read from its id. Decides button names and glyphs. |
| GamepadButtonName | - |
| GamepadSnapshot | One pad's state for a frame, read from navigator.getGamepads(). |
| TouchButtonConfig | One on-screen button. id is what bindings name: touch:<id>. |
| TouchControlsConfig | - |
| TouchVisibility | - |
| ColocationStatus | - |
| NetSpawnOptions | Options for NetworkHandle.spawn. |
| ApplyPrefabToSnapshotResult | - |
| InstantiateSubtreeResult | - |
| NodeKeyMaps | - |
| NestedRegion | - |
| NodeMaps | - |
| SerializeEntitySubtreeResult | - |
| SubtreeSnapshot | Snapshot-space entity-id walking/remapping. |
| ExternalRefWarning | - |
| RemapSnapshotOptions | - |
| SpawnPrefabSource | - |
| SpawnPrefabOptions | - |
| PrefabAsset | Envelope of a .prefab asset file (and, later, .scene assets — same shape with type: "scene"). snapshot is the same columnar world-snapshot format hydrateWorldFromSnapshotDetailed consumes, with entity ids renumbered 1..N and every entity carrying a PrefabNode identity. |
| QualitySystemOptions | - |
| GpuTier | - |
| DeviceProfile | - |
| QualityRecommendation | - |
| QualityPresetName | - |
| QualityPreset | - |
| QualityLimits | What the engine actually applies this frame. |
| EcsRenderer | A renderer a World can run on: three's classic WebGLRenderer, or WebGPURenderer from three/webgpu (which falls back to WebGL 2 on its own when the browser has no WebGPU). |
| RendererKind | Which renderer family a world is drawing with. |
| CullReasonFlag | - |
| FoliageMaterialOptions | What a foliage (grass) material needs: blades whose geometry carries aHeight (0 at the root, 1 at the tip) and a colour per vertex, drawn as instances with a per-instance aPhase so neighbours sway out of step. |
| FoliageWind | Live wind values for a foliage material. |
| ScriptErrorPhase | Where in a script's life an error happened. |
| ScriptErrorSource | Which kind of script failed. |
| ScriptErrorEvent | Emitted by world.onScriptError(...) the first time a distinct script error occurs. "Distinct" is the combination of script URL, class name, phase and message: ten enemies running the same broken script report once. |
| ScriptErrorListener | Listener registered with world.onScriptError(...). |
| ScriptErrorReport | What a system knows when it reports a script error. |
| ShadowSetting | - |
| PostFxSetting | - |
| GraphicsSettings | - |
| AudioSettings | - |
| TouchStickMode | - |
| ControlsSettings | - |
| GameplaySettings | - |
| GameSettingsData | - |
| GameSettingsSection | - |
| GameSettingsListener | - |
| GameSettingsPatch | Deep partial for update. |
| StreamingFocus | What the player's position is read from. |
| StreamingSettings | World-wide streaming settings. Scripts change them through world.streaming. |
| StreamingStats | - |
| PlaySlotOptions | Options for AudioSystem.playSlot. |
| FaceMeshSystemOptions | What a FaceMeshSystem draws on. |
| MouseButton | - |
| InputSystemOptions | Options for InputSystem. Everything is optional; new InputSystem() still works. |
| InputPrompt | How an action reads on screen for the device in use. |
| EcsComponentFactoryKind | - |
| ComponentFactory | - |
| OccluderBox | Extra occluders a system provides (terrain chunks): a local box and its world matrix. |
| OccluderSource | - |
| OcclusionStats | - |
| ScriptBehaviourSystemOptions | Options for ScriptBehaviourSystem. |
| SelectionContext | Optional context that enables raycast-based onSelect / onDeselect dispatch. When provided, pointer/touch taps on the canvas fire a raycast against the scene. If the hit object (or any ancestor) carries userData.entityId, every Behaviour instance for that entity receives onSelect(); the previously selected entity's instances receive onDeselect(). |
| UiCanvasLike | Structural canvas type so tests can inject a stub with no DOM. |
| XrHandPoseEventDetail | - |
| XrHitResult | Where a ray met the real world. |
| KeyboardKey | - |
| ModuleLoader | Resolves a script URL to its ES module namespace. |
| Placement | - |
| TerrainNoise | - |
| TerrainPaintRule | An automatic paint rule: a layer wins where height and slope fall in range. |
| Impostor | Pictures of a model from all round, for drawing it as a flat card far away. One small texture per direction (no atlas, so no renderer-specific shader picks the frame: a chunk of cards just uses the picture nearest its view). width and height are the card's size in the model's units; bottom is where its base sits. |
| UiColorStop | The style model for spatial UI. |
| UiPaint | - |
| UiShadow | - |
| UiPattern | A texture laid over a surface's fill, inside its shape: the scanlines of a terminal, the grid of a holo-table, a paper grain. Spacing and width are metres; angle turns stripes, in degrees. |
| UiMotion | How a pressable widget moves. lift is metres toward the viewer while pointed at, scale the size while pointed at, pressScale the size while held, and speed how quickly it gets there (higher is snappier). |
| UiTextStyle | - |
| UiStateStyle | What a state changes. A state can't hold states of its own. |
| UiStyle | - |
| UiTokens | - |
| UiPanelVariant | - |
| UiTextVariant | - |
| UiButtonVariant | - |
| UiThemeControl | Colours for a toggle or slider: off/empty, on/filled, and the knob. |
| UiTheme | - |
| UiThemeFile | A theme file: any part of a theme, laid over the one it extends. |
| UikitModule | Draws spatial-UI widget trees with @pmndrs/uikit: one uikit root per tree, so a whole menu is a few instanced draw calls instead of one canvas texture and quad per widget. |
| UiRendererStatus | - |
| SharedModelVersionResolver | Says which version of the file at url is current, e.g. its modification time. A different answer than the loaded copy had means the file changed, so the next placement loads it again. undefined when it can't tell. |
| SharedModelStats | - |
| ModelPivot | - |
| RaycastQuery | What intersectScene and World.raycast accept. |
| XrHandJointName | The 25 joints of the WebXR hand skeleton. |
| XrFinger | - |
| XrHandJoints | Joint positions, in world space. |
| XrFingerCurl | How curled one finger is. |
| XrPalmPose | An orthonormal frame attached to the palm. |
| XrHandShape | Everything a pose is matched against, derived once per hand per frame. |
| XrFingerTarget | Target curl for one finger, with the slack allowed around it. |
| XrHandPoseAxis | Which way something on the hand must point for the pose to count. |
| XrHandPoseDirection | - |
| XrHandPoseOrientation | - |
| XrHandPoseDefinition | A matchable hand pose. |
| XrHandPoseMatch | - |
| XrHandPoseContext | Extra world context needed only by head-relative orientation conditions. |
| XrHandPoseEvent | - |
| HandPoseTrackerOptions | - |
| HandMaterialOptions | Materials for tracked-hand meshes. |
| VelocitySample | - |
| XrHandedness | Which hand an input source belongs to (none for gaze / single-source devices). |
| XrInputKind | How an input source is physically driven. |
| XrInputState | One frame of normalized input for a single source. |
| XrCapabilities | What the ACTIVE session actually granted us. |
Variables ​
Face tracking ​
| Variable | Description |
|---|---|
| FACE_ATTACH_POINTS | Every place on the head. |
Other ​
| Variable | Description |
|---|---|
| FACE_HEAD_UNIT_CM | The canonical head's face width in centimetres: one head unit. |
| DEFAULT_FACE_GESTURE_THRESHOLDS | The defaults. See docs/guide/face-gestures.md for where they come from. |
| HYDRATABLE_ENTITY_KINDS | - |
| DEFAULT_INPUT_TUNING | - |
| DEFAULT_INPUT_ACTIONS | Actions every game gets. A script reads this.input.getAxis("move") and the player can use WASD, arrows, either stick, the D-pad or the touch stick. |
| GAMEPAD_BUTTONS | Buttons by position in the standard mapping, so a binding means the same physical button on every pad: south is A on Xbox, Cross on PlayStation and B on a Switch pad. |
| DEFAULT_TOUCH_CONTROLS | - |
| NODE_KEY_SEPARATOR | - |
| ADDED_NODE_MARKER_COMPONENT | Reserved override "component" marking a node ADDED by the host document inside a nested instance region (`"<nodeKey> |
| OVERRIDE_DIFF_EXCLUDED_COMPONENTS | Components that never participate in override diffing/merging. |
| OVERRIDE_ROOT_EXCLUDED_COMPONENTS | Components excluded ONLY on the instance ROOT node — these are per-instance by definition (where the instance sits in the scene and what it's called). |
| PREFAB_FILE_VERSION | - |
| PREFAB_FILE_VERSION_NESTED | Written for files containing NESTED instances (parse accepts either). |
| QUALITY_PRESET_NAMES | - |
| QUALITY_PRESETS | - |
| CullReason | Why the engine isn't drawing an object. Several systems hide things for their own reasons (out of streaming range, too far, behind a wall), and an object shows again only when none of them still wants it hidden. None of this is the entity's own visibility (Object3DRef.visibility), which stays what the game set: scripts, physics and audio carry on as before. |
| LOD_COPY_KEY | On an object the LOD system mounted beside an entity's model: another level of detail, or an impostor. Physics, bounds and the editor skip these, since they're other looks of the same thing. |
| webglBackend | The default RenderBackend: three's WebGLRenderer, post-processing through EffectComposer, GLSL chroma key. |
| GAME_SETTINGS_VERSION | - |
| DEFAULT_SCRIPT_ERROR_RETRY_DELAY | Seconds a Behaviour waits after an error (load, init() or update()) before it is re-initialised. Without the wait a script that throws every frame was torn down and rebuilt every frame. |
| SCRIPT_OBJECT_ROOT_FLAG | Tags the Object3D a script's build() returned, so reloads can find/remove it. |
| BUNDLED_INPUT_PROFILES | The input profiles the engine ships a copy of (dist/assets/xr-input-profiles in the package): every Quest's controllers and the tracked-hand model. A game that serves that folder and passes its address as inputProfilesPath loads these from itself; any other controller still comes from the CDN. Keep in step with scripts/copy-input-profiles.mjs. |
| INPUT_PROFILES_CDN | Where three loads input profiles from when the game serves none. |
| XR_HOVER_SHELL_FLAG | Marks shell meshes so they are never mistaken for scene content. |
| KeyboardKeys | - |
| TERRAIN_OBJECT_KEY | On a terrain's own objects: what they are, so the editor and tools can tell. |
| TERRAIN_LAYERS | Paint layers a terrain blends between. |
| DEFAULT_TERRAIN_NOISE | - |
| IMPOSTOR_VIEWS | How many directions an impostor is pictured from. |
| UI_ICON_NAMES | Every built-in icon name, sorted. |
| UI_PANEL_VARIANTS | - |
| UI_TEXT_VARIANTS | - |
| UI_BUTTON_VARIANTS | - |
| UI_THEMES | Every built-in theme, by name. |
| UI_THEME_NAMES | - |
| UI_RENDERER_KEY | On a tree root's object: what draws the tree and why. For the editor. |
| SHARED_MODEL_RESOURCE_FLAG | userData flag set on geometries/materials that back shared (cached) model scenes. Entity disposal must skip these — other live clones and future spawns reference the same GPU resources. |
| SHARED_MODEL_GRACE_MS | How long a model nothing uses stays loaded, in case it's placed again. |
| MODEL_PIVOT_WRAPPER_FLAG | userData flag on the wrapper group that carries a model's pivot offset. |
| SPATIAL_ECS_FEATURES | Spatial-ecs features a host (the editor) can check at run time. |
| RAYCAST_BVH_MIN_TRIANGLES | Meshes with fewer triangles than this are tested the plain way. |
| XR_FINGERS | - |
| PINCH_FINGERS | Fingers that can oppose the thumb. The thumb cannot pinch itself. |
| FALLBACK_HAND_SCALE | Fallback palm width when the hand is too poorly tracked to measure. |
| STRAIGHT_COS | Straightness normalization. |
| CURLED_COS | - |
| MATCH_FALLOFF | Confidence falls to zero this far outside a target's tolerance band. |
| DEFAULT_DIRECTION_TOLERANCE | Default cone for per-finger direction constraints. |
| DEFAULT_ENTER_CONFIDENCE | - |
| DEFAULT_EXIT_CONFIDENCE | - |
| DEFAULT_MIN_HOLD_SECONDS | - |
| DEFAULT_LOST_GRACE_SECONDS | - |
| HAND_POSE_PRESETS | Built-in poses, keyed by id. |
| HAND_POSE_PRESET_IDS | Preset ids, in the order the editor lists them. |
| ARC_GRAVITY | Downward acceleration applied to the aim curve, m/s². |
| ARC_SPEED | Launch speed of the virtual projectile, m/s. Tuned for ~5-8m reach. |
| ARC_STEPS | Samples along the curve. Enough to look smooth without wasting raycasts. |
| ARC_MAX_TIME | Seconds of flight to simulate before giving up on finding ground. |
| VELOCITY_SAMPLES | Samples retained. ~5 frames ≈ 55ms at 90Hz — long enough to smooth noise. |
| MAX_SAMPLE_AGE_SECONDS | Samples older than this are ignored on release. |
| MAX_PLAUSIBLE_SPEED | Fastest hand motion treated as real, in metres/second. |
| NO_XR_CAPABILITIES | Capabilities for "no session running" — every feature off. |
Functions ​
Face tracking ​
| Function | Description |
|---|---|
| getFaceAttachPoint | The place with this name, or undefined. |
| faceAttachPointPosition | Where a place is on the average head, in head units. This is where it is in the editor, and on a person until they've been measured. |
Other ​
| Function | Description |
|---|---|
| listModelBones | Every bone of a loaded model, parents before children. |
| findModelBone | The bone an attachment names in root: by node name, then by its sanitized form (a name saved from a source file), then by humanoid name (the same body part on another rig). null when none matches. |
| setWorldQuaternion | Sets a node's world rotation, keeping its position (children follow). |
| twoBoneIK | Two-bone IK: rotates upper and lower so end's origin (the wrist or ankle) reaches target, bending toward pole (pass the animated elbow/knee position to keep the animation's style). Unreachable targets are reached for as far as the limb allows. Returns how far the end stayed from the target (0 when reachable). forward is the way the character faces, for a limb too straight to say which way it bends. |
| gripQuaternion | World rotation for a hand gripping a bar along axis (unit), for hands whose bones run +X across the knuckles, +Y along the fingers and +Z out of the palm (the editor's fixed rigs). The back of the hand faces back (projected off the axis); the fingers continue away from the elbow (forearm = elbow → wrist). |
| loadAssets | Load files now and resolve when they're ready. A model, a texture, a sound, a .prefab (with every file inside it) or a .soundbank.json; anything else is fetched as bytes. |
| isAssetLoaded | Whether a file has finished loading, by this API or by a model entity. |
| getLoadedAsset | A loaded file, or undefined if it isn't ready: a GLTF for a model, a THREE.Texture for an image, a PrefabAsset for a prefab, an ArrayBuffer for anything else. |
| releaseAssets | Free loaded files: GPU memory and the bytes kept for them. A file that's wanted again just loads again. |
| soundBankFiles | Every recording a bank needs. |
| dampFactor | How much of a gap to close this frame so it shrinks at the same rate at any frame rate. smoothTime is the seconds it takes to close about 63% of a gap; 0 closes all of it. |
| damp | Ease current toward target. See dampFactor. |
| shortestAngle | The signed shortest turn from one angle to another, in radians. |
| dampAngle | damp for an angle in radians, the short way around. |
| dampVector3 | damp for each axis of current, in place. |
| createAnimationComponent | - |
| createAudioComponent | - |
| createBoneAttachmentComponent | - |
| createCameraComponent | - |
| createCameraRigComponent | - |
| createEntityTypeComponent | - |
| createEnvironmentComponent | - |
| createFaceMeshComponent | - |
| createFaceAttachmentComponent | - |
| createFaceHeadComponent | - |
| createGrassComponent | - |
| createIKComponent | - |
| createImageComponent | - |
| createImageTargetAnchorComponent | - |
| createImageTargetComponent | - |
| createInstanceSlotComponent | - |
| createInstancedMeshComponent | - |
| createLODComponent | - |
| createLightComponent | - |
| createMaterialComponent | - |
| createMeshComponent | - |
| createMeshGeometryComponent | - |
| createModelComponent | - |
| createNameComponent | - |
| createNetworkIdentityComponent | - |
| createNetworkTransformComponent | - |
| createNetworkedPropsComponent | - |
| createNetworkSpawnerComponent | - |
| createXRMultiplayerComponent | - |
| createObject3DRefComponent | - |
| createOccluderComponent | - |
| createParentIdComponent | - |
| createPhysicsComponent | - |
| createPostprocessingComponent | - |
| createScatterComponent | - |
| createScriptComponent | - |
| createScriptObjectComponent | - |
| createSelectableComponent | - |
| createSelectionTransformStateComponent | - |
| createSpriteComponent | - |
| createStreamingComponent | - |
| createTerrainComponent | - |
| createTransformComponent | - |
| createUIButtonComponent | - |
| createUIPanelComponent | - |
| createUISliderComponent | - |
| createUITextComponent | - |
| createUIToggleComponent | - |
| createVRTeleportAreaComponent | - |
| createVideoComponent | - |
| createXRAnchorComponent | - |
| createXRHandPoseComponent | - |
| createXRInteractableComponent | - |
| createXRInteractorComponent | - |
| createXRInteractorSideComponent | - |
| createXRRigComponent | - |
| reloadModelEntity | Load a model entity's file again (it was rewritten: optimised, re-rigged, its animations edited) and swap it in. The old loaded scene is removed and its own geometry and materials disposed; the entity, its components and its children stay, and objects attached to its bones move onto the new ones. Returns false when the entity has no model to reload. |
| unloadModelEntity | Take a model entity's loaded scene off it (streaming: the player is far away). The entity and its components stay, its state becomes "unloaded", and its clone's own skeletons go; the file's shared geometry and textures are freed separately once nothing else shows them (releaseAssets). Bring it back with reloadModelEntity. Returns false when there's nothing to take off. |
| registerDefaultComponentFactories | - |
| registerDefaultFactories | - |
| buildComponentValueMaps | - |
| hydrateWorldFromSnapshotDetailed | - |
| hydrateWorldFromSnapshot | - |
| restorePostCreateComponents | - |
| restoreComponentState | - |
| parseBinding | Read a binding string; null when it isn't one. |
| isAxisBinding | Whether a binding gives a direction (an axis) rather than a press. |
| bindingDevice | The device a binding belongs to. |
| keyLabel | A key code as printed on the key: KeyW → W, Digit1 → 1, ShiftLeft → Shift. |
| bindingLabel | How a binding reads on screen: "Space", "Left Click", "A" or "✕", "WASD", "Left Stick". symbol gives PlayStation's shapes instead of their names. |
| cloneActionMap | Copy of an action map that can be edited without touching the original. |
| gamepadButtonIndex | A standard-mapping index from a name ("south", "a", "cross", "rt") or a number. |
| gamepadFamily | Which family a pad belongs to, from Gamepad.id. |
| gamepadButtonLabel | What a button is called on this kind of pad: "A", "Cross", "RT", "Options". |
| gamepadButtonSymbol | The shortest mark for a prompt: "✕" on PlayStation, "A" on Xbox. |
| gamepadFamilyName | The display name of a pad family, for "Xbox controller connected". |
| applyRadialDeadZone | A radial dead zone with the outer edge rescaled, so a stick at rest reads exactly zero, a small push starts from zero instead of jumping, and the rim reaches 1 even on a worn pad. |
| applyTriggerDeadZone | A trigger or analog button below threshold reads as zero; above it, rescaled to 0..1. |
| snapshotGamepad | Plain numbers from a live pad: a button's value is 1 when pressed even if its analog value lags. |
| stickVector | Where a thumb dx, dy px from the stick's centre points, as -1..1 with y up, and where to draw the knob. |
| applyPrefabToSnapshotInstances | Patch every top-level-relative nested instance of nestedUrl inside hostSnapshot with newNestedSnapshot. Deeper nesting (B inside C inside A) is NOT touched here — it cascades through C's own file. |
| collectEntitySubtree | Collect the given roots plus every descendant, BFS parent-first, using the ParentId component edges. Parent-first ordering matters: serialization renumbers ids in this order and instantiation creates entities in file order, so parents always exist before their children are linked. |
| collectDirectPrefabDependencies | Direct (top-level-relative) prefab urls a document depends on — the edges of the nesting graph. Deeper nesting is reached transitively through each dependency's own file, never directly. |
| instantiateSubtree | Hydrate a self-contained subtree snapshot (a prefab file's snapshot) into a LIVE world: fresh entity ids, internal references remapped, no camera promotion, transform pass scoped to the created entities. |
| buildNodeKeyMapsFromSnapshot | - |
| collectSnapshotSubtreeIds | JSON-space subtree ids (root first, BFS) via ParentId edges. |
| findTopLevelNestedRegions | TOP-LEVEL-RELATIVE nested instance regions of a document: instance roots that are not the scope root and not themselves inside another region. Deeper nesting is reached by cascading through the intermediate prefab's own file, never directly. |
| findSnapshotRootEntityIds | Entity ids of entities whose ParentId is null or absent. |
| buildNodeMapsFromSnapshot | - |
| indexSnapshotByEntity | Invert the columnar snapshot into entityId → (componentName → value). |
| canonicalizeComponentValue | Canonicalize a serialized component value into nodeId-space: - entity-id fields → {$node} (internal) or raw id (external) - ScriptComponent entries keep only {className, scriptUrl, enabled, data} (entityId/runtimeState/runtimeMessage are per-instance transients) - ScriptObjectComponent keeps only {scriptUrl, className, enabled, data} (runtimeState/runtimeMessage are per-instance transients) - Object3DRef keeps only {visibility} (the rest is a live object ref) |
| decanonicalizeComponentValue | Replace every {$node} marker (at any depth) with the mapped entity id from nodeToId, or null when the node no longer exists. Exact inverse of canonicalization for the id-bearing positions. |
| encodeOverride | - |
| parseOverride | - |
| groupOverridePaths | nodeId → componentName → set of overridden paths. |
| collectDiffPaths | Collect leaf paths where two canonical values differ. Semantics: - {$node} refs compare atomically by nodeId - arrays of differing length are ONE atomic override (the array path); equal lengths recurse per index - object key present on one side only marks that key's path - type mismatches mark the current path An empty-string path means the values differ at the top level. |
| computeInstanceOverrides | Diff a live instance subtree against its prefab base (both as serialized subtree snapshots carrying PrefabNode identity) and return the encoded override list: every path where the instance deviates from the base. |
| mergeComponentValue | Merge a component's NEW canonical file value with an instance's canonical value, preserving the instance side at every overridden path. An empty path ("") means the whole component is overridden → instance wins. |
| serializeEntitySubtree | Serialize rootId + all descendants into a self-contained snapshot: entity ids renumbered 1..N in BFS parent-first order, all internal id references remapped, external references nulled + reported, root ParentId forced to null. The result is directly consumable by hydrateWorldFromSnapshotDetailed / instantiateSubtree. |
| remapSnapshotEntityIds | Return a deep-cloned snapshot with every entity id (entity list, entry keys, and all id-bearing component fields) remapped through idMap. References to ids missing from the map follow externalRefPolicy and are reported in warnings (with ids in the INPUT snapshot's id space). |
| loadPrefab | Fetch + parse (and cache) a .prefab asset. All strings inside the snapshot are passed through the registered URL resolver, so asset references load correctly in published/preview builds. Use this from preloaders to warm the same cache spawnPrefab reads. |
| clearPrefabCache | Drop one cached prefab (or all when no url is given). |
| spawnPrefab | Instantiate a prefab into a live world at runtime. |
| despawnPrefab | Delete a spawned prefab instance: the root entity plus every descendant (children first). Returns the number of entities removed. dispose releases GPU resources not flagged as shared (safe with the model cache). |
| prefabFileVersionFor | File version to write for a given snapshot: 2 iff it nests instances. |
| parsePrefabAsset | Validate untrusted JSON into a PrefabAsset, or null when malformed. |
| classifyGpu | Rough class of a GPU from its name. |
| readGpuName | The GPU's name from a WebGL context, or a WebGPU adapter's info. |
| detectDevice | - |
| recommendQualityPreset | The preset a device should start on, with the reasons in plain words. |
| presetSettings | The settings fields a preset sets, for a settings screen that shows them. |
| resolveQualityLimits | Settings + the device's recommendation → what to apply. auto takes the recommendation; a named preset its own switches; custom the player's switches, with the pixel-ratio cap of the closest preset. |
| effectivePixelRatio | The pixel ratio to draw at: the device's, capped by the preset, times the player's and the governor's scale. Ultra also stays inside a pixel budget. |
| cullMaskOf | The reasons an object is hidden for, as a bit mask (0: none). |
| setObjectCulled | Hide or show an object for one reason. An entity's own object is drawn when its visibility is on and no reason is left (ObjectVisibilitySystem); any other object (a loaded model inside its entity, a level of detail) is shown here directly. |
| isObjectCulled | - |
| isLodCopy | Whether this object is, or sits inside, an extra level of detail. |
| defaultGameSettings | - |
| normalizeGameSettings | Every field checked and clamped; unknown gameplay keys kept if they're plain JSON. |
| estimateObjectBytes | Estimated GPU bytes an object's meshes hold: every attribute and index buffer, and every texture at 4 bytes a pixel with a third more for mipmaps. Shared geometry and textures are counted once per call. An estimate: the GPU can compress or pad. |
| inputProfilesPathFor | The folder to load a controller's model from: the game's own copy when it has one and the controller reports a bundled profile, else the CDN. |
| passesMask | Whether a terrain point passes a mask. |
| placeInChunk | Where things go in one chunk (terrain space, metres): perSquareMetre tries per square metre, kept where the mask allows and at least spacing from the others. Deterministic, and in random order, so drawing the first N of them thins the chunk evenly. |
| grassShare | Share of a chunk's blades drawn at this distance: all up close, none at the view distance. |
| makeBladeGeometry | A blade: a tapered strip, aHeight 0 at the root and 1 at the tip, coloured base to tip. |
| heightfieldColliderDesc | Rapier's heightfield: (rows + 1) x (cols + 1) heights in column-major order, rows along Z and columns along X, centred on the collider and spanning scale metres. World scale is folded in. |
| valueNoise | Smooth 0-1 value noise. |
| seededRandom | A small seeded random generator (mulberry32), 0-1. |
| impostorView | The direction (0..IMPOSTOR_VIEWS-1) to draw for a viewer at this angle round the model. |
| captureImpostor | Render a model into impostor pictures with the game's own renderer. Restores the renderer's target and clear colour. Returns null when the renderer can't draw into a target (a stand-in in tests, a lost context). |
| chunkLevelFor | The level a chunk this far away draws at: each level skips twice as many points. |
| buildChunkGeometry | Build one chunk's geometry at a level of detail (stride = 2^level grid steps between vertices). Positions are terrain-space; normals come from the heightfield, so chunks at different levels meet with the same shading. A skirt hangs down skirt metres around the edge to hide the cracks where a detailed chunk meets a simpler one. Colours blend the paint layers. |
| forgetUiTheme | Read a theme file again, after it changed on disk. |
| uiIconSvg | The icon as a standalone SVG document, white so a tint can recolour it. strokeWidth is in the 24-unit view box: 2 is Tabler's own, 1.5 reads lighter, 2.5 bolder. |
| mergeUiStyle | over laid on base: each field over sets replaces the base's, except text, motion and the states, which merge field by field. Neither input is changed or shared. |
| colorWithAlpha | #rgb, #rrggbb or #rrggbbaa at an opacity, as rgba(). |
| isUiThemeFile | Whether theme names a file rather than a built-in theme. |
| normalizeUiThemeFile | A clean copy of a theme file's JSON. Anything of the wrong shape is dropped. |
| themeFromFile | The theme a file describes: the built-in theme it extends (holo when it names none or one that doesn't exist) with the file laid over it. |
| setPrefabAssetUrlResolver | Override how prefab asset URLs (the file URL itself AND every asset URL stored inside prefab files) are resolved before fetching. Published/preview runtimes register a resolver that maps the editor's localasset://…/assets/x URLs to ./assets/x; the editor leaves it unset (identity — the localasset:// protocol is fetchable there). Same pattern as setDracoDecoderPath. Pass null to restore identity. |
| setDracoDecoderPath | Override where the DRACO decoder files (draco_wasm_wrapper.js, draco_decoder.wasm, draco_decoder.js) are fetched from. Embedding apps whose bundlers relocate this package's chunks — making the default import.meta.url resolution point at a location that is never populated — should call this before any model loads. The path must end with "/". Pass null to restore the default resolution. |
| resolveDracoDecoderPath | - |
| createGLTFLoader | The one GLTFLoader setup for every model and clip the engine loads. |
| loadSharedGltf | Load a GLTF once per URL and share the parsed result, so repeated spawns of the same model skip both the fetch and the parse. The cached scene must never be mounted directly (an Object3D has a single parent) — mount a cloneModelScene() of it. Failed loads are evicted so a retry re-fetches. |
| clearModelCache | Forget cached models (one URL, or everything). Subsequent loads fetch and parse anew. Does not dispose GPU resources — live clones may still use them. |
| setSharedModelVersionResolver | Tell the shared models how to read a file's version. Without one, a file is loaded once until evictSharedModel forgets it. |
| acquireSharedModel | Load the model at url once and hand out a copy to mount. Every copy shares the load's geometry and textures and has its own materials. Give each copy back with releaseSharedModel when it's no longer used; the load is freed once no copy is left. A failed load is forgotten, so a retry fetches. |
| releaseSharedModel | Give back a copy from acquireSharedModel. When it was the last one, the load is freed after graceMs unless it's acquired again by then. The copy's own materials are the caller's to dispose. Returns false for an object that isn't a copy (or was given back already). |
| getSharedModelCopies | Every copy handed out and not given back yet. |
| evictSharedModel | Forget the model at url (or every model), so the next acquisition loads the file again. Copies in use keep theirs, freed when the last is given back; a load nobody uses is freed now. |
| getSharedModelStats | What's loaded, for debugging and tests. |
| readModelPivot | The pivot stored in a model's geometry parameters, or null when there is none, it isn't three finite numbers, or it's the origin. |
| getModelPivotWrapper | The wrapper holding model (or a stale empty one) under anchor, if any. |
| applyModelPivot | Hang model under anchor moved by -pivot, or straight under it for no pivot. Idempotent and cheap: call it when the model mounts and whenever the pivot may have changed. The model's own local transform is never touched. |
| installAcceleratedRaycast | Route every THREE.Mesh raycast through the engine's accelerated path. Idempotent; the World calls it. Turn it off with setAcceleratedRaycastEnabled to compare. |
| setAcceleratedRaycastEnabled | Turn the hierarchies off (or back on) for every raycast. |
| isAcceleratedRaycastEnabled | - |
| hasRaycastBvh | Whether a geometry has a hierarchy now (for tests and stats). |
| disposeRaycastBvh | Drop a geometry's hierarchy, e.g. after editing its vertices by hand. |
| intersectScene | Intersect roots (recursively). With firstHitOnly, meshes are visited nearest bounding sphere first and the search stops once the next sphere starts beyond the best hit, so a ray through a city tests the few buildings in front instead of all of them. |
| computeFingerCurl | Curl for one finger, or null when the finger isn't tracked well enough. |
| computePalmWidth | Distance across the knuckles — our unit of hand size. |
| estimateHandScale | Characteristic hand size in metres. |
| computePinch | How close a fingertip is to the thumb tip. 1 = touching, 0 = far apart. |
| computeSpread | Angular separation between two fingers. 0 = parallel, 1 = splayed wide. |
| computePalmPose | Palm frame, used for orientation conditions ("palm up", "thumb toward face"). |
| computeHandShape | Reduce tracked joints to the matchable shape. |
| matchHandPose | Score a live hand against a pose. |
| getHandPosePreset | A deep copy of a preset. |
| cloneHandPose | - |
| handPoseFromCurls | Build a pose from five curl values — the shape the editor's sliders and the AI tools produce. |
| createHandMaterial | Build the material for a preset. |
| applyHandMaterial | Apply a preset material to every mesh under a hand model. |
| sampleTeleportArc | Sample a ballistic curve starting at origin heading along direction. |
| arcGroundCrossing | Where a sampled arc first crosses groundY going downward, or null. |
| angularVelocityFrom | Angular velocity from a rotation delta, as an axis-angle vector (rad/s). |
| readXrCapabilities | Read granted features off a live session. |
References ​
Component ​
Re-exports Component
Behaviour ​
Re-exports Behaviour
UiInteractionEvent ​
Re-exports UiInteractionEvent
CoreComponents ​
Renames and re-exports components
EntityId ​
Re-exports EntityId
EcsEntityKind ​
Re-exports EcsEntityKind
EcsEntityEditorKind ​
Re-exports EcsEntityEditorKind
SelectionListener ​
Re-exports SelectionListener
TextInput ​
Re-exports TextInput
FloatInput ​
Re-exports FloatInput
ColorInput ​
Re-exports ColorInput
Vector2Input ​
Re-exports Vector2Input
Vector3Input ​
Re-exports Vector3Input
SliderInput ​
Re-exports SliderInput
DropdownOption ​
Re-exports DropdownOption
DropdownInput ​
Re-exports DropdownInput
CheckboxInput ​
Re-exports CheckboxInput
ToggleInput ​
Re-exports ToggleInput
AssetInput ​
Re-exports AssetInput
EntityInput ​
Re-exports EntityInput
ComponentKind ​
Re-exports ComponentKind
ComponentInput ​
Re-exports ComponentInput
WorldEntityView ​
Re-exports WorldEntityView
ParentLookup ​
Re-exports ParentLookup
Vec3 ​
Re-exports Vec3
RaycastLayers ​
Re-exports RaycastLayers
RaycastOptions ​
Re-exports RaycastOptions
IntersectionResult ​
Re-exports IntersectionResult

