ConeGeometry
Generates a cone geometry assignable to any mesh.
ConeGeometry creates a 3D cone shape with configurable radius, height, and segment subdivisions. It is rendered using triangle primitives and can optionally exclude the bottom cap (open-ended).
cpp
auto geometry = vglx::ConeGeometry::Create({
.radius = 0.5f,
.height = 2.0f,
.radial_segments = 32,
.height_segments = 4,
.open_ended = false
});
auto mesh = vglx::Mesh::Create(geometry, UnlitMaterial::Create(0x049EF4));
my_scene->Add(mesh);INFO
Derives from CylinderGeometry and inherits all public properties and methods.
Construction
Constructors
ConeGeometry()
Constructs a ConeGeometry object.
cpp
ConeGeometry::ConeGeometry(const Parameters& params);| Parameter | Description |
|---|---|
| params | ConeGeometry::Parameters |
Factories preferred
ConeGeometry::Create() auto
Creates a shared pointer to a ConeGeometry object with default parameters.
cpp
static auto ConeGeometry::Create();ConeGeometry::Create() auto
Creates a shared pointer to a ConeGeometry object.
cpp
static auto ConeGeometry::Create(const Parameters& params);| Parameter | Description |
|---|---|
| params | ConeGeometry::Parameters |
Types
ConeGeometry::Parameters struct
Parameters for constructing a ConeGeometry object.
| Parameter | Description |
|---|---|
| radius float | Radius of the cone. |
| height float | Height of the cone. |
| radial_segments unsigned | Subdivisions along the radius. |
| height_segments unsigned | Subdivisions along the height. |
| open_ended bool | Whether the cone is open ended. |