GCubeSDK
©2026 FenixFox®Studios

RingGeometry

RingGeometry ⟵ BufferGeometry

A geometry class for a two dimensional ring with given inner and outer radii.
RingGeometry creates a ring geometry that is centered on the origin, lying in the XZ plane (Y = 0). The ring is constructed from segments and can be used to create donut shapes.

Methods

RingGeometry(f32 innerRadius, f32 outerRadius, u32 thetaSegments, u32 phiSegments, f32 thetaStart, f32 thetaLength, const Color& color)

Universal constructor - covers all cases with smart defaults

innerRadius Inner radius of the ring 0.5f
outerRadius Outer radius of the ring 1.0f
thetaSegments Number of segments around circumference 32
phiSegments Number of segments per ring segment 1
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

RingGeometry* clone(bool recursive = false) const

Creates a copy of this geometry

recursive Whether to clone descendants as well

void copy(const RingGeometry& geometry)

Copies properties from another geometry

geometry Source geometry to copy from

void buildRing()

Builds the ring geometry with vertices, indices, and colors

Properties

color Color RGBA color for all vertices
innerRadius f32 Inner radius of the ring
outerRadius f32 Outer radius of the ring
phiSegments u32 Number of segments per ring segment
thetaLength f32 Central angle in radians
thetaSegments u32 Number of segments around circumference
thetaStart f32 Start angle in radians