summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-05 01:59:16 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-05 01:59:16 +0000
commitd4c073a18adaed73973f34c6c39fc15664d9211d (patch)
tree44536af3af0284ab75eae79ef81a5e4452019269 /gfx/models
parentAdd helper operator to perform vec3*mat4 and perspective divide (diff)
parentRemove old hard coded asset factory test, run entirely from XML load and rend... (diff)
downloadilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.bz2
ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.xz
ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.zip
Merge branch 'model-factory'
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/mesh.cpp2
-rw-r--r--gfx/models/vertex.hpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 85be84c..3db1ad5 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -7,7 +7,7 @@
Mesh::Mesh(const std::span<const Vertex> vertices, const std::span<const unsigned int> indices, GLenum m) :
m_numIndices {static_cast<GLsizei>(indices.size())}, mode {m}
{
- VertexArrayObject<Vertex>::configure<&Vertex::pos, &Vertex::texCoord, &Vertex::normal>(
+ VertexArrayObject<Vertex>::configure<&Vertex::pos, &Vertex::texCoord, &Vertex::normal, &Vertex::colour>(
m_vertexArrayObject, m_vertexArrayBuffers[0], m_vertexArrayBuffers[1], vertices, indices);
}
diff --git a/gfx/models/vertex.hpp b/gfx/models/vertex.hpp
index 095c82f..325aab1 100644
--- a/gfx/models/vertex.hpp
+++ b/gfx/models/vertex.hpp
@@ -4,12 +4,13 @@
class Vertex {
public:
- constexpr Vertex(glm::vec3 pos, glm::vec2 texCoord, glm::vec3 normal) :
- pos {std::move(pos)}, texCoord {std::move(texCoord)}, normal {std::move(normal)}
+ constexpr Vertex(glm::vec3 pos, glm::vec2 texCoord, glm::vec3 normal, glm::vec4 colour = {}) :
+ pos {std::move(pos)}, texCoord {std::move(texCoord)}, normal {std::move(normal)}, colour {std::move(colour)}
{
}
glm::vec3 pos;
glm::vec2 texCoord;
glm::vec3 normal;
+ glm::vec4 colour;
};