#include <geometry.h>
Public Member Functions | |
| void | calc_face_normals () |
| Recalculate per-face normals using normalized dot-products of directions of face edges. | |
| void | calc_vertex_normals () |
| Recalculate per-vertex normals using precalculated face normals with some smoothing. | |
| void | create_index_buffer_and_batches () |
| Generate index buffer, and, in the same time, list of "batches" referencing spans in that index buffer. | |
Public Attributes | |
| std::vector< vertex_t > | vertices |
| list of vertices | |
| std::vector< face_t > | faces |
| list of faces | |
| std::vector< index_t > | indices |
| list of indices | |
| std::vector< batch_t > | batches |
| list of batches of triangles | |
Basically, the mesh is collection of following primitives:
|
|||||||||
|
Recalculate per-face normals using normalized dot-products of directions of face edges.
|
|
|||||||||
|
Recalculate per-vertex normals using precalculated face normals with some smoothing.
|
|
|||||||||
|
Generate index buffer, and, in the same time, list of "batches" referencing spans in that index buffer. Vertices in the index buffer are sorted by material, so each such "span" is associated with single material. |
|
|||||
|
list of vertices
|
|
|||||
|
list of faces
|
|
|||||
|
list of indices
|
|
|||||
|
list of batches of triangles Each batch hold ONLY triangles having similar material |
1.3.6