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

Create a cylinder entity with mesh and transform.

Create a cylinder entity with mesh and transform

Parameters
coreEngine core reference
infoParameters for creating the cylinder (radiusTop, radiusBottom, height, position, rotation, scale, segments, heightSegments)
Returns
Engine::Entity The created entity with mesh and transform
auto cylinder = Object::Helper::CreateCylinder(core, { .radiusTop = 0.5f, .radiusBottom = 0.5f, .height = 2.0f,
.position = glm::vec3(0, 1, 0), .heightSegments = 1u }); cylinder.AddComponent<Physics::RigidBody>(core,
Physics::RigidBody::CreateDynamic());
decltype(auto) AddComponent(TComponent &&component)
Add a component to an entity.
Definition Entity.hpp:55
Engine::Entity CreateCylinder(Engine::Core &core, CreateCylinderInfo info)
Definition CreateShape.cpp:48

a cylinder entity: