API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceMeshOptions

@codexo/exojs / rendering / stable

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.

7
props
0
methods
0
events
Import
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.

Properties7
colors?: Uint32Array<ArrayBufferLike>
Triangle indices. A Uint16Array is the cheaper default; supply a Uint32Array for geometry addressing more than 65 536 vertices. The width is kept as authored - see Mesh.indexFormat.
uvs?: Float32Array<ArrayBufferLike>
vertices?: Float32Array<ArrayBufferLike>
Source