SpiecsEngine
 
Loading...
Searching...
No Matches

◆ SetMesh()

void Spices::MeshComponent::SetMesh ( std::shared_ptr< Mesh > mesh)
inherited

Set the Mesh this component handled.

Parameters
[in]meshThe Mesh shared pointer.

Set m_Mesh.

Registry this mesh to world.

Set m_Mesh.

Registry this mesh to world.

Definition at line 274 of file MeshComponent.cpp.

275 {
277
278 auto& e = FrameInfo::Get().m_World->QueryEntitybyID((uint32_t)m_Owner);
279
283 m_Mesh = mesh;
284
288 mesh->GetPacks().for_each([&](auto& k, auto& v) {
289 v->GetMeshDesc().UpdatemodelAddress(e.GetComponent<TransformComponent>().GetModelBufferAddress());
290 v->GetMeshDesc().UpdateentityID((uint32_t)m_Owner);
291 return false;
292 });
293 }
#define SPICES_PROFILE_ZONE
entt::entity m_Owner
This component's Owner entity.
Definition Component.h:67
static FrameInfo & Get()
Get FrameInfo.
Definition FrameInfo.cpp:14
std::shared_ptr< World > m_World
The shared pointer of specific world.
Definition FrameInfo.h:94
std::shared_ptr< Mesh > m_Mesh
The Mesh this component handled.