stdlib/meshView source ↗
mesh
18 items · generated by scribe fromstdlib/mesh.fd· synced 2026-11-15
Contents
- Vertex (struct)
- TexCoord (struct)
- Face (struct)
- Mesh (struct)
- mesh_create (function)
- vertex_create (function)
- texcoord_create (function)
- face_create (function)
- mesh_create_cube (function)
- mesh_create_plane (function)
- mesh_load_obj (function)
- mesh_compute_normals (function)
- mesh_transform (function)
- mesh_triangle_count (function)
- mesh_vertex_count (function)
- mesh_free (function)
Vertex
pub struct Vertex {Fields:
| Name | Type |
|---|---|
x | f64 |
y | f64 |
z | f64 |
Defined at line 21
TexCoord
pub struct TexCoord {Fields:
| Name | Type |
|---|---|
u | f64 |
v | f64 |
Defined at line 27
Face
pub struct Face {Fields:
| Name | Type |
|---|---|
v0 | i64 |
v1 | i64 |
v2 | i64 |
t0 | i64 |
t1 | i64 |
t2 | i64 |
n0 | i64 |
n1 | i64 |
n2 | i64 |
Defined at line 32
Mesh
pub struct Mesh {Fields:
| Name | Type |
|---|---|
vertices | Vec<Vertex> |
normals | Vec<Vertex> |
texcoords | Vec<TexCoord> |
faces | Vec<Face> |
valid | bool |
name | str |
Defined at line 46
mesh_create
pub fn mesh_create() -> Mesh {Returns: Mesh
Defined at line 61
vertex_create
Create a Vertex.
pub fn vertex_create(x: f64, y: f64, z: f64) -> Vertex {Parameters:
x:f64y:f64z:f64
Returns: Vertex
Defined at line 68
texcoord_create
Create a TexCoord.
pub fn texcoord_create(u: f64, v: f64) -> TexCoord {Parameters:
u:f64v:f64
Returns: TexCoord
Defined at line 75
face_create
Create a Face.
pub fn face_create(v0: i64, v1: i64, v2: i64) -> Face {Parameters:
v0:i64v1:i64v2:i64
Returns: Face
Defined at line 82
mesh_create_cube
Create a cube mesh (24 vertices, 12 triangles).
pub fn mesh_create_cube(size: f64) -> Mesh {Parameters:
size:f64
Returns: Mesh
Defined at line 89
mesh_create_plane
Create a plane mesh (in XZ plane, centered at origin).
pub fn mesh_create_plane(width: f64, depth: f64) -> Mesh {Parameters:
width:f64depth:f64
Returns: Mesh
Defined at line 171
mesh_load_obj
Load a mesh from an OBJ file. In the interpreter, this returns an invalid mesh (no file I/O). In native builds, the runtime reads the file and parses OBJ format.
pub fn mesh_load_obj(path: str) -> Mesh {Parameters:
path:str
Returns: Mesh
Defined at line 217
mesh_compute_normals
Compute per-face normals and store them as per-vertex normals. This is a flat (non-smoothed) normal computation.
pub fn mesh_compute_normals(m: & mut Mesh) -> void {Parameters:
m:& mut Mesh
Returns: void
Defined at line 385
mesh_transform
Transform all vertices by a mat4.
pub fn mesh_transform(m: & mut Mesh, mat: mat4) -> void {Parameters:
m:& mut Meshmat:mat4
Returns: void
Defined at line 437
mesh_triangle_count
Get the number of triangles in the mesh.
pub fn mesh_triangle_count(m: & Mesh) -> i64 {Parameters:
m:& Mesh
Returns: i64
Defined at line 454
mesh_vertex_count
Get the number of vertices in the mesh.
pub fn mesh_vertex_count(m: & Mesh) -> i64 {Parameters:
m:& Mesh
Returns: i64
Defined at line 459
mesh_free
Free mesh data.
pub fn mesh_free(m: & mut Mesh) -> void {Parameters:
m:& mut Mesh
Returns: void
Defined at line 464
Generated by scribe, the Fides documentation generator