### Install dependencies and start development server Source: https://hilo3d.js.org/docs/index.html Run these commands to install the required dependencies and start the development environment. Requires Node.js 20.19.0 or newer. ```bash npm ci npm run dev ``` -------------------------------- ### start Source: https://hilo3d.js.org/docs/classes/Hilo3d.LoadQueue.html Starts loading the queue. ```APIDOC ## start ### Description Starts loading the queue. ### Method start ### Signature start(): this ### Returns this ``` -------------------------------- ### install Source: https://hilo3d.js.org/docs/classes/Hilo3d.StageSystemRegistry.html Installs one System and recompiles the frame schedule. ```APIDOC ## install ### Description Installs one System and recompiles the frame schedule. ### Signature `install(system: StageSystem): Promise` ### Parameters - **system** (StageSystem) - Required - The system to install. ### Returns - **Promise** - A promise that resolves when the system is installed. ``` -------------------------------- ### start() Source: https://hilo3d.js.org/docs/classes/Hilo3d.Tween.html Starts the tween animation. ```APIDOC ## start() ### Description Starts the tween animation. ### Method start(): this ### Returns this - The current Tween instance. ``` -------------------------------- ### start Source: https://hilo3d.js.org/docs/classes/Hilo3d.Ticker.html Starts the ticker. ```APIDOC ## start(): void ### Description Starts the ticker. ### Returns - **void** ``` -------------------------------- ### setup Source: https://hilo3d.js.org/docs/classes/Hilo3d.PresentRenderPass.html Declares sampled inputs and raster attachments. ```APIDOC ## setup ### Description Declares sampled inputs and raster attachments. ### Signature `setup(builder: ScriptableRenderPassBuilder, parameters: FullscreenRenderPassParameters): void` ### Parameters - **builder** (ScriptableRenderPassBuilder) - Required - The render pass builder. - **parameters** (FullscreenRenderPassParameters) - Required - The fullscreen render pass parameters. ### Returns - **void** ``` -------------------------------- ### play Source: https://hilo3d.js.org/docs/classes/Hilo3d.Sprite.html Starts playing the sprite animation. ```APIDOC ## play ### Description Starts playing the sprite animation. ### Method play ### Parameters No parameters documented. ### Returns No return value documented. ``` -------------------------------- ### play() Source: https://hilo3d.js.org/docs/classes/Hilo3d.Sprite.html Starts or resumes sequence playback. ```APIDOC ## play() ### Description Start or resume sequence playback. ### Method Signature `play(): this` ### Parameters None ### Returns - `this` - The current Sprite instance for chaining. ``` -------------------------------- ### has Source: https://hilo3d.js.org/docs/classes/Hilo3d.StageSystemRegistry.html Returns whether a System identity is currently installed. ```APIDOC ## has ### Description Returns whether a System identity is currently installed. ### Signature `has(id: string): boolean` ### Parameters - **id** (string) - Required - The identifier of the System. ### Returns - **boolean** - True if the System is installed, false otherwise. ``` -------------------------------- ### setup Source: https://hilo3d.js.org/docs/interfaces/Hilo3d.StageSystem.html Creates a fresh runtime for one Stage. Accepts a StageSystemSetupContext and returns a StageSystemRuntime or a Promise of it. ```APIDOC ## setup(context: StageSystemSetupContext): StageSystemRuntime | Promise ### Description Creates a fresh runtime for one Stage. ### Method setup ### Parameters - **context** (StageSystemSetupContext) - Required - The context for setting up the stage system. ### Returns StageSystemRuntime | Promise ``` -------------------------------- ### setup(builder, parameters) Source: https://hilo3d.js.org/docs/classes/Hilo3d.GPUDrivenRenderPass.html Declares shader resources, vertex/index/indirect inputs, and raster attachments. ```APIDOC ## Method: setup(builder, parameters) ### Description Declares shader resources, vertex/index/indirect inputs, and raster attachments. ### Parameters - **builder** (ScriptableRenderPassBuilder) - Required - The render pass builder. - **parameters** (GPUDrivenRenderPassParameters) - Required - Parameters for the render pass. ### Returns - **void** ``` -------------------------------- ### get Source: https://hilo3d.js.org/docs/classes/Hilo3d.StageSystemRegistry.html Reads a required typed service published by an installed System. ```APIDOC ## get ### Description Reads a required typed service published by an installed System. ### Signature `get(service: StageSystemService): T` ### Type Parameters - **T** - The type of the service. ### Parameters - **service** (StageSystemService) - Required - The service descriptor to read. ### Returns - **T** - The service instance. ``` -------------------------------- ### setup(builder, parameters) Source: https://hilo3d.js.org/docs/classes/Hilo3d.FullscreenRenderPass.html Declares sampled inputs and raster attachments. ```APIDOC ## setup(builder, parameters) ### Description Declares sampled inputs and raster attachments. ### Method `setup(builder: ScriptableRenderPassBuilder, parameters: FullscreenRenderPassParameters): void` ### Parameters - **builder** (ScriptableRenderPassBuilder) - Required - The render pass builder. - **parameters** (FullscreenRenderPassParameters) - Required - Parameters for the render pass. ### Returns - **void** ``` -------------------------------- ### setup Source: https://hilo3d.js.org/docs/classes/Hilo3d.ComputeRenderPass.html Declares storage, texture, and indirect dependencies from the immutable shader ABI. ```APIDOC ## setup ### Description Declares storage, texture, and indirect dependencies from the immutable shader ABI. ### Signature `setup(builder: ScriptableRenderPassBuilder, parameters: ComputeRenderPassParameters): void` ### Parameters - **builder** (ScriptableRenderPassBuilder) - Required - The render pass builder. - **parameters** (ComputeRenderPassParameters) - Required - The parameters for the compute pass. ### Returns - **void** ``` -------------------------------- ### Install Hilo3D via npm Source: https://hilo3d.js.org/docs/index.html Use this command to install the Hilo3D package in your project. ```bash npm install hilo3d ``` -------------------------------- ### get(index) Source: https://hilo3d.js.org/docs/classes/Hilo3d.GeometryData.html Gets the value at the specified index. Note: returns the same reference for performance; use getCopy for a copy. ```APIDOC ## get(index) ### Description Gets the value at the specified index. Note: returns the same reference for performance; use getCopy for a copy. ### Method get ### Signature get(index: number): GeometryAttributeValue ### Parameters - **index** (number) - Required - The index of the value to retrieve. ### Returns GeometryAttributeValue - The value at the given index (same reference). ``` -------------------------------- ### setup Source: https://hilo3d.js.org/docs/classes/Hilo3d.SceneRenderPass.html Declares attachments and the renderer list without issuing commands. ```APIDOC ## setup(builder: ScriptableRenderPassBuilder, parameters: SceneRenderPassParameters): void ### Description Declares attachments and the renderer list without issuing commands. ### Parameters - **builder** (ScriptableRenderPassBuilder) - Required - The builder used to declare attachments and renderer list. - **parameters** (SceneRenderPassParameters) - Required - The parameters for the scene pass. ### Returns void ``` -------------------------------- ### Semantic Variables Source: https://hilo3d.js.org/docs/variables/Hilo3d.semantic.html A collection of semantic variable objects, each with a get method that retrieves a value for shader programs. The get method takes a SemanticMesh, SemanticMaterial, and ProgramBindingInfo as parameters. ```APIDOC ## Semantic Variables ### Description Each semantic variable is an object with a `get` method that retrieves a value for shader programs. The `get` method takes a `SemanticMesh`, `SemanticMaterial`, and `ProgramBindingInfo` as parameters and returns a value (often `unknown`). Some variables have additional properties like `isDependMesh` or `notSupportInstanced`. ### Variables #### MODELVIEWINVERSE - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### MODELVIEWINVERSETRANSPOSE - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### MODELVIEWPROJECTION - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### MODELVIEWPROJECTIONINVERSE - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### MORPHWEIGHTS - **isDependMesh**: boolean - **notSupportInstanced**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### NORMAL - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### NORMALDECODEMAT - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### NORMALMAPSCALE - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### OBJECTIDCOLOR - **isDependMesh**: boolean - **notSupportInstanced**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): Float32Array** - Stable per-mesh rgba8unorm identity used by backend-neutral GPU picking passes. #### OCCLUSIONSTRENGTH - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### OPAQUETEXTURE - **get(): unknown** #### POINTLIGHTCAMERA - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSCOLOR - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSINFO - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSPACEMATRIX - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSPOS - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSRANGE - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSSHADOWBIAS - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTLIGHTSSHADOWMAP - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POINTSHADOWMATRICES - **get(): unknown** #### POSITION - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### POSITIONDECODEMAT - **isDependMesh**: boolean - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### PROJECTION - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### PROJECTIONINVERSE - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### REFLECTIVITY - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### REFRACTIVITY - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### REFRACTRATIO - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### renderer - **SemanticRenderer | null** - Active backend-neutral renderer dimensions. #### RENDERERSIZE - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### ROUGHNESS - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### SHADOWATLAS - **get(_mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### SHADOWATLASRECTS - **get(): unknown** #### SHADOWATLASSIZE - **get(): unknown** #### SHININESS - **get(mesh: SemanticMesh, material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### SKININDICES - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** #### SKINWEIGHTS - **get(mesh: SemanticMesh, _material: SemanticMaterial, _programInfo: ProgramBindingInfo): unknown** ``` -------------------------------- ### installSystem(system: StageSystem): Promise> Source: https://hilo3d.js.org/docs/classes/Hilo3d.Stage.html Installs an optional addon system after the stage is ready. Returns a promise resolving to the stage. ```APIDOC ## installSystem(system: StageSystem): Promise> ### Description Install one optional addon after this Stage is ready. ### Method installSystem ### Parameters - **system** (StageSystem) - Required - The system to install. ### Returns - **Promise>** - A promise that resolves to the stage. ``` -------------------------------- ### Semantic Getter Methods Source: https://hilo3d.js.org/docs/variables/Hilo3d.semantic.html Each semantic variable is an object with a get method that retrieves a shader uniform value. The get method accepts a SemanticMesh, SemanticMaterial, and optionally ProgramBindingInfo, and returns the computed value. ```APIDOC ## Semantic Getter Methods ### Description Each semantic variable is an object with a get method that retrieves a shader uniform value. The get method accepts a SemanticMesh, SemanticMaterial, and optionally ProgramBindingInfo, and returns the computed value. ### Method get ### Parameters - **mesh** (SemanticMesh) - Required - The mesh object. - **material** (SemanticMaterial) - Required - The material object. - **_programInfo** (ProgramBindingInfo) - Optional - Program binding information. ### Returns - **unknown** - The computed semantic value. ### Example ```typescript const value = THICKNESSFACTOR.get(mesh, material); ``` ``` -------------------------------- ### y Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets or sets the y coordinate of the node. ```APIDOC ## y ### Description Gets or sets the y coordinate of the node. ### Accessors `get y(): number` `set y(value: number): void` ### Parameters (setter) - **value** (number) - The y coordinate. ### Returns (getter) - **number** - The y coordinate. ``` -------------------------------- ### initialize Source: https://hilo3d.js.org/docs/classes/Hilo3d.StageSystemRegistry.html Initializes an entire System set transactionally. Intended for `Stage.create()`. ```APIDOC ## initialize ### Description Initializes an entire System set transactionally. Intended for `Stage.create()`. ### Signature `initialize(systems: readonly StageSystem[]): Promise` ### Parameters - **systems** (readonly StageSystem[]) - Required - The array of systems to initialize. ### Returns - **Promise** - A promise that resolves when initialization is complete. ``` -------------------------------- ### execute Source: https://hilo3d.js.org/docs/classes/Hilo3d.SceneRenderPass.html Applies optional dynamic state and draws the setup-declared renderer list. ```APIDOC ## execute(context: ScriptableRenderPassContext, parameters: SceneRenderPassParameters): void ### Description Applies optional dynamic state and draws the setup-declared renderer list. ### Parameters - **context** (ScriptableRenderPassContext) - Required - The render pass context. - **parameters** (SceneRenderPassParameters) - Required - The parameters for the scene pass. ### Returns void ``` -------------------------------- ### getGeometry Source: https://hilo3d.js.org/docs/classes/Hilo3d.Camera2D.html Gets the geometry of the camera. ```APIDOC ## getGeometry ### Description Gets the geometry of the camera. ### Method getGeometry ### Signature `getGeometry()` ### Returns - **Geometry** - The geometry. ``` -------------------------------- ### getSize Source: https://hilo3d.js.org/docs/classes/Hilo3d.Geometry.html Gets the size of the geometry. ```APIDOC ## getSize ### Description Gets the size of the geometry. ### Method `getSize()` ``` -------------------------------- ### Static create(params?) Source: https://hilo3d.js.org/docs/classes/Hilo3d.Stage.html Constructs and awaits a Stage instance using the WebGPU-first automatic backend policy. Returns a Promise resolving to a Stage instance. ```APIDOC ## Static create(params?) ### Description Constructs and awaits a Stage instance using the WebGPU-first automatic backend policy. Returns a Promise resolving to a Stage instance. ### Method Signature create(params?: StageParameters<"auto">): Promise> ### Parameters - **params** (StageParameters<"auto">) - Optional - Parameters for stage construction. ### Returns - **Promise>** - A promise that resolves to the constructed Stage instance. ``` -------------------------------- ### getBounds Source: https://hilo3d.js.org/docs/classes/Hilo3d.Geometry.html Gets the bounds of the geometry. ```APIDOC ## getBounds ### Description Gets the bounds of the geometry. ### Method `getBounds()` ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.AutoExposure.html Creates a new AutoExposure instance with optional configuration options. ```APIDOC ## constructor ### Description Creates a new AutoExposure instance with optional configuration options. ### Method constructor ### Signature new AutoExposure(options?: Readonly): AutoExposure ### Parameters - **options** (Readonly) - Optional - Configuration options for the auto exposure feature. Defaults to {}. ### Returns AutoExposure - The newly created AutoExposure instance. ``` -------------------------------- ### getShaderKey Source: https://hilo3d.js.org/docs/classes/Hilo3d.BoxGeometry.html Gets the shader key. ```APIDOC ## getShaderKey ### Description Gets the shader key. ### Method Signature `getShaderKey(): string` ### Returns - `string` - The shader key. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.ScreenSpaceGlobalIllumination.html Creates a new ScreenSpaceGlobalIllumination instance with optional configuration options. ```APIDOC ## constructor ### Description Creates a new ScreenSpaceGlobalIllumination instance with optional configuration options. ### Signature new ScreenSpaceGlobalIllumination(options?: Readonly): ScreenSpaceGlobalIllumination ### Parameters - **options** (Readonly) - Optional - Configuration options for the feature. ### Returns - **ScreenSpaceGlobalIllumination** - The new instance. ``` -------------------------------- ### FullscreenRenderPass Source: https://hilo3d.js.org/docs/media/hilo3d.api.md The FullscreenRenderPass class implements ScriptableRenderPass and is used to render fullscreen effects. It provides methods to execute, setup, and manage the render pass with associated shader, pipeline state, and uniform buffers. ```APIDOC ## FullscreenRenderPass ### Description The FullscreenRenderPass class implements ScriptableRenderPass and is used to render fullscreen effects. It provides methods to execute, setup, and manage the render pass with associated shader, pipeline state, and uniform buffers. ### Constructor - `constructor(options: Readonly)` - Creates a new FullscreenRenderPass instance with the given options. ### Properties - `name: string` (readonly) - The name of the render pass. - `pipelineState: Readonly` (readonly) - The pipeline state used for rendering. - `shader: Shader` (readonly) - The shader used for rendering. - `uniformBuffers: readonly UniformBuffer[]` (readonly) - The uniform buffers used for rendering. ### Methods - `execute(context: ScriptableRenderPassContext, parameters: FullscreenRenderPassParameters): void` - Executes the render pass with the given context and parameters. - `setup(builder: ScriptableRenderPassBuilder, parameters: FullscreenRenderPassParameters): void` - Sets up the render pass with the given builder and parameters. ``` -------------------------------- ### getRenderOption Source: https://hilo3d.js.org/docs/classes/Hilo3d.BoxGeometry.html Gets the render options. ```APIDOC ## getRenderOption ### Description Gets the render options. ### Method Signature `getRenderOption(opt?: ShaderOptions): ShaderOptions` ### Parameters - `opt` (ShaderOptions) - Optional, default = {} - The shader options. ### Returns - `ShaderOptions` - The render options. ``` -------------------------------- ### Create a basic Hilo3D scene Source: https://hilo3d.js.org/docs/index.html Initializes a PerspectiveCamera, a Stage, a Mesh with PBRMaterial, and an AmbientLight. The Stage.create() method is asynchronous due to backend and GPU initialization. ```javascript import * as Hilo3d from 'hilo3d'; const camera = new Hilo3d.PerspectiveCamera({ aspect: innerWidth / innerHeight, z: 4 }); const stage = await Hilo3d.Stage.create({ backend: 'auto', container: document.querySelector('#app')!, camera, width: innerWidth, height: innerHeight }); new Hilo3d.Mesh({ geometry: new Hilo3d.BoxGeometry(), material: new Hilo3d.PBRMaterial({ baseColor: new Hilo3d.Color(0.83, 0.12, 0.09) }) }).addTo(stage); stage.addChild(new Hilo3d.AmbientLight({ amount: 1 })); const ticker = new Hilo3d.Ticker(60); ticker.addTick(stage); ticker.start(); ``` -------------------------------- ### Fog Source: https://hilo3d.js.org/docs/media/hilo3d.api.md The Fog class represents fog parameters for rendering. It provides methods to retrieve fog information and render options, and includes properties for color, density, start, end, and mode. ```APIDOC ## Fog ### Description The Fog class encapsulates fog parameters used in rendering. It supports linear, exponential, and exponential squared fog modes. ### Constructor - `constructor(params?: FogParameters)` - Creates a Fog instance with optional parameters. ### Methods #### getInfo(): Float32Array | number Returns fog information as a Float32Array or a number, depending on the fog mode. #### getRenderOption(option?: Record): Record Returns render options for the fog, optionally merging with provided options. ### Properties - `className: string` - Class name. - `color: Color` - Fog color. - `density: number` - Fog density (for EXP and EXP2 modes). - `end: number` - Fog end distance (for LINEAR mode). - `id: string` (readonly) - Unique identifier. - `isFog: boolean` - Indicates if this is a fog object. - `mode: FogMode` - Fog mode: 'LINEAR', 'EXP', or 'EXP2'. - `start: number` - Fog start distance (for LINEAR mode). ### Type Definitions - `FogMode = 'LINEAR' | 'EXP' | 'EXP2'` - Fog mode type. - `FogParameters` - Interface with optional properties: color, density, end, mode, start. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.PBRMaterial.html Creates a new PBRMaterial instance. ```APIDOC ## constructor ### Description Creates a new PBRMaterial instance. ### Method constructor ### Parameters None documented. ### Returns - **PBRMaterial** - A new PBRMaterial instance. ``` -------------------------------- ### getWorldDirection Source: https://hilo3d.js.org/docs/classes/Hilo3d.SpotLight.html Gets the world direction of this node. ```APIDOC ## getWorldDirection ### Description Gets the world direction of this node. ### Method `getWorldDirection(): Vector3` ### Returns `Vector3` - The world direction. ``` -------------------------------- ### Initialize a Texture with BasicLoader Source: https://hilo3d.js.org/docs/classes/Hilo3d.Texture.html Demonstrates how to load an image using BasicLoader and instantiate a new Texture object with the loaded image. ```javascript const loader = new Hilo3d.BasicLoader(); loader.load({ src: './textures/base-color.jpg', crossOrigin: true }).then(img => { return new Hilo3d.Texture({ image: img }); }); ``` -------------------------------- ### GeometryData methods Source: https://hilo3d.js.org/docs/media/hilo3d.api.md Methods for accessing and manipulating geometry data, including get, set, clone, copy, and sub-data updates. ```APIDOC ## GeometryData methods ### clearSubData() Clears all sub-data updates. ### clone(): GeometryData Returns a clone of this GeometryData. ### copy(geometryData: GeometryData): this Copies data from another GeometryData instance. ### get(index: number): GeometryAttributeValue Returns the attribute value at the given index. ### getByOffset(offset: number): GeometryAttributeValue Returns the attribute value at the given byte offset. ### getByteLength(): number Returns the byte length of the data. ### getCopy(index: number): GeometryAttributeValue Returns a copy of the attribute value at the given index. ### getOffset(index: number): number Returns the byte offset for the given index. ### getSubDataUpdatesSince(revision: number): readonly SubDataUpdate[] | null Returns sub-data updates since the given revision. ### set(index: number, value: GeometryAttributeValue): number Sets the attribute value at the given index and returns the new revision. ### setByOffset(offset: number, value: GeometryAttributeValue): void Sets the attribute value at the given byte offset. ### setSubData(offset: number, data: TypedArray): void Sets sub-data at the given offset. ### traverse(callback: GeometryDataTraverseCallback): boolean Traverses all attribute values. ### traverseByComponent(callback: GeometryDataComponentCallback): boolean Traverses by component. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.CameraHelper.html Creates a new CameraHelper instance. The constructor initializes the camera helper with default settings. ```APIDOC ## constructor ### Description Creates a new CameraHelper instance. The constructor initializes the camera helper with default settings. ### Method constructor ### Syntax new Hilo3d.CameraHelper() ### Parameters None ### Returns - **CameraHelper** - A new CameraHelper instance. ### Example ```js const cameraHelper = new Hilo3d.CameraHelper(); ``` ``` -------------------------------- ### y accessor Source: https://hilo3d.js.org/docs/classes/Hilo3d.Vector3.html Gets or sets the Y component of the vector. ```APIDOC ## y accessor ### Description Gets or sets the Y component of the vector. ### Getter - **get y(): number** - Returns the Y component. ### Setter - **set y(value: number): void** - Sets the Y component. #### Parameters - **value** (number) - The new Y component value. #### Returns - **void** ``` -------------------------------- ### Cache Source: https://hilo3d.js.org/docs/media/hilo3d.api.md A generic cache class for storing and retrieving values by string IDs or object references. Provides methods to add, get, remove, and iterate over cached entries. ```APIDOC ## Cache ### Description A generic cache class for storing and retrieving values by string IDs or object references. Provides methods to add, get, remove, and iterate over cached entries. ### Constructor - **new Cache()** - Creates a new cache instance. ### Methods - **add(id: string, value: Value): void** - Adds a value to the cache with the given string ID. - **each(callback: (value: Value, id: string) => void): void** - Iterates over all cache entries, invoking the callback with each value and its ID. - **get(id: string): Value | undefined** - Retrieves the value associated with the given string ID, or undefined if not found. - **getObject(object: object): Value | undefined** - Retrieves the value associated with the given object reference, or undefined if not found. - **remove(id: string): void** - Removes the entry with the given string ID. - **removeAll(): void** - Removes all entries from the cache. - **removeObject(object: object): void** - Removes the entry associated with the given object reference. ### Properties - **size: number** - (internal) The number of entries in the cache. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.ColorUber.html Creates a new ColorUber instance with optional configuration options. ```APIDOC ## constructor ### Description Creates a new ColorUber instance with optional configuration options. ### Method constructor ### Signature `new ColorUber(options?: Readonly): ColorUber` ### Parameters - **options** (Readonly) - Optional - Configuration options for the ColorUber instance. Defaults to `{}`. ### Returns - **ColorUber** - The newly created ColorUber instance. ``` -------------------------------- ### scale Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the scale of the node as a Vector3Notifier. ```APIDOC ## scale ### Description Gets the scale of the node. ### Accessor `get scale(): Vector3Notifier` ### Returns - **Vector3Notifier** - The scale of the node. ``` -------------------------------- ### Static create Source: https://hilo3d.js.org/docs/classes/Hilo3d.Renderer.html Constructs a Renderer instance. Resolves an optional 'auto' policy and awaits backend readiness. Supports multiple overloads for different backend options. ```APIDOC ## Static create ### Description Constructs a Renderer instance. Resolves an optional 'auto' policy and awaits backend readiness. ### Method create ### Overloads #### Overload 1 ##### Signature create(options?: RendererAutoOptions): Promise> ##### Parameters - **options** (RendererAutoOptions) - Optional - Options for auto backend selection. ##### Returns Promise> - A promise that resolves to a Renderer instance. #### Overload 2 ##### Signature create(options: RendererWebGL2Options): Promise> ##### Parameters - **options** (RendererWebGL2Options) - Required - Options for WebGL2 backend. ##### Returns Promise> - A promise that resolves to a Renderer instance with WebGL2 backend. #### Overload 3 ##### Signature create(options: RendererWebGPUOptions): Promise> ##### Parameters - **options** (RendererWebGPUOptions) - Required - Options for WebGPU backend. ##### Returns Promise> - A promise that resolves to a Renderer instance with WebGPU backend. #### Overload 4 ##### Signature create(options: RendererOptions): Promise> ##### Type Parameters - **Backend** extends RendererBackend - The backend type. ##### Parameters - **options** (RendererOptions) - Required - Options for the specified backend. ##### Returns Promise> - A promise that resolves to a Renderer instance with the specified backend. ``` -------------------------------- ### rotation Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the Euler rotation of the node. ```APIDOC ## rotation ### Description Gets the Euler rotation of the node. ### Accessor `get rotation(): EulerNotifier` ### Returns - **EulerNotifier** - The Euler rotation. ``` -------------------------------- ### new CameraHelper(params?: CameraHelperParameters) Source: https://hilo3d.js.org/docs/classes/Hilo3d.CameraHelper.html Creates a new CameraHelper instance with optional initialization parameters. ```APIDOC ## new CameraHelper(params?: CameraHelperParameters) ### Description Creates a new CameraHelper instance with optional initialization parameters. ### Constructor `new CameraHelper(params?: CameraHelperParameters): CameraHelper` ### Parameters - **params** (CameraHelperParameters) - Optional - 初始化参数 ### Returns CameraHelper ``` -------------------------------- ### quaternion Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the quaternion rotation of the node. ```APIDOC ## quaternion ### Description Gets the quaternion rotation of the node. ### Accessor `get quaternion(): Quaternion` ### Returns - **Quaternion** - The quaternion rotation. ``` -------------------------------- ### position Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the position of the node as a Vector3Notifier. ```APIDOC ## position ### Description Gets the position of the node. ### Accessor `get position(): Vector3Notifier` ### Returns - **Vector3Notifier** - The position of the node. ``` -------------------------------- ### init Source: https://hilo3d.js.org/docs/interfaces/Hilo3d.GLTFExtensionHandler.html Optional method to initialize the extension handler with the loader and parser. ```APIDOC ## init ### Description Optional method to initialize the extension handler with the loader and parser. ### Method N/A (interface method) ### Endpoint N/A ### Parameters - **loader** (GLTFResourceLoader) - Required - The GLTF resource loader. - **parser** (GLTFParser) - Required - The GLTF parser instance. ### Returns unknown ``` -------------------------------- ### Common development utility commands Source: https://hilo3d.js.org/docs/index.html Useful npm scripts for local development, including running the example gallery, type checking, testing, and full validation. ```bash npm run examples:dev # run the example gallery locally npm run typecheck # check maintained TypeScript npm run test # run the test suite npm run validate # run the full release validation ``` -------------------------------- ### pivotY Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets or sets the y component of the pivot. ```APIDOC ## pivotY ### Description Gets or sets the y component of the pivot. ### Accessors `get pivotY(): number` `set pivotY(value: number): void` ### Parameters (setter) - **value** (number) - The new y component of the pivot. ### Returns (getter) - **number** - The y component of the pivot. ``` -------------------------------- ### matrix Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the matrix of the node as a Matrix4Notifier. ```APIDOC ## matrix ### Description Gets the matrix of the node. ### Accessor `get matrix(): Matrix4Notifier` ### Returns - **Matrix4Notifier** - The matrix of the node. ``` -------------------------------- ### Methods Source: https://hilo3d.js.org/docs/classes/Hilo3d.CameraHelper.html Lists the methods available on CameraHelper instances. ```APIDOC ## Methods ### Description These methods can be called on CameraHelper instances. ### Method List - **_firePointerEvent** (event) - Fires a pointer event. - **_onMatrixUpdate** () - Internal callback for matrix update. - **_onPivotUpdate** () - Internal callback for pivot update. - **_onPositionUpdate** () - Internal callback for position update. - **_onQuaternionUpdate** () - Internal callback for quaternion update. - **_onRotationUpdate** () - Internal callback for rotation update. - **_onScaleUpdate** () - Internal callback for scale update. - **addChild** (child) - Adds a child node. - **addTo** (parent) - Adds this node to a parent. - **clone** () - Clones this node. - **destroy** () - Destroys this node. - **fire** (event) - Fires an event. - **getBounds** () - Gets the bounding box. - **getChildByFn** (fn) - Gets a child by a function. - **getChildByFnBFS** (fn) - Gets a child by a function using breadth-first search. - **getChildById** (id) - Gets a child by id. - **getChildByName** (name) - Gets a child by name. - **getChildByNamePath** (path) - Gets a child by name path. - **getChildrenByBaseClassName** (className) - Gets children by base class name. - **getChildrenByClassName** (className) - Gets children by class name. - **getChildrenByFn** (fn) - Gets children by a function. - **getChildrenByName** (name) - Gets children by name. - **getChildrenNameMap** () - Gets a map of children names. - **getConcatenatedMatrix** () - Gets the concatenated matrix. - **getRenderOption** () - Gets the render option. - **invalidateTransformHistory** () - Invalidates the transform history. - **lookAt** (target) - Makes the node look at a target. - **off** (event) - Removes an event listener. - **on** (event, callback) - Adds an event listener. - **raycast** (ray) - Performs raycasting. - **removeChild** (child) - Removes a child node. - **removeFromParent** () - Removes this node from its parent. - **resetSkinnedMeshRootNode** () - Resets the skinned mesh root node. - **setAnim** (anim) - Sets the animation. - **setPivot** (pivot) - Sets the pivot. - **setPosition** (position) - Sets the position. - **setRotation** (rotation) - Sets the rotation. - **setScale** (scale) - Sets the scale. - **traverse** (callback) - Traverses the node tree. - **traverseBFS** (callback) - Traverses the node tree using breadth-first search. - **traverseUpdate** (callback) - Traverses and updates. - **update** () - Updates the node. - **updateMatrix** () - Updates the local matrix. - **updateMatrixWorld** () - Updates the world matrix. - **updateQuaternion** () - Updates the quaternion. - **updateTransform** () - Updates the transform. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.PerspectiveCamera.html Creates a new PerspectiveCamera instance. ```APIDOC ## constructor ### Description Creates a new PerspectiveCamera instance. ### Method constructor ### Signature `new PerspectiveCamera()` ### Parameters None. ### Returns - **PerspectiveCamera** - A new PerspectiveCamera instance. ``` -------------------------------- ### getBounds Source: https://hilo3d.js.org/docs/classes/Hilo3d.Sprite.html Gets the bounding box of the sprite. ```APIDOC ## getBounds ### Description Gets the bounding box of the sprite. ### Method getBounds ### Parameters No parameters documented. ### Returns Bounds object. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Creates a new Node instance with optional initial properties. ```APIDOC ## constructor ### Description Creates a new Node instance with optional initial properties. ### Method constructor ### Parameters - **properties** (Object) - Optional - Initial properties to set on the node. ### Example ```js const node = new Hilo3d.Node({ name:'test', x:100, rotationX:30, onUpdate(){ this.rotationY ++; } }); node.scaleX = 0.3; stage.addChild(node); ``` ``` -------------------------------- ### getBounds Source: https://hilo3d.js.org/docs/classes/Hilo3d.Node.html Gets the bounding box of this node. ```APIDOC ## getBounds ### Description Gets the bounding box of this node. ### Method getBounds ### Returns - (Object) - The bounding box. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.Camera2D.html Creates a new Camera2D instance. ```APIDOC ## constructor ### Description Creates a new Camera2D instance. ### Method constructor ### Signature `new Camera2D(param?: Object)` ### Parameters - **param** (Object) - Optional - Initialization parameters. ``` -------------------------------- ### projectionMatrix Source: https://hilo3d.js.org/docs/classes/Hilo3d.PerspectiveCamera.html Gets or sets the projection matrix. ```APIDOC ## projectionMatrix ### Description Gets or sets the projection matrix. ### Accessor - **get** - Returns the current projection matrix. - **set** - Sets the projection matrix. ### Parameters (set) - **value** (Matrix4) - The projection matrix to set. ### Returns (get) - **Matrix4** - The current projection matrix. ``` -------------------------------- ### getRenderOption Source: https://hilo3d.js.org/docs/classes/Hilo3d.Geometry.html Gets the render option for the geometry. ```APIDOC ## getRenderOption ### Description Gets the render option for the geometry. ### Method `getRenderOption()` ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.BasicMaterial.html Creates a new BasicMaterial instance with optional parameters. ```APIDOC ## constructor ### Description Creates a new BasicMaterial instance. ### Signature `new BasicMaterial(params?: Readonly): BasicMaterial` ### Parameters - **params** (Readonly) - Optional. Defaults to `{}`. ### Returns - **BasicMaterial** - The new material instance. ``` -------------------------------- ### enable Source: https://hilo3d.js.org/docs/classes/Hilo3d.OrbitControls.html Attaches pointer, wheel, touch, and context-menu listeners to the canvas. ```APIDOC ## enable ### Description Attach pointer, wheel, touch, and context-menu listeners to the canvas. ### Method enable ### Signature `enable(): void` ### Parameters None ### Returns - **void** - No return value. ``` -------------------------------- ### getConcatenatedMatrix Source: https://hilo3d.js.org/docs/classes/Hilo3d.Camera2D.html Gets the concatenated matrix of a node. ```APIDOC ## getConcatenatedMatrix ### Description Gets the concatenated matrix of a node. ### Method getConcatenatedMatrix ### Signature `getConcatenatedMatrix(node: Node, out: Matrix4)` ### Parameters - **node** (Node) - Required - The node to get the matrix for. - **out** (Matrix4) - Required - The output matrix. ### Returns - **Matrix4** - The concatenated matrix. ``` -------------------------------- ### get Source: https://hilo3d.js.org/docs/classes/Hilo3d.LoadCache.html Retrieves a cache file by key. ```APIDOC ## get(key) ### Description Retrieves a cache file by key. ### Method `get(key: string): LoadCacheFile | null` ### Parameters - `key` (string) - Required - The cache key. ### Returns `LoadCacheFile | null` - The cache file or null if not found. ``` -------------------------------- ### Initialize and set Ray from Camera Source: https://hilo3d.js.org/docs/classes/Hilo3d.Ray.html Creates a new Ray instance and configures it based on camera parameters and screen coordinates. ```javascript const ray = new Hilo3d.Ray(); ray.fromCamera(camera, 10, 10, stage.width, stage.height); ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.Skeleton.html Creates a new Skeleton instance with optional parameters. ```APIDOC ## constructor ### Description Creates a new Skeleton instance. ### Method constructor ### Signature `new Skeleton(params?: SkeletonParameters): Skeleton` ### Parameters - **params** (SkeletonParameters) - Optional - 创建对象的属性参数。可包含此类的所有属性。 ### Returns - **Skeleton** - The new Skeleton instance. ``` -------------------------------- ### getSupportSize Source: https://hilo3d.js.org/docs/classes/Hilo3d.DataTexture.html Gets the supported size for the texture. ```APIDOC ## getSupportSize ### Description Gets the supported size for the texture. ### Method getSupportSize ### Signature `getSupportSize(): { width: number, height: number }` ### Returns - **width** (number) - The supported width. - **height** (number) - The supported height. ``` -------------------------------- ### getSphereBounds Source: https://hilo3d.js.org/docs/classes/Hilo3d.BoxGeometry.html Gets the sphere bounding box. ```APIDOC ## getSphereBounds ### Description Gets the sphere bounding box. ### Method Signature `getSphereBounds(matrix?: Matrix4): Sphere` ### Parameters - `matrix` (Matrix4) - Optional - The matrix to transform. ### Returns - `Sphere` - The sphere bounding box. ``` -------------------------------- ### constructor Source: https://hilo3d.js.org/docs/classes/Hilo3d.StageSystemService.html Creates a new StageSystemService instance with a given name. ```APIDOC ## new StageSystemService(name: string): StageSystemService ### Description Creates a new StageSystemService instance with the specified name. ### Parameters - **name** (string) - Required - Human-readable token name used in diagnostics. ### Returns StageSystemService - The new service instance. ``` -------------------------------- ### new KTXLoader() Source: https://hilo3d.js.org/docs/classes/Hilo3d.KTXLoader.html Creates a new KTXLoader instance. ```APIDOC ## new KTXLoader() ### Description Creates a new KTXLoader instance. ### Constructor new KTXLoader(): KTXLoader ### Returns KTXLoader ``` -------------------------------- ### getLocalBounds Source: https://hilo3d.js.org/docs/classes/Hilo3d.BoxGeometry.html Gets the local bounding box. ```APIDOC ## getLocalBounds ### Description Gets the local bounding box. ### Method Signature `getLocalBounds(force?: boolean): Bounds` ### Parameters - `force` (boolean) - Optional, default = false - Whether to force refresh. ### Returns - `Bounds` - The local bounding box. ``` -------------------------------- ### RendererWebGPUOptions Source: https://hilo3d.js.org/docs/interfaces/Hilo3d.RendererWebGPUOptions.html Configuration options for creating a WebGPU renderer. ```APIDOC ## Interface RendererWebGPUOptions ### Description WebGPU renderer creation options. ### Properties #### `Optional` alpha - **Type**: `boolean` - **Description**: Whether the canvas has an alpha channel. #### `Optional` antialias - **Type**: `boolean` - **Description**: Whether to enable antialiasing. #### backend - **Type**: `"webgpu"` - **Description**: The backend identifier, must be `"webgpu"`. #### `Optional` cameraRelative - **Type**: `boolean` - **Description**: Subtract one frame-wide camera origin from GPU camera/model transforms while preserving CPU world coordinates. This improves large-world precision and enables stable temporal inputs. #### `Optional` clearColor - **Type**: `Color` - **Description**: The clear color for the renderer. #### `Optional` depth - **Type**: `boolean` - **Description**: Whether to enable depth testing. #### `Optional` domElement - **Type**: `HTMLCanvasElement | null` - **Description**: The canvas element to render to. #### `Optional` failIfMajorPerformanceCaveat - **Type**: `boolean` - **Description**: Whether to fail if a major performance caveat is detected. #### `Optional` fog - **Type**: `Fog | null` - **Description**: The fog effect to apply. #### `Optional` forceFallbackAdapter - **Type**: `boolean` - **Description**: Whether to force the fallback adapter. #### `Optional` forceMaterial - **Type**: `MaterialInstance | null` - **Description**: Force a specific material instance. #### `Optional` fragmentPrecision - **Type**: `ShaderPrecision` - **Description**: The precision for fragment shaders. #### `Optional` height - **Type**: `number` - **Description**: The height of the renderer. #### `Optional` offsetX - **Type**: `number` - **Description**: The x offset of the renderer. #### `Optional` offsetY - **Type**: `number` - **Description**: The y offset of the renderer. #### `Optional` pixelRatio - **Type**: `number` - **Description**: The pixel ratio for the renderer. #### `Optional` powerPreference - **Type**: `RendererAdapterPowerPreference` - **Description**: The power preference for the GPU adapter. #### `Optional` premultipliedAlpha - **Type**: `boolean` - **Description**: Whether to use premultiplied alpha. #### `Optional` preserveDrawingBuffer - **Type**: `undefined` - **Description**: WebGPU has no preserved default framebuffer. #### `Optional` renderingProfile - **Type**: `RendererRenderingProfile` - **Description**: Renderer policy bundle. Defaults to `portable`. #### `Optional` renderPipeline - **Type**: `RenderPipelineFactory` - **Description**: Renderer-local scriptable pipeline factory. Defaults to ForwardRenderPipelineFactory. #### `Optional` requiredFeatures - **Type**: `readonly RendererFeatureName[]` - **Description**: Required GPU features. #### `Optional` requiredLimits - **Type**: `Readonly>` - **Description**: Required GPU limits. #### `Optional` shadowUpdateMode - **Type**: `RendererShadowUpdateMode` - **Description**: Shadow-atlas update policy. Defaults to `paged`; use `full` for fully dynamic scenes. #### `Optional` stencil - **Type**: `boolean` - **Description**: Whether to enable stencil testing. #### `Optional` useInstanced - **Type**: `boolean` - **Description**: Whether to use instanced rendering. #### `Optional` useLogDepth - **Type**: `boolean` - **Description**: Whether to use logarithmic depth buffer. #### `Optional` vertexPrecision - **Type**: `ShaderPrecision` - **Description**: The precision for vertex shaders. #### `Optional` width - **Type**: `number` - **Description**: The width of the renderer. ``` -------------------------------- ### getViewDirection Source: https://hilo3d.js.org/docs/classes/Hilo3d.SpotLight.html Gets the view direction relative to a camera. ```APIDOC ## getViewDirection ### Description Gets the view direction relative to a camera. ### Method `getViewDirection(camera: Camera): Vector3` ### Parameters - `camera` (Camera) - The camera to compute the view direction from. ### Returns `Vector3` - The view direction. ``` -------------------------------- ### new BasicLoader() Source: https://hilo3d.js.org/docs/classes/Hilo3d.BasicLoader.html Creates a new BasicLoader instance. ```APIDOC ## new BasicLoader() ### Description Creates a new BasicLoader instance. ### Constructor `new BasicLoader(): BasicLoader` ### Returns - **BasicLoader** - A new BasicLoader instance. ```