23#ifndef VCL_BGFX_DRAWABLE_UNIFORMS_DRAWABLE_MESH_UNIFORMS_H
24#define VCL_BGFX_DRAWABLE_UNIFORMS_DRAWABLE_MESH_UNIFORMS_H
26#include <vclib/bgfx/uniform.h>
27#include <vclib/mesh.h>
33 float mMeshColor[4] = {0.5, 0.5, 0.5, 1.0};
35 float mModelMatrix[16] = {
53 Uniform mMeshColorUniform =
Uniform(
"u_meshColor", bgfx::UniformType::Vec4);
61 const float* currentMeshColor()
const {
return mMeshColor; }
63 const float* currentModelMatrix()
const {
return mModelMatrix; }
65 template<MeshConcept MeshType>
66 void update(
const MeshType&
m)
69 mMeshColor[0] =
m.color().redF();
70 mMeshColor[1] =
m.color().greenF();
71 mMeshColor[2] =
m.color().blueF();
72 mMeshColor[3] =
m.color().alphaF();
78 mMeshColorUniform.bind(mMeshColor);
A class representing a box in N-dimensional space.
Definition box.h:46
Concept that is evaluated true if a Mesh has the Color component.
Definition mesh_requirements.h:62