2021SC@SDUSC
目录
2.GetBoundingSphere和ComputeBoundingSphere
在前几节的内容中提到了ModelLoaeder类,本节就正式来讲Model类的内容。
Model
与Shader与Texture一样,Model同样在最开始将自身的loader作为友元类,同时我们可以看到所谓的模型(model)就是一系列网格的结合。
namespace Loaders { class ModelLoader; }
/**
* A model is a combinaison of meshes
*/
class Model
{
friend class Loaders::ModelLoader;
public:
/**
* Returns the meshes
*/
const std::vector<Mesh*>& GetMeshes() const;
/**
* Returns the material names
*/
const std::vector<std::string>& GetMaterialNames() const;
/**
* Returns the bounding sphere of the model
*/
const OvRendering::Geometry::BoundingSphere& GetBoundingSphere() const;
private:
Model(const std::string& p_path);
~Model();
void ComputeBoundingSphere();
public:
const std::string path;
private:
std::vector<Mesh*> m_meshes;
std::vector<std::string> m_materialNames;
Geometry::Bound