|
Untitled
|
Mesh functions that modify and initialize Mesh data. More...
#include "core/engine_types.h"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. | |
| int find_mn_by_name | ( | char | name[256] | ) |
Finds a Mesh inside of Globals.meshes via string.
| name | The name to compare. |
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().
| void build_adjacency_map | ( | Mesh * | mesh | ) |
Builds a map of TriangleAdjacency over adjacent MeshFaces on the Mesh.
| mesh | The Mesh to build over. |
Definition at line 96 of file mesh.c.
References TriangleAdjacency::adjacent_indices, Vector::buffer, build_adjacency_map(), CAST_VEC, Vector::count, edge_pair_table, get_welded_key(), WeldedEntry::index, MeshFace::indices, init_vector(), EdgePairEntry::key, WeldedEntry::key, Mesh::tri_adjacency, EdgePairEntry::tris, Mesh::tris, vector_expand(), Mesh::vertices, and welded_table.
Referenced by build_adjacency_map(), and init_mesh().
Deduplicates vertices.
| in_verts | The vec3s of the ConvexHull. |
| faces | The 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().
| void incremental_hull | ( | ConvexHull * | hull | ) |
Deduplicates vertices.
| in_verts | The vec3s of the ConvexHull. |
| faces | The MeshFaces of the ConvexHull. |
Definition at line 782 of file mesh.c.
References ConvexHull::aabb, add_horizon_face_to_hull_faces(), Vector::buffer, Vector::capacity, CAST_VEC, ConvexHull::centroid, check_horizon_edges(), clean_up_hull(), compute_aabb_from_points(), Vector::count, ConvexHull::faces, incremental_hull(), MeshFace::indices, init_vector(), MeshFace::normal, REMOVE_FROM_VEC, setup_initial_hull_points(), uv, vec3_dot(), vec3_equal(), vec3_sub(), vector_expand(), and ConvexHull::vertices.
Referenced by incremental_hull(), init_mesh(), and init_player().
| void compute_mesh_hulls | ( | ConvexHull * | hull | ) |
Combines contiguous triangles with same normals into one face.
Important for more efficient physics / manifold clipping.
| in_verts | The vec3s of the ConvexHull. |
| faces | The MeshFaces of the ConvexHull. |
Definition at line 962 of file mesh.c.
References A, B, Vector::buffer, C, CAST_VEC, compute_hull_faces(), compute_mesh_hulls(), HullFace::count, Vector::count, ConvexHull::faces, ConvexHull::hull_faces, HullFace::indices, MeshFace::indices, TriangleGroup::indices, init_vector(), is_similar_plane(), mesh_faces_are_contiguous(), HullFace::normal, MeshFace::normal, TriangleGroup::normal, TriangleGroup::ref_point, triangle_area(), vec3_equal(), vector_expand(), ConvexHull::vertices, and vec3::z.
Referenced by compute_mesh_hulls(), init_mesh(), and init_player().