GCubeSDK
©2026 FenixFox®Studios

CylinderGeometry

CylinderGeometry ⟵ BufferGeometry

A geometry class for a cylinder with given top/bottom radius and height.
CylinderGeometry creates a cylinder geometry that is centered on the origin, with the cylinder axis aligned along the Y axis. The cylinder can have different radii at the top and bottom, allowing for cone-like shapes.

Methods

CylinderGeometry(f32 radiusTop, f32 radiusBottom, f32 height, u32 radialSegments, u32 heightSegments, bool openEnded, f32 thetaStart, f32 thetaLength, const Color& color)

Universal constructor - covers all cases with smart defaults

radiusTop Radius of the cylinder at the top 1.0f
radiusBottom Radius of the cylinder at the bottom 1.0f
height Height of the cylinder 1.0f
radialSegments Number of segments around circumference 32
heightSegments Number of segments along height 1
openEnded Whether ends are open (true) or capped (false) false
thetaStart Start angle for first segment in radians 0.0f
thetaLength Central angle of circular sector in radians
color RGBA color for all vertices 0xFFFFFFFF

CylinderGeometry* clone(bool recursive = false) const

Creates a copy of this geometry

recursive Whether to clone descendants as well

void copy(const CylinderGeometry& geometry)

Copies properties from another geometry

geometry Source geometry to copy from

void buildCylinder()

Builds the cylinder geometry with vertices, indices, and colors

Properties

color Color RGBA color for all vertices
height f32 Height of the cylinder
heightSegments u32 Number of segments along height
openEnded bool Whether ends are open or capped
radialSegments u32 Number of segments around circumference
radiusBottom f32 Radius at the bottom of the cylinder
radiusTop f32 Radius at the top of the cylinder
thetaLength f32 Central angle in radians
thetaStart f32 Start angle in radians