ComputerGraphik TU WIEN
|
Encapsulates a graphical object model in the GPU. More...
#include <model.hpp>
Public Member Functions | |
Model (const std::vector< float > &positions, const std::vector< unsigned int > &indices, const std::vector< unsigned int > &adjacentIndices, const std::vector< float > &normals, const std::vector< float > &uvs, Texture *texture=0) | |
~Model () | |
GLuint | getPosition () const |
GLuint | getNormals () const |
GLuint | getIndices () const |
GLuint | getIndicesAdj () const |
GLuint | getUVs () const |
size_t | getIndexCount () const |
size_t | getIndexAdjCount () const |
Texture * | getTexture () const |
float | getShininess () const |
glm::vec4 | getDiffuse () const |
glm::vec4 | getAmbient () const |
glm::vec4 | getSpecular () const |
void | setShininess (float val) |
void | setTexture (Texture *val) |
void | setDiffuse (const glm::vec4 &val) |
void | setAmbient (const glm::vec4 &val) |
void | setSpecular (const glm::vec4 &val) |
Static Public Member Functions | |
static void | getTerrainModel (size_t width, size_t height, size_t bitPerPixel, float cellSize, std::vector< unsigned char > &data, std::vector< float > &heights, std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs) |
static void | getCubeModel (std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs) |
static void | getQuadModel (std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &uvs, float width, float height) |
static void | getSphereModel (std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs) |
static void | loadModels (const std::string &modelPath, std::vector< std::unique_ptr< Model > > &models) |
Private Types | |
enum | { VBO_POSITIONS = 0, VBO_NORMALS = 1, VBO_INDICES = 2, VBO_UVS = 3, VBO_ADJ_INDICES = 4, VBO_COUNT = 5 } |
Private Attributes | |
GLuint | vbo [VBO_COUNT] |
size_t | indexCount |
size_t | indexAdjCount |
Texture * | texture |
float | shininess |
glm::vec4 | diffuse |
glm::vec4 | ambient |
glm::vec4 | specular |
Encapsulates a graphical object model in the GPU.
|
private |
Model::Model | ( | const std::vector< float > & | positions, |
const std::vector< unsigned int > & | indices, | ||
const std::vector< unsigned int > & | adjacentIndices, | ||
const std::vector< float > & | normals, | ||
const std::vector< float > & | uvs, | ||
Texture * | texture = 0 |
||
) |
Model::~Model | ( | ) |
|
inline |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
inline |
|
inline |
|
static |
|
static |
|
inline |
|
inline |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |