Container for a set of 3D triangle meshes stored on the GPU, combined with associated materials.
More...
#include <donut/graphics/Model.hpp>
|
struct | Object |
| A single 3D mesh with an associated material. More...
|
|
|
static const Model *const | QUAD |
| Pointer to the statically allocated storage for the built-in quad model. More...
|
|
static const Model *const | CUBE |
| Pointer to the statically allocated storage for the built-in cube model. More...
|
|
Container for a set of 3D triangle meshes stored on the GPU, combined with associated materials.
- Examples
- example_game.cpp.
◆ Model() [1/2]
donut::graphics::Model::Model |
( |
std::vector< Object > |
objects | ) |
|
|
inlineexplicitnoexcept |
Construct a model from a list of meshes.
- Parameters
-
objects | meshes that define the model. |
◆ Model() [2/2]
donut::graphics::Model::Model |
( |
const Filesystem & |
filesystem, |
|
|
const char * |
filepath |
|
) |
| |
Load a model from a virtual file.
The supported file formats are:
- Parameters
-
filesystem | virtual filepath to load the files from. |
filepath | virtual filepath of the model file to load. |
- Exceptions
-
File::Error | on failure to open the file. |
graphics::Error | on failure to load a model from the file. |
std::bad_alloc | on allocation failure. |
- Note
- The file format is determined entirely from the file contents; the filename extension is not taken into account.
-
Any material libraries and texture image files required by the model are also loaded as needed. See the documentation of Image for a description of the supported image file formats.
◆ QUAD
const Model* const donut::graphics::Model::QUAD |
|
static |
Pointer to the statically allocated storage for the built-in quad model.
- Warning
- This pointer must not be dereferenced in application code. It is not guaranteed that the underlying model will be present at all times.
- Examples
- example_game.cpp.
◆ CUBE
const Model* const donut::graphics::Model::CUBE |
|
static |
Pointer to the statically allocated storage for the built-in cube model.
- Warning
- This pointer must not be dereferenced in application code. It is not guaranteed that the underlying model will be present at all times.
- Examples
- example_game.cpp.
◆ objects
std::vector<Object> donut::graphics::Model::objects |
List of objects defined by the loaded model.
The documentation for this struct was generated from the following file: