Level H Engine
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mesh Class Reference

Creates an object from an text file, this can then be used with OpenGL. More...

#include <Mesh.h>

Collaboration diagram for Mesh:
Collaboration graph

Public Member Functions

 Mesh (std::string objFileName)
 Creates a vertex array object using a obj file location and OpenGL. More...
 
 Mesh (Primitives::PrimativeType primType)
 Creates a vertex array object using a primitive type. More...
 
 Mesh (std::string fileName, bool heightmap)
 Creates a vertex array object using a file location and OpenGL. More...
 
 Mesh (std::string objFileName, std::string textureFileName)
 Creates a vertex array object using a obj file location and OpenGL. More...
 
 Mesh (std::string fileName, std::string textureFileName, bool heightmap)
 Creates a vertex array object using a file location and OpenGL. More...
 
 ~Mesh ()
 Destructs an Object. More...
 
GLuint getVAO ()
 Returns the vertex array object. More...
 
GLuint getTextureID ()
 Returns the Texture ID. More...
 
unsigned int getNumberOfVertices ()
 Returns the number of vertices. More...
 
Vec3 getMaxVert ()
 Returns the max vertices. More...
 
Vec3 getMinVert ()
 Returns the min vertices. More...
 
unsigned int getNumIndices ()
 Returns the number of indices. More...
 
bool checkHeightmap ()
 Checks if it is heightmap. More...
 
bool checkPrimitive ()
 Checks if it is primative. More...
 

Private Member Functions

void initialiseTexture (std::vector< float > vertexTextures)
 Initialise the texture. More...
 
void initialiseVAO (std::string fileName)
 Initialise the vertex array object. More...
 
GLuint initaliseIndicies (std::vector< unsigned int > &inIndices)
 Initialise indices. More...
 
GLuint initaliseVBO (unsigned int vecNum, std::vector< float > &inVBOData, int linkNum)
 Initialise a vertex array object. More...
 
void calculateMaxAndMinVerticies (std::vector< float > &vertices)
 Calculated the maximum and minimum indices. More...
 

Private Attributes

GLuint vertexArrayObject
 The Vertex Array Object for use with OpenGL. More...
 
GLuint indexBuffer
 The index buffer. More...
 
GLuint textureBuffer
 The texture buffer. More...
 
unsigned int numberOfVertices
 Number of vertices in the model. More...
 
unsigned int numberOfIndices
 
std::string textureFileName
 The name of the texture file. More...
 
GLuint textureID
 The Texture. More...
 
Vec3 maxVert
 The Max Verticies. More...
 
Vec3 minVert
 The Min Verticies. More...
 
bool heightmap
 If the mesh if is a heightmap. More...
 
bool primative
 If the mesh is a primitive. More...
 

Detailed Description

Creates an object from an text file, this can then be used with OpenGL.

Constructor & Destructor Documentation

◆ Mesh() [1/5]

Mesh::Mesh ( std::string  objFileName)

Creates a vertex array object using a obj file location and OpenGL.

Parameters
objFileNameThe name of the obj file.
Here is the call graph for this function:

◆ Mesh() [2/5]

Mesh::Mesh ( Primitives::PrimativeType  primType)

Creates a vertex array object using a primitive type.

Parameters
primTypeThe primitive type.
Here is the call graph for this function:

◆ Mesh() [3/5]

Mesh::Mesh ( std::string  fileName,
bool  heightmap 
)

Creates a vertex array object using a file location and OpenGL.

Parameters
fileNameThe name of the file.
heightmapA boolean stating if it is a heightmap.
Here is the call graph for this function:

◆ Mesh() [4/5]

Mesh::Mesh ( std::string  objFileName,
std::string  textureFileName 
)

Creates a vertex array object using a obj file location and OpenGL.

Parameters
objFileNameThe name of the obj file.
textureFileNameThe name of the texture file.
Here is the call graph for this function:

