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

Create a sphere entity with mesh and transform.

Create a sphere entity with mesh and transform

Parameters
coreEngine core reference
infoParameters for creating the sphere (radius, position, rotation, scale, segments, rings)
Returns
Engine::Entity The created entity with mesh and transform
auto sphere = Object::Helper::CreateSphere(core, { .radius = 0.5f, .position = glm::vec3(0, 10, 0) });
sphere.AddComponent<Physics::RigidBody>(core, Physics::RigidBody::CreateDynamic());
decltype(auto) AddComponent(TComponent &&component)
Add a component to an entity.
Definition Entity.hpp:55
Engine::Entity CreateSphere(Engine::Core &core, CreateSphereInfo info)
Definition CreateShape.cpp:22

a sphere entity: