SpiecsEngine
 
Loading...
Searching...
No Matches

◆ CreateMeshEntity() [2/2]

void Spices::WorldFunctions::CreateMeshEntity ( World * world,
const std::string & name,
std::function< std::shared_ptr< Mesh >()> onMeshCreated,
std::function< void(Entity &)> onAdded = nullptr )
static

Create Entity with a Basic MeshComponent Async.

Parameters
[in]worldSpecific World.
[in]name.
[in]onMeshCreatedfunction executed to create mesh.
[in]onAddedfunction executed after Entity has been added to world.

Definition at line 13 of file WorldFunctions.cpp.

19 {
21
22 SPICES_PROFILE_ZONEN("CreateBasicMeshEntity");
23
24 auto mesh = onMeshCreated();
25
26 CreateMeshEntity(world, name, mesh, onAdded);
27 });
28 }
#define SPICES_PROFILE_ZONEN(...)
static void CreateMeshEntity(World *world, const std::string &name, std::function< std::shared_ptr< Mesh >()> onMeshCreated, std::function< void(Entity &)> onAdded=nullptr)
Create Entity with a Basic MeshComponent Async.
static auto AsyncTask(ThreadPoolEnum pool, F &&func, Args &&... args) -> std::future< decltype(func(std::forward< Args >(args)...))>