13 namespace fireworks {
namespace graphics {
26 : vertex(
glm::vec3(0, 0, 0)), uv(
glm::vec2(0, 0)), tid(0.0f), color(
glm::vec4(1, 0, 1, 1))
31 VertexData3D(glm::vec3 vertex, glm::vec2 uv,
float texID, glm::vec4 color)
32 : vertex(vertex), uv(uv), tid(texID), color(color)
44 Transform(glm::vec3 pos = glm::vec3(0, 0, 0), glm::vec3 rot = glm::vec3(0, 0, 0), glm::vec3 scale = glm::vec3(1, 1, 1))
45 : position(pos), rotation(rot), scale(scale)
83 mutable std::vector<glm::vec2>
m_UV;
89 static std::uint32_t m_UniqueID;
98 : m_Transform(transform), m_Color(color), m_Primitive3D(primitive3d), shader(nullptr), m_Texture(nullptr)
100 objectID = ++m_UniqueID;
111 : m_Transform(transform), m_Color(color), m_Primitive3D(primitive3d), shader(shader), m_Texture(nullptr)
113 objectID = ++m_UniqueID;
124 : m_Transform(transform), m_Color(color), m_Primitive3D(primitive3d), shader(shader), m_Texture(texture)
126 objectID = ++m_UniqueID;
130 0, 1, 2, 3, 4, 5, 6, 7,
131 8, 9, 10, 11, 12, 13, 14, 15
142 objectID = ++m_UniqueID;
156 inline const glm::vec4&
getColor()
const {
return m_Color; }
158 inline const std::vector<glm::vec2>&
getUV()
const {
return m_UV; }
160 inline const GLuint
getTID()
const {
return m_Texture ==
nullptr ? 0 : m_Texture->
getID(); }
164 inline std::vector<VertexData3D>
getVerts()
const {
return m_Vertices; }
168 inline std::vector<GLushort>
getInidces()
const {
return m_Indices; }
179 for (
int i = 0; i < faces; i++)
181 m_UV.push_back(glm::vec2(0, 0));
182 m_UV.push_back(glm::vec2(0, 4));
183 m_UV.push_back(glm::vec2(4, 4));
184 m_UV.push_back(glm::vec2(4, 0));
191 for (
int i = 0; i < faces; i++)
194 m_UV.push_back(glm::vec2(0, 0));
195 m_UV.push_back(glm::vec2(0, 1));
196 m_UV.push_back(glm::vec2(1, 1));
197 m_UV.push_back(glm::vec2(1, 0));
const Transform & getTransform() const
Gets the reference to the transform of the renderable object.
Definition: renderable3d.h:154
std::vector< VertexData3D > m_Vertices
The vertices pool of the 3d object.
Definition: renderable3d.h:85
GLuint getVertsSize() const
Gets the vertices count of the 3d renderable.
Definition: renderable3d.h:166
The vertex structure of a 3D primitive.
Definition: renderable3d.h:16
The 3D mesh of a 3d renderable object.
Definition: mesh.h:15
Transform m_Transform
The transform of the object in 3D space.
Definition: renderable3d.h:77
glm::vec4 color
Definition: renderable3d.h:23
The class responsible for loading Textures.
Definition: texture.h:11
std::vector< glm::vec2 > m_UV
The texture coordinates of the 3d renderable.
Definition: renderable3d.h:83
Renderable3D()
Create a empty renderable.
Definition: renderable3d.h:140
std::vector< VertexData3D > getVerts() const
Gets vertices of the 3d renderable.
Definition: renderable3d.h:164
The Class responsible for drawing the basic 3D Renderable objects onto the screen.
Definition: renderable3d.h:66
float tid
Definition: renderable3d.h:22
virtual ~Renderable3D()
Definition: renderable3d.h:145
Shader * shader
The shader used to draw the renderable object.
Definition: renderable3d.h:72
Definition: audioclip.cpp:3
const unsigned int getID() const
Gets the ID of the texture.
Definition: texture.h:40
GLsizei getIndicesSize() const
Gets the indices count of the 3d renderable.
Definition: renderable3d.h:170
The class responsible for creating amazing shaders.
Definition: Shader.h:22
const std::vector< glm::vec2 > & getUV() const
Gets the reference to the texture coordinates of the renderable.
Definition: renderable3d.h:158
glm::vec4 m_Color
Vertex color of the renderable.
Definition: renderable3d.h:79
Texture * m_Texture
The texture used to draw the renderable object.
Definition: renderable3d.h:74
Primitive3D m_Primitive3D
The basic primitive that is being rendered, (Does not denote the primitive used to render the 3d obje...
Definition: renderable3d.h:81
void enable()
Enables the shader.
Definition: Shader.cpp:119
Renderable3D(Transform transform, glm::vec4 color, Primitive3D primitive3d)
Creates the renderable.
Definition: renderable3d.h:97
const Primitive3D & gerPrimitive() const
Gets the 3D primitive that is being rendered.
Definition: renderable3d.h:162
const glm::vec4 & getColor() const
Gets the reference to the color of the renderable object.
Definition: renderable3d.h:156
Renderable3D(Transform transform, glm::vec4 color, Primitive3D primitive3d, Shader *shader, Texture *texture)
Creates the renderable.
Definition: renderable3d.h:123
Forward declaration of the graphics::Renderable3D.
Definition: renderer3d.h:16
std::vector< GLushort > getInidces() const
Gets the indices of the 3d renderable.
Definition: renderable3d.h:168
Renderable3D(Transform transform, glm::vec4 color, Primitive3D primitive3d, Shader *shader)
Creates the renderable.
Definition: renderable3d.h:110
void disable()
Disables the shader.
Definition: Shader.cpp:124
glm::vec3 vertex
Definition: renderable3d.h:18
std::vector< GLushort > m_Indices
The indices pool of the 3d object.
Definition: renderable3d.h:87
Primitive3D
Different types of 3D renderable primitive objects.
Definition: renderable3d.h:51
VertexData3D(glm::vec3 vertex, glm::vec2 uv, float texID, glm::vec4 color)
Definition: renderable3d.h:31
VertexData3D()
Definition: renderable3d.h:25
const GLuint getTID() const
Gets the texture ID of the texture being used by the renderable.
Definition: renderable3d.h:160
std::uint32_t objectID
The unique object ID of renderable object.
Definition: renderable3d.h:70
glm::vec2 uv
Definition: renderable3d.h:21
virtual void submit(Renderer3D *renderer) const
Virtual overload of the submit function, customize the way you can submit the renderable to the rende...
Definition: renderable3d.h:148
void setUniform1iv(const GLchar *name, int *value, GLsizei count)
Definition: Shader.cpp:94
virtual void submit(const Renderable3D *renderable)=0
Begins to submit the renderables to render queue.