8 const char* VERT_SRC = R
"(#version 400
10in vec3 vertexPosition; //vec3 is array of 3 floats
13out vec4 fragmentColor;
15uniform mat4 u_ViewProjection;
18 gl_Position = u_ViewProjection * vec4(vertexPosition.xyz, 1.0);
20 fragmentColor = vertexColor;
23 const char* FRAG_SRC = R
"(#version 400
27out vec4 color; //rgb value
30 color = vec4(fragmentColor.rgb, fragmentColor.a);
43 void drawLine(
size_t v_index,
44 const glm::vec3 srcPosition,
const glm::vec3 destPosition,
46 const float width = 5.0f);
47 void drawRectangle(
size_t v_index,
const glm::vec2& rectSize,
48 const glm::vec3& position,
50 const glm::vec3& mRotation = glm::vec3(0),
51 const float width = 5.0f);
52 void drawBox(
size_t v_index,
const glm::vec3& rectSize,
53 const glm::vec3& position,
55 const glm::vec3& mRotation = glm::vec3(0),
56 const float width = 5.0f);
57 void drawSphere(
size_t v_index,
const glm::vec3& rectSize,
const glm::vec3& position,
const TazColor& color,
const glm::vec3& mRotation,
const float width);
58 void drawCircle(
const glm::vec2& center,
const TazColor& color,
float radius);
64 int box_edgePairs[12][2] = {
65 {0, 1}, {1, 2}, {2, 3}, {3, 0},
66 {4, 5}, {5, 6}, {6, 7}, {7, 4},
67 {0, 4}, {1, 5}, {2, 6}, {3, 7}
70 std::vector<TazPosition> sphereVertices = {
74 std::vector<GLuint> sphereIndices = {
79 void createInstancesVBO();
80 void createWireframeInstancesVBO();
81 void createVertexArray();
83 std::vector<LineMeshRenderer> _meshesArrays;
84 std::vector<WireframeMeshRenderer> _meshesElements;
86 GLuint _vboWireframeInstances;
88 size_t currentBatchIndex = 0;