GCubeSDK
©2026 FenixFox®Studios

OctahedronGeometry

OctahedronGeometry ⟵ PolyhedronGeometryBufferGeometry

A geometry class for an octahedron with given radius and detail.
OctahedronGeometry creates an octahedron geometry that is centered on the origin. An octahedron is a polyhedron with 8 triangular faces, 6 vertices, and 12 edges. It is one of the five Platonic solids.

Methods

OctahedronGeometry(f32 radius, u32 detail, const Color& color)

Universal constructor - covers all cases with smart defaults

radius Radius of the octahedron 1.0f
detail Number of subdivision levels (0 = original shape) 0
color RGBA color for all vertices 0xFFFFFFFF

OctahedronGeometry* clone(bool recursive = false) const

Creates a copy of this geometry

recursive Whether to clone descendants as well

void copy(const OctahedronGeometry& geometry)

Copies properties from another geometry

geometry Source geometry to copy from

void buildOctahedron()

Builds the octahedron geometry with vertices, indices, and colors

static vector<f32> getOctahedronVertices()

Returns the vertex data for an octahedron

static vector<u32> getOctahedronIndices()

Returns the face indices for an octahedron

Properties

color Color RGBA color for all vertices
detail u32 Number of subdivision levels
radius f32 Radius of the octahedron