Easy3D 3.0.0
Loading...
Searching...
No Matches
ObjMaterialMesh Struct Reference

CPU-side snapshot of diffuse materials imported from an OBJ/MTL file. More...

#include <obj_materials.h>

Classes

struct  Part
 Tessellated geometry and material properties for one OBJ material group. More...
 

Public Member Functions

void create_drawables () const
 Create one renderer drawable per imported material part.
 

Public Attributes

std::shared_ptr< SurfaceMesh > mesh
 Mesh used to resolve material groups.
 
std::vector< Part > parts
 Imported material-group snapshots.
 

Detailed Description

CPU-side snapshot of diffuse materials imported from an OBJ/MTL file.

Loading requires no graphics context. Parts contain tessellated, seam-preserving attributes and describe the mesh at load time. Reload or rebuild the snapshot after changing mesh topology or attributes.

Member Function Documentation

◆ create_drawables()

void create_drawables ( ) const

Create one renderer drawable per imported material part.

Attach the mesh to a host with create_drawables=false first. Texture representation follows the host renderer backend. Existing drawables with matching names cause std::logic_error; they are not replaced.

Exceptions
std::logic_errorif the mesh has no attached renderer or a part drawable name is already in use.

The documentation for this struct was generated from the following files: