This engine's representation of a single unrigged 3D model.
More...
#include <model.hpp>
|
| | StaticModel (const std::vector< std::shared_ptr< StaticMesh > > &meshHandles, const std::vector< std::shared_ptr< Material > > &materialHandles) |
| | Constructs a model out of a list of handles to meshes and materials.
|
|
| ~StaticModel () |
| | Model destructor.
|
|
| StaticModel (StaticModel &&other) |
| | Move constructor.
|
|
| StaticModel (const StaticModel &other) |
| | Copy constructor.
|
|
StaticModel & | operator= (StaticModel &&other) |
| | Move assignment.
|
|
StaticModel & | operator= (const StaticModel &other) |
| | Copy assignment.
|
| std::vector< std::shared_ptr< StaticMesh > > | getMeshHandles () const |
| | Gets the list of StaticMeshes associated with this Model object.
|
| std::vector< std::shared_ptr< Material > > | getMaterialHandles () const |
| | Gets the materials associated with this model object.
|
| void | setBounds (const ObjectBounds &newBounds) |
| | Sets a new object oriented bounding box for this object.
|
|
ObjectBounds | getBounds () const |
| | Returns the latest computed bounding box encapsulating the model in its untransformed state.
|
| const bool | boundsNeedRecompute () const |
| | Indicates whether this static model requires its bounding box recomputed.
|
| std::string | getResourceTypeName_ () const override |
| | Get the resource type string for this resource.
|
|
virtual | ~IResource ()=default |
| | Destroy the IResource object.
|
|
|
void | free () |
| | Utility method for destroying resources associated with this model.
|
|
void | stealResources (StaticModel &other) |
| | Utility method for taking resources from another instance of this class.
|
|
void | copyResources (const StaticModel &other) |
| | Utility method for deeply replicating resources from another instance of this class.
|
|
void | destroyResource () |
| | Destroys the resources associated with this object.
|
|
void | releaseResource () |
| | Releases resources associated with this object so that they may be claimed by another part of the program.
|
|
|
std::vector< std::shared_ptr< StaticMesh > > | mMeshHandles {} |
| | The meshes that make up this model.
|
|
std::vector< std::shared_ptr< Material > > | mMaterialHandles {} |
| | The materials that correspond to each mesh on this model.
|
|
ObjectBounds | mCoarseBounds {} |
| | The coarse object bounds for this model, used mainly for mouse picking.
|
|
bool | mCoarseBoundsDirty { true } |
| | Whether any of the meshes under this object has been modified, requiring a recompute of this object's bounds.
|
This engine's representation of a single unrigged 3D model.
This object:
- Stores references to all the meshes used by the model
- Stores the hierarchical relationship between the meshes
- Stores material properties used by shaders for each mesh
- See also
- toymaker/core/ecs_world_resource_ext.hpp
◆ StaticModel()
| StaticModel::StaticModel |
( |
const std::vector< std::shared_ptr< StaticMesh > > & | meshHandles, |
|
|
const std::vector< std::shared_ptr< Material > > & | materialHandles ) |
Constructs a model out of a list of handles to meshes and materials.
Every mesh in the mesh list must have its material reference in the same index of the material list.
- Parameters
-
| meshHandles | List of meshes making up this model. |
| materialHandles | The materials corresponding to each mesh. |
◆ boundsNeedRecompute()
| const bool ToyMaker::StaticModel::boundsNeedRecompute |
( |
| ) |
const |
|
inline |
Indicates whether this static model requires its bounding box recomputed.
Usually done at start up, or when an underlying mesh has been modified.
◆ getComponentTypeName()
| std::string ToyMaker::StaticModel::getComponentTypeName |
( |
| ) |
|
|
inlinestatic |
Gets the component type string for this object.
- Returns
- std::string This type's component type string.
◆ getMaterialHandles()
| std::vector< std::shared_ptr< Material > > StaticModel::getMaterialHandles |
( |
| ) |
const |
Gets the materials associated with this model object.
- Returns
- std::vector<std::shared_ptr<Material>> This model's materials.
◆ getMeshHandles()
| std::vector< std::shared_ptr< StaticMesh > > StaticModel::getMeshHandles |
( |
| ) |
const |
Gets the list of StaticMeshes associated with this Model object.
- Returns
- std::vector<std::shared_ptr<StaticMesh>> This model's meshes.
◆ getResourceTypeName()
| std::string ToyMaker::StaticModel::getResourceTypeName |
( |
| ) |
|
|
inlinestatic |
Gets the resource type string for this object.
- Returns
- std::string This type's resource type string.
◆ setBounds()
| void ToyMaker::StaticModel::setBounds |
( |
const ObjectBounds & | newBounds | ) |
|
|
inline |
Sets a new object oriented bounding box for this object.
This is usually done once at start up, or when an underlying mesh has been modified.
The documentation for this class was generated from the following files:
- ToyMaker_Main/include/toymaker/engine/model.hpp
- ToyMaker_Main/src/model.cpp