Model

A model is a type that stores all of the vertex, index and UV information for a single model. This model can then be used to create a renderable MACH_OBJECT type. Since this is a 3D type, it is accessed from the Object namesapce.

A model can be created by using one of 3 constructors:

Object::MACH_MODEL model1 = Object::Model::createModel("model.obj");
Object::MACH_MODEL model2 = Object::Model::createModel(vertices);
Object::MACH_MODEL model3 = Object::Model::createModel(vertices, normals, uvs, indices);

For the first constructor that takes in an std::string to link to a .OBJ file, this pulls all of the model information from the file. If the model has UVs, then the function hasTexture() will return true, otherwise it will return false.

Models also have a variety of getters and setters:

getVertices() //std::vector<float3>
getIndices() //std::vector<unsigned int>
getNormals() //std::vector<float3>
getUVs() //std::vector<float2>
hasTexture() //bool
getVertexSize() //size_t - returns how many vertices are within the model
getIndexSize() //size_t - returns how many indices are within the model