Mesh struct
#include <darts/mesh.h>
A triangle mesh.
This class stores a triangle mesh object and provides numerous functions for querying the individual triangles. Subclasses of Mesh
implement the specifics of how to create its contents (e.g. by loading from an external file)
Base classes
- class Surface
- This is the abstract superclass for all surfaces.
Constructors, destructors, conversion operators
Public functions
Public variables
- vector<Vec3f> vs
- Vertex positions.
- vector<Vec3f> ns
- Vertex normals.
- vector<Vec2f> uvs
- Vertex texture coordinates.
- vector<Vec3i> Fv
- Vertex indices per face (triangle)
- vector<Vec3i> Fn
- Normal indices per face (triangle)
- vector<Vec3i> Ft
- Texture indices per face (triangle)
- vector<uint32_t> Fm
- One material index per face (triangle)
- vector<shared_ptr<const Material>> materials
- All materials in the mesh.
- Transform xform
- Transformation that the data has already been transformed by.
- Box3f bbox
- The bounds, after transformation.
Function documentation
void Mesh:: add_to_parent(Surface* parent,
shared_ptr<Surface> self,
const json& j) override
Add this surface to the parent
surface.
Parameters | |
---|---|
parent | The parent Surface (typically the scene) to add to. |
self | A shared_ptr version of this |
j | The json parameters used to create self |
By default this function just calls add_
This function is used by aggregate surfaces that shouldn't themselves be added to the scene (like a mesh), but instead need to create other surfaces (individual triangles) that get added to the scene.