12#ifndef TOYMAKERENGINE_MODEL_H
13#define TOYMAKERENGINE_MODEL_H
21#include <assimp/Importer.hpp>
22#include <assimp/scene.h>
23#include <assimp/material.h>
24#include <nlohmann/json.hpp>
75 StaticModel(
const std::vector<std::shared_ptr<StaticMesh>>& meshHandles,
const std::vector<std::shared_ptr<Material>>& materialHandles);
246 std::shared_ptr<IResource>
createResource(
const nlohmann::json& methodParameters)
override;
ResourceConstructor(int explicitlyInitializeMe)
Definition resource_database.hpp:488
Resource(int explicitlyInitializeMe)
Definition resource_database.hpp:386
StaticModelFromFile()
Creates a StaticModelFromFile object.
Definition model.cpp:98
std::shared_ptr< IResource > createResource(const nlohmann::json &methodParameters) override
Creates a StaticModel resource based on its parameters.
Definition model.cpp:102
static std::string getResourceConstructorName()
Gets the resource constructor type string for this constructor.
Definition model.hpp:235
This engine's representation of a single unrigged 3D model.
Definition model.hpp:50
const bool boundsNeedRecompute() const
Indicates whether this static model requires its bounding box recomputed.
Definition model.hpp:128
void destroyResource()
Destroys the resources associated with this object.
Definition model.cpp:93
std::vector< std::shared_ptr< StaticMesh > > getMeshHandles() const
Gets the list of StaticMeshes associated with this Model object.
Definition model.cpp:70
std::vector< std::shared_ptr< StaticMesh > > mMeshHandles
The meshes that make up this model.
Definition model.hpp:134
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.
Definition model.cpp:28
ObjectBounds getBounds() const
Returns the latest computed bounding box encapsulating the model in its untransformed state.
Definition model.hpp:119
void stealResources(StaticModel &other)
Utility method for taking resources from another instance of this class.
Definition model.cpp:77
std::vector< std::shared_ptr< Material > > getMaterialHandles() const
Gets the materials associated with this model object.
Definition model.cpp:71
void free()
Utility method for destroying resources associated with this model.
Definition model.cpp:72
void setBounds(const ObjectBounds &newBounds)
Sets a new object oriented bounding box for this object.
Definition model.hpp:110
ObjectBounds mCoarseBounds
The coarse object bounds for this model, used mainly for mouse picking.
Definition model.hpp:146
void releaseResource()
Releases resources associated with this object so that they may be claimed by another part of the pro...
Definition model.cpp:96
~StaticModel()
Model destructor.
Definition model.cpp:39
std::vector< std::shared_ptr< Material > > mMaterialHandles
The materials that correspond to each mesh on this model.
Definition model.hpp:140
static std::string getResourceTypeName()
Gets the resource type string for this object.
Definition model.hpp:57
static std::string getComponentTypeName()
Gets the component type string for this object.
Definition model.hpp:64
bool mCoarseBoundsDirty
Whether any of the meshes under this object has been modified, requiring a recompute of this object's...
Definition model.hpp:153
StaticModel & operator=(StaticModel &&other)
Move assignment.
Definition model.cpp:47
void copyResources(const StaticModel &other)
Utility method for deeply replicating resources from another instance of this class.
Definition model.cpp:87
Header file that makes Resource objects useable as ECS components.
Functions related to rendering materials.
A file containing the ToyMaker::StaticMesh class and related structures.
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition application.hpp:25
Classes and structs representing data related to the engine's spatial query system (the precursor to ...
A component defining the true bounds of a spatially queryable object situated somewhere in the world.
Definition types.hpp:845