Skip to content

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);
ParameterDescription
paramsConeGeometry::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);
ParameterDescription
paramsConeGeometry::Parameters

Types

ConeGeometry::Parameters struct

Parameters for constructing a ConeGeometry object.

ParameterDescription
radius floatRadius of the cone.
height floatHeight of the cone.
radial_segments unsignedSubdivisions along the radius.
height_segments unsignedSubdivisions along the height.
open_ended boolWhether the cone is open ended.

Released under the MIT License.