meat/engine/scene/Mesh.ts
2026-08-04 02:09:54 +02:00

11 lines
558 B
TypeScript

import type { Vec2 } from "../math/Vec2"
import type { Vec3 } from "../math/Vec3"
/** One mesh vertex: a world-space position and its texture coordinate. uv is in
* tile units, not 0..1, so values >1 repeat the texture (see Texture.sample). */
export type Vertex = { pos: Vec3; uv: Vec2 }
/** Indexed triangle mesh in world space. `indices` holds three entries per
* triangle, each indexing into `vertices`; sharing vertices between triangles
* keeps seams welded and shrinks the data. */
export type Mesh = { vertices: Vertex[]; indices: number[] }