Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
MeshComponent.h File Reference

Bridges the scene graph with the render pipeline by submitting a RenderCommand each frame. More...

#include <memory>
#include "Types.h"
#include "scene/Component.h"
+ Include dependency graph for MeshComponent.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mnd::MeshComponent
 Makes a GameObject renderable by submitting its mesh each frame. More...
 

Namespaces

namespace  mnd
 

Detailed Description

Bridges the scene graph with the render pipeline by submitting a RenderCommand each frame.

Attaching a MeshComponent to a GameObject makes it visible. On each Update() call the component reads the owner's world transform, packages it together with its Mesh and Material into a RenderCommand, and submits it to the engine's RenderQueue.

Ownership model

Both Mesh and Material are shared via shared_ptr — multiple MeshComponents (and multiple GameObjects) can reference the same GPU resources without duplication. The RenderCommand holds only raw pointers for the duration of the frame; it does not extend lifetime.

See also
RenderCommand, RenderQueue::Submit, Material, Mesh

Definition in file MeshComponent.h.