Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Creating a cube entity:

Create a cube entity with mesh and transform.

Create a cube entity with mesh and transformThis is a high-level helper that creates an entity with:

  • Mesh component (cube geometry)
  • Transform component (position, rotation, scale)
Parameters
coreEngine core reference
infoParameters for creating the cube (size, position, rotation, scale)
Returns
Engine::Entity The created entity with mesh and transform
auto cube = Object::Helper::CreateCube(core, { .size = 2.0f, .position = glm::vec3(0, 5, 0) });
cube.AddComponent<Physics::RigidBody>(core, Physics::RigidBody::CreateDynamic());
decltype(auto) AddComponent(TComponent &&component)
Add a component to an entity.
Definition Entity.hpp:55
Engine::Entity CreateCube(Engine::Core &core, CreateCubeInfo info)
Definition CreateShape.cpp:9

a cube entity: