20 #ifndef ANTKEEPER_GEOM_MESH_FUNCTIONS_HPP
21 #define ANTKEEPER_GEOM_MESH_FUNCTIONS_HPP
39 void create_triangle_mesh(mesh& mesh,
const std::vector<float3>& vertices,
const std::vector<std::array<std::uint_fast32_t, 3>>& triangles);
void calculate_face_normals(float3 *normals, const mesh &mesh)
Calculates normals for each face.
void create_triangle_mesh(mesh &mesh, const std::vector< float3 > &vertices, const std::vector< std::array< std::uint_fast32_t, 3 >> &triangles)
Creates a triangle mesh from a list of vertices and indices.
box< float > calculate_bounds(const mesh &mesh)
Calculates the AABB bounds of a mesh.
mesh::vertex * poke_face(mesh &mesh, std::size_t index)
Triangulates a face by adding a new vertex in the center, then creating triangles between the edges o...
void calculate_vertex_tangents(float4 *tangents, const float2 *texcoords, const float3 *normals, const mesh &mesh)
Calculates smooth tangents per-vertex.
float3 calculate_face_normal(const mesh::face &face)
@ index
General purpose index (uint)