13 #include <vulkan/vulkan.h> 15 #define GLM_FORCE_RADIANS 16 #include <glm/glm.hpp> 29 std::vector<std::vector<float> > vertices;
30 std::vector<std::vector<int> > facesVertexIndices;
31 std::vector<std::vector<float> > normals;
32 std::vector<std::vector<int> > facesNormalIndices;
33 std::vector<std::vector<float> > textureCoords;
34 std::vector<std::vector<int> > textureCoordsIndices;
36 void loadVertexData();
38 void loadNormalsData();
39 void loadTextureCoordsData();
45 void correctDataVectors();
192 Model(
const std::string fileLocation);
VkDeviceMemory positionBufferMemory
Memory for buffer containing vertex positions (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:67
A 3D model, loaded from a Wavefront file.
Definition: Model.hpp:25
VkBuffer normalsBuffer
Normals buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:85
bool alreadyInGPU
Is the model already in GPU memory? (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:55
uint32_t colourMemIndex
Index of model colour in the colour dynamic uniform buffer (Vulkan-specific, avoid direct manipulatio...
Definition: Model.hpp:116
std::vector< uint32_t > indexData
3 column table. Each element refers to a "row" in the vertex data table. Each "row" in the index data...
Definition: Model.hpp:135
VkDeviceMemory uvBufferMemory
Memory for UV coordinates buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:103
VkDeviceMemory normalsBufferMemory
Memory for normals buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:91
bool perspective
True if the model is to be rendered with perspective, False for orthographic rendering.
Definition: Model.hpp:178
std::string textureName
Name of the texture the model will be rendered with. The texture has to have been previously generate...
Definition: Model.hpp:172
std::vector< float > vertexData
The vertex data. This is an array, which is to be treated as a 4 column table, holding the x,...
Definition: Model.hpp:123
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...
Definition: Model.hpp:148
VkDeviceMemory indexBufferMemory
Memory for index buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:79
int normalsDataByteSize
Size of the normals data, in bytes.
Definition: Model.hpp:153
VkBuffer uvBuffer
UV coordinates buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:97
std::vector< float > textureCoordsData
Array, to be treated as a 2 column table. Each "row" contains the x and y components of the pixel coo...
Definition: Model.hpp:161
int vertexDataByteSize
Size of the vertex data, in bytes.
Definition: Model.hpp:128
VkBuffer positionBuffer
Buffer containing vertex positions (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:61
int indexDataByteSize
Size of the index data, in bytes.
Definition: Model.hpp:140
uint32_t orientationMemIndex
Index of model orientation in the orientation dynamic uniform buffer (Vulkan-specific,...
Definition: Model.hpp:110
Model()
Default constructor.
Definition: Model.cpp:215
int textureCoordsDataByteSize
Size of the texture coordinates data, in bytes.
Definition: Model.hpp:166
VkBuffer indexBuffer
Index buffer (Vulkan-specific, avoid direct manipulation)
Definition: Model.hpp:73