Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::MeshComponent Class Referenceabstract

Makes a GameObject renderable by submitting its mesh each frame. More...

#include <MeshComponent.h>

+ Inheritance diagram for mnd::MeshComponent:
+ Collaboration diagram for mnd::MeshComponent:

Public Member Functions

 MeshComponent ()=default
 Construct a MeshComponent with a mesh-material pair.
 
 MeshComponent (const std::shared_ptr< Material > &material, const std::shared_ptr< Mesh > &mesh)
 
void Update (f32 deltaTime) override
 Submit a RenderCommand for this object's current world transform.
 
void SetMaterial (const std::shared_ptr< Material > &material)
 
void SetMesh (const std::shared_ptr< Mesh > &mesh)
 
void LoadProperties (const nlohmann::json &json) override
 
virtual void Init ()
 
virtual size_t GetTypeId () const =0
 
GameObjectGetOwner ()
 

Static Public Member Functions

template<typename T >
static size_t StaticTypeId ()
 

Protected Attributes

GameObjectm_owner = nullptr
 

Detailed Description

Makes a GameObject renderable by submitting its mesh each frame.

Update() packages (Mesh + Material + owner world transform) into a RenderCommand and hands it to the engine's RenderQueue. The actual draw call happens later in RenderQueue::Draw().

Definition at line 40 of file MeshComponent.h.

Constructor & Destructor Documentation

◆ MeshComponent() [1/2]

mnd::MeshComponent::MeshComponent ( )
default

Construct a MeshComponent with a mesh-material pair.

Parameters
materialThe surface description (shader + uniforms + textures).
meshThe GPU geometry to draw.

◆ MeshComponent() [2/2]

mnd::MeshComponent::MeshComponent ( const std::shared_ptr< Material > &  material,
const std::shared_ptr< Mesh > &  mesh 
)

Definition at line 13 of file MeshComponent.cpp.

Member Function Documentation

◆ GetOwner()

GameObject * mnd::Component::GetOwner ( )
inherited

Definition at line 12 of file Component.cpp.

References mnd::Component::m_owner.

Referenced by Update(), and mnd::SkinnedMeshComponent::Update().

◆ GetTypeId()

virtual size_t mnd::Component::GetTypeId ( ) const
pure virtualinherited

◆ Init()

void mnd::Component::Init ( )
virtualinherited

Reimplemented in mnd::PhysicsComponent, and mnd::PlayerControllerComponent.

Definition at line 10 of file Component.cpp.

Referenced by mnd::GameObject::AddComponent().

◆ LoadProperties()

void mnd::MeshComponent::LoadProperties ( const nlohmann::json &  json)
overridevirtual

◆ SetMaterial()

void mnd::MeshComponent::SetMaterial ( const std::shared_ptr< Material > &  material)

Definition at line 43 of file MeshComponent.cpp.

References material.

Referenced by LoadProperties().

◆ SetMesh()

void mnd::MeshComponent::SetMesh ( const std::shared_ptr< Mesh > &  mesh)

Definition at line 48 of file MeshComponent.cpp.

References mesh.

Referenced by LoadProperties().

◆ StaticTypeId()

template<typename T >
static size_t mnd::Component::StaticTypeId ( )
inlinestaticinherited

Definition at line 50 of file Component.h.

◆ Update()

void mnd::MeshComponent::Update ( f32  deltaTime)
overridevirtual

Member Data Documentation

◆ m_owner


The documentation for this class was generated from the following files: