Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
static_mesh.cpp
Go to the documentation of this file.
1#include "static_mesh.hpp"
2#include "drawable_3d.hpp"
3#include "camera.hpp"
5#include "scene_component.hpp"
6
7namespace rendering_engine
8{
9
11 :
12 Drawable3D(renderContext)
13{
14}
15
20
21void StaticMesh::Update(float deltaTime)
22{
23 Drawable3D::Update(deltaTime);
24}
25
26void StaticMesh::Draw(const Camera& camera)
27{
28 Transformations3D transformations;
29 transformations.model = mSceneComponent.GetWorldMatrix();
30 transformations.view = camera.ViewMatrix();
31 transformations.proj = camera.ProjectionMatrix();
32
33 mRenderResources->SubmitResources(transformations, mMaterialParameters);
34}
35
36} // namespace rendering_engine
Represents a 3D perspective camera with world transform and projection settings.
Definition camera.hpp:48
const glm::mat4 & ViewMatrix() const
Gets the camera view matrix.
Definition camera.cpp:71
const glm::mat4 & ProjectionMatrix() const
Gets the camera projection matrix.
Definition camera.cpp:75
void Initialize() override
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
Drawable3D(RenderResourceContext renderContext)
Constructs the Drawable3D with a render context.
void Update(float deltaTime) override
Updates logic (animation, movement, etc.) for this drawable.
std::unique_ptr< IRenderResources > mRenderResources
StaticMesh(RenderResourceContext renderContext)
Constructs a StaticMesh component associated with a given render context.
void Initialize() override
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
void Update(float deltaTime) override
Updates logic (animation, movement, etc.) for this drawable.
void Draw(const Camera &camera) override
Submits this mesh to the renderer for drawing.
Aggregates pointers to global rendering resource managers.
Contains model, view, and projection matrices for 3D rendering.
glm::mat4 proj
Projection transformation matrix.
glm::mat4 model
Model transformation matrix.
glm::mat4 view
View (camera) transformation matrix.