API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceMeshOptions
Construction-time options for a Mesh. Provide the geometry in exactly one of two forms: - **Convenience form** - a flat `vertices` array of (x, y) pairs in local space, with optional `uvs`, per-vertex `colors`, and `indices`. This is the simplest path: `new Mesh({ vertices })`. - **Geometry form** - a Geometry object whose standard attributes (`a_position`/`position`, `a_texcoord`/`texcoord`, `a_color`/`color`) are read into the mesh: `new Mesh({ geometry })`. The geometry must use the `triangle-list` topology. Supplying both `vertices` and `geometry`, or neither, throws. When present, `uvs` must match the vertex count (as (u, v) pairs) and `colors` must supply one packed-RGBA8 u32 per vertex. `indices` are optional - if absent, the vertex stream is drawn as a flat triangle list (3*N vertices = N triangles). A texture is optional; a textured mesh samples it at the supplied UVs while an untextured mesh paints solid vertex colors only. Validation is enforced at construction; any mismatch throws. For custom shaders/uniforms/textures, attach a MeshMaterial.
import { MeshOptions } from '@codexo/exojs'Construction-time options for a Mesh.
Provide the geometry in exactly one of two forms:
- **Convenience form** - a flat `vertices` array of (x, y) pairs in local space, with optional `uvs`, per-vertex `colors`, and `indices`. This is the simplest path: `new Mesh({ vertices })`. - **Geometry form** - a Geometry object whose standard attributes (`a_position`/`position`, `a_texcoord`/`texcoord`, `a_color`/`color`) are read into the mesh: `new Mesh({ geometry })`. The geometry must use the `triangle-list` topology.
Supplying both `vertices` and `geometry`, or neither, throws.
When present, `uvs` must match the vertex count (as (u, v) pairs) and `colors` must supply one packed-RGBA8 u32 per vertex. `indices` are optional - if absent, the vertex stream is drawn as a flat triangle list (3*N vertices = N triangles). A texture is optional; a textured mesh samples it at the supplied UVs while an untextured mesh paints solid vertex colors only.
Validation is enforced at construction; any mismatch throws.
For custom shaders/uniforms/textures, attach a MeshMaterial.
colors?: Uint32Array<ArrayBufferLike>texture?: RenderTextureAn off-screen render target that can also be sampled as a texture. Combines RenderTarget (framebuffer attachment) with the sampler parameters of a Texture (sca… | TextureA static GPU texture sourced from an image, canvas, or video element. Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (… | nulluvs?: Float32Array<ArrayBufferLike>vertices?: Float32Array<ArrayBufferLike>