Untitled
Loading...
Searching...
No Matches
mesh.h File Reference

Mesh functions that modify and initialize Mesh data. More...

Go to the source code of this file.

Functions

int find_mn_by_name (char name[256])
 Finds a Mesh inside of Globals.meshes via string.
void build_adjacency_map (Mesh *mesh)
 Builds a map of TriangleAdjacency over adjacent MeshFaces on the Mesh.
void deduplicate (Vector *in_verts, Vector *faces)
 Deduplicates vertices.
void incremental_hull (ConvexHull *hull)
 Deduplicates vertices.
void compute_mesh_hulls (ConvexHull *hull)
 Combines contiguous triangles with same normals into one face.

Detailed Description

Mesh functions that modify and initialize Mesh data.

Definition in file mesh.h.

Function Documentation

◆ find_mn_by_name()

int find_mn_by_name ( char name[256])

Finds a Mesh inside of Globals.meshes via string.

Parameters
nameThe name to compare.
Returns
The index of the mesh.
Warning
Returns -1 on failure.

Definition at line 229 of file mesh.c.

References CAST_VEC, Vector::count, find_mn_by_name(), MeshNode::free, GLOBALS, Globals::mesh_nodes, and MeshNode::name.

Referenced by find_mn_by_name(), and load_lightmap_from_binary().

◆ build_adjacency_map()

◆ deduplicate()

void deduplicate ( Vector * in_verts,
Vector * faces )

Deduplicates vertices.

Parameters
in_vertsThe vec3s of the ConvexHull.
facesThe MeshFaces of the ConvexHull.

Definition at line 248 of file mesh.c.

References Vector::buffer, CAST_VEC, Vector::count, deduplicate(), MeshFace::indices, init_vector(), vec3_equal(), and vector_expand().

Referenced by clean_up_hull(), and deduplicate().

◆ incremental_hull()

◆ compute_mesh_hulls()

void compute_mesh_hulls ( ConvexHull * hull)