SuperimposeMesh
All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Model Class Reference

#include <Model.h>

Public Member Functions

 Model (const GLchar *path)
 
void Draw (Shader shader)
 
bool has_texture ()
 

Protected Member Functions

void loadModel (std::string path)
 
void processNode (aiNode *node, const aiScene *scene)
 
Mesh processMesh (aiMesh *mesh, const aiScene *scene)
 
GLint TextureFromFile (const char *path, std::string directory)
 
std::vector< Mesh::TextureloadMaterialTextures (aiMaterial *mat, aiTextureType type, std::string typeName)
 

Private Attributes

std::vector< Meshmeshes_
 
std::string directory_
 
std::vector< Mesh::Texturetextures_loaded_
 

Detailed Description

Definition at line 22 of file Model.h.

Constructor & Destructor Documentation

◆ Model()

Model::Model ( const GLchar *  path)

Definition at line 21 of file Model.cpp.

References loadModel().

Here is the call graph for this function:

Member Function Documentation

◆ Draw()

void Model::Draw ( Shader  shader)

Definition at line 27 of file Model.cpp.

References meshes_.

◆ has_texture()

bool Model::has_texture ( )

Definition at line 36 of file Model.cpp.

References textures_loaded_.

◆ loadMaterialTextures()

std::vector< Mesh::Texture > Model::loadMaterialTextures ( aiMaterial *  mat,
aiTextureType  type,
std::string  typeName 
)
protected

Definition at line 139 of file Model.cpp.

References directory_, Mesh::Texture::id, Mesh::Texture::path, TextureFromFile(), textures_loaded_, and Mesh::Texture::type.

Referenced by processMesh().

Here is the call graph for this function:

◆ loadModel()

void Model::loadModel ( std::string  path)
protected

Definition at line 42 of file Model.cpp.

References directory_, and processNode().

Referenced by Model().

Here is the call graph for this function:

◆ processMesh()

Mesh Model::processMesh ( aiMesh *  mesh,
const aiScene *  scene 
)
protected

Definition at line 84 of file Model.cpp.

References loadMaterialTextures(), Mesh::Vertex::Normal, Mesh::Vertex::Position, and Mesh::Vertex::TexCoords.

Referenced by processNode().

Here is the call graph for this function:

◆ processNode()

void Model::processNode ( aiNode *  node,
const aiScene *  scene 
)
protected

Definition at line 67 of file Model.cpp.

References meshes_, and processMesh().

Referenced by loadModel().

Here is the call graph for this function:

◆ TextureFromFile()

GLint Model::TextureFromFile ( const char *  path,
std::string  directory 
)
protected

Definition at line 176 of file Model.cpp.

Referenced by loadMaterialTextures().

Member Data Documentation

◆ directory_

std::string Model::directory_
private

Definition at line 45 of file Model.h.

Referenced by loadMaterialTextures(), and loadModel().

◆ meshes_

std::vector<Mesh> Model::meshes_
private

Definition at line 43 of file Model.h.

Referenced by Draw(), and processNode().

◆ textures_loaded_

std::vector<Mesh::Texture> Model::textures_loaded_
private

Definition at line 47 of file Model.h.

Referenced by has_texture(), and loadMaterialTextures().


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