The small3d framework
Public Member Functions | Public Attributes | List of all members
small3d::Model Struct Reference

A 3D model, loaded from a Wavefront file. More...

#include <Model.hpp>

Public Member Functions

 Model ()
 Default constructor. More...
 
 Model (const std::string fileLocation)
 Constructor that loads model from file. More...
 

Public Attributes

uint32_t positionBufferObjectId = 0
 Position buffer object id. It is suggested not to manipulate this directly.
 
uint32_t indexBufferObjectId = 0
 Index buffer object id. It is suggested not to manipulate this directly.
 
uint32_t normalsBufferObjectId = 0
 Normals buffer object id. It is suggested not to manipulate this directly.
 
uint32_t uvBufferObjectId = 0
 UV buffer object id. It is suggested not to manipulate this directly.
 
std::vector< float > vertexData
 The vertex data. This is an array, which is to be treated as a 4 column table, holding the x, y, z values in each column. The fourth column is there to assist in matrix operations.
 
int vertexDataByteSize
 Size of the vertex data, in bytes.
 
std::vector< unsigned int > indexData
 3 column table. Each element refers to a "row" in the vertex data table. Each "row" in the index data table forms a triangle. More...
 
int indexDataByteSize
 Size of the index data, in bytes.
 
std::vector< float > normalsData
 Array, to be treated as a 3 column table. Each "row" contains the x, y and z components of the vector representing the normal of a vertex. The position of the "row" in the array is the same as the position of the corresponding vertex "row" in the vertexData array.
 
int normalsDataByteSize
 Size of the normals data, in bytes.
 
std::vector< float > textureCoordsData
 Array, to be treated as a 2 column table. Each "row" contains the x and y components of the pixel coordinates on the model's texture image for the vertex in the corresponding "row" of the vertex data "table".
 
int textureCoordsDataByteSize
 Size of the texture coordinates data, in bytes.
 

Detailed Description

A 3D model, loaded from a Wavefront file.

Constructor & Destructor Documentation

◆ Model() [1/2]

small3d::Model::Model ( )

Default constructor.

◆ Model() [2/2]

small3d::Model::Model ( const std::string  fileLocation)

Constructor that loads model from file.

Parameters
fileLocationLocation of the Wavefront file from which to load the model.

Member Data Documentation

◆ indexData

std::vector<unsigned int> small3d::Model::indexData

3 column table. Each element refers to a "row" in the vertex data table. Each "row" in the index data table forms a triangle.


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