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.
- Transform object_to_texture
- Transformation from object space to texture (bounding box) space.
- Box3f bbox_w
- The bounds, after transformation (in world space)
- Box3f bbox_o
- The bounds, before transformation (in object space)
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 in/out | The parent Surface (typically the scene) to add to. |
self in | A shared_ptr version of this |
j in | 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.