ConeGeometry
Generates a cone geometry assignable to any mesh.
[ConeGeometry](/reference/geometries/cone_geometry)
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()
cpp
vglx::ConeGeometry::ConeGeometry(const Parameters ¶ms)
Parameter | Description |
---|---|
params | ConeGeometry::Parameters |
Constructs a ConeGeometry object.
Factories preferred
ConeGeometry::Create() auto
cpp
static auto vglx::ConeGeometry::Create()
Creates a shared pointer to a ConeGeometry object with default parameters.
ConeGeometry::Create() auto
cpp
static auto vglx::ConeGeometry::Create(const Parameters ¶ms)
Parameter | Description |
---|---|
params | ConeGeometry::Parameters |
Creates a shared pointer to a ConeGeometry object.
Types
ConeGeometry::Parameters struct
Parameters for constructing a ConeGeometry object.
Name | Type | Description |
---|---|---|
height | float | Height of the cone. |
height_segments | unsigned | Subdivisions along the height. |
open_ended | bool | Whether the cone is open ended. |
radial_segments | unsigned | Subdivisions along the radius. |
radius | float | Radius of the cone. |