Closed brenocq closed 2 years ago
Some changes to make the component module easier to use:
EntityId
Entity
set()
Expected usage:
namespace rsc = atta::resource; namespace cmp = atta::component; // Create material resource rsc::Material::CreateInfo info = {.color = {1,0,0}}; rsc::Material* rmat = rsc::create<rsc::Material>("CubeMaterial", info); // Create cube cmp::Entity cube = cmp::createEntity(); cube.add<cmp::Name>()->set("Cube"); cube.add<cmp::Mesh>()->set("meshes/cube.obj"); cube.add<cmp::Transform>(); cube.add<cmp::Material>()->set(rmat); // Create cube2 by copying cmp::Entity cube2 = cmp::copyEntity(cube); cube2.get<cmp::Transform>()->position = {1,0,0}; cube2.get<cmp::Material>()->getResource()->color = {0,1,0}; // Delete cube cmp::deleteEntity(cube);
Some changes to make the component module easier to use:
EntityId
, should returnEntity
.Entity
<->EntityId
set()
set()
set()
Expected usage: