10 mProperties(properties)
15 const std::string meshName =
"Quad2D";
16 const std::string materialName =
"Rectangle2D";
40 renderBatch.renderResources->SubmitResources(transformations, renderBatch.materialParameters);
48 renderBatch.materialParameters.SetMaterialVec4(
"Color", color);
Represents a 2D camera with position, rotation, and zoom control.
glm::mat4 GetProjectionMatrix() const
Returns the current orthographic projection matrix.
const glm::mat4 & GetWorldView() const
Gets the world-view (model) matrix for the camera.
2D drawable component for rendering objects in 2D space.
SceneComponent2D & GetTransform()
Access to the underlying SceneComponent2D (transform).
void Update(float deltaTime) override
Updates model matrix (and any other logic).
void Initialize() override
Initializes render resources.
void SetScale(const glm::vec2 &scale)
Sets the quad scale along each axis.
std::vector< RenderBatch > mRenderBatches
void AddRenderBatch(std::string meshName, std::string materialName)
Rectangle2D(RenderResourceContext renderContext, Scene &scene, Properties properties)
Constructs the Rectangle2D with a render context.
void Draw(const Camera2D &camera) override
Submits this quad to the renderer for drawing.
void Update(float deltaTime) override
Updates logic (animation, movement, etc.) for this drawable.
void Initialize() override
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
void SetColor(glm::vec4 color)
Sets color.
const glm::mat4 & GetWorldMatrix()
Returns the world transformation matrix.
Base class representing a renderable scene.
Aggregates pointers to global rendering resource managers.