◆ Mesh() [5/5]

Mesh::Mesh ( std::string  fileName,
std::string  textureFileName,
bool  heightmap 
)

Creates a vertex array object using a file location and OpenGL.

Parameters
fileNameThe name of the file.
textureFileNameThe name of the texture file.
heightmapA boolean stating if it is a heightmap.
Here is the call graph for this function:

◆ ~Mesh()

Mesh::~Mesh ( )

Destructs an Object.

Member Function Documentation

◆ calculateMaxAndMinVerticies()

void Mesh::calculateMaxAndMinVerticies ( std::vector< float > &  vertices)
private

Calculated the maximum and minimum indices.

Parameters
verticesA reference to the vertices vector.
Here is the caller graph for this function:

◆ checkHeightmap()

bool Mesh::checkHeightmap ( )
inline

Checks if it is heightmap.

Returns
The heightmap bool.

◆ checkPrimitive()

bool Mesh::checkPrimitive ( )
inline

Checks if it is primative.

Returns
The primative bool.

◆ getMaxVert()

Vec3 Mesh::getMaxVert ( )
inline

Returns the max vertices.

Returns
The max vertices.
Here is the caller graph for this function:

◆ getMinVert()

Vec3 Mesh::getMinVert ( )
inline

Returns the min vertices.

Returns
The min vertices.
Here is the caller graph for this function:

◆ getNumberOfVertices()

unsigned int Mesh::getNumberOfVertices ( )

Returns the number of vertices.

Returns
The number of vertices.

◆ getNumIndices()

unsigned int Mesh::getNumIndices ( )
inline

Returns the number of indices.

Returns
The number of indices.

◆ getTextureID()

GLuint Mesh::getTextureID ( )

Returns the Texture ID.

Returns
The texture ID.

◆ getVAO()

GLuint Mesh::getVAO ( )

Returns the vertex array object.

Returns
The vertex array object.

◆ initaliseIndicies()

GLuint Mesh::initaliseIndicies ( std::vector< unsigned int > &  inIndices)
private

Initialise indices.

Parameters
inIndicesA reference to the indices vector.
Returns
The indices.
Here is the caller graph for this function:

◆ initaliseVBO()

GLuint Mesh::initaliseVBO ( unsigned int  vecNum,
std::vector< float > &  inVBOData,
int  linkNum 
)
private

Initialise a vertex array object.

Parameters
vecNumThe vector num.
inVBODataA refrence to the VBO data vector.
linkNumThe link number.
Returns
The vertex array object.
Here is the caller graph for this function:

◆ initialiseTexture()

void Mesh::initialiseTexture ( std::vector< float >  vertexTextures)
private

Initialise the texture.

Parameters
vertexTexturesThe vertex textures vector.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseVAO()

void Mesh::initialiseVAO ( std::string  fileName)
private

Initialise the vertex array object.

Parameters
fileNameThe name of the file.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ heightmap

bool Mesh::heightmap
private

If the mesh if is a heightmap.

◆ indexBuffer

GLuint Mesh::indexBuffer
private

The index buffer.

◆ maxVert

Vec3 Mesh::maxVert
private

The Max Verticies.

◆ minVert

Vec3 Mesh::minVert
private

The Min Verticies.

◆ numberOfIndices

unsigned int Mesh::numberOfIndices
private

◆ numberOfVertices

unsigned int Mesh::numberOfVertices
private

Number of vertices in the model.

◆ primative

bool Mesh::primative
private

If the mesh is a primitive.

◆ textureBuffer

GLuint Mesh::textureBuffer
private

The texture buffer.

◆ textureFileName

std::string Mesh::textureFileName
private

The name of the texture file.

◆ textureID

GLuint Mesh::textureID
private

The Texture.

◆ vertexArrayObject

GLuint Mesh::vertexArrayObject
private

The Vertex Array Object for use with OpenGL.


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