Avara3D 0.2.0
C++ API reference
a3d::Sphere Class Reference

Icosphere mesh element centered at the origin. More...

#include <a3d/mesh/primitive/Sphere.h>

Inheritance diagram for a3d::Sphere:
[legend]

Public Member Functions

 Sphere (float radius, unsigned segments=DEFAULT_SEGMENTS)
 Generates icosphere geometry with radius and segments subdivisions per edge. More...
 
float radius () const
 Returns the configured sphere radius. More...
 
unsigned segments () const
 Returns the number of subdivisions per icosahedron edge. More...
 
- Public Member Functions inherited from a3d::MeshElement
 MeshElement (VertexLayout layout, std::span< const std::byte > vertexBytes, uint32_t vertexCount, uint16_t vertexStride, PrimitiveTopology topology, IndexFormat indexFormat, std::span< const std::byte > indexBytes, uint32_t indexCount)
 Creates a MeshElement by copying the supplied vertex and index data. More...
 

Static Public Member Functions

static std::shared_ptr< MeshMesh (float radius, unsigned segments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
 Creates a Mesh containing a Sphere and optional material. More...
 

Detailed Description

Icosphere mesh element centered at the origin.

Segments controls the number of subdivisions applied to each icosahedron edge.

Definition at line 26 of file Sphere.h.

Constructor & Destructor Documentation

◆ Sphere()

a3d::Sphere::Sphere ( float  radius,
unsigned  segments = DEFAULT_SEGMENTS 
)
explicit

Generates icosphere geometry with radius and segments subdivisions per edge.

Member Function Documentation

◆ Mesh()

static std::shared_ptr< Mesh > a3d::Sphere::Mesh ( float  radius,
unsigned  segments = DEFAULT_SEGMENTS,
std::shared_ptr< Material material = nullptr 
)
static

Creates a Mesh containing a Sphere and optional material.

◆ radius()

float a3d::Sphere::radius ( ) const

Returns the configured sphere radius.

◆ segments()

unsigned a3d::Sphere::segments ( ) const

Returns the number of subdivisions per icosahedron edge.


The documentation for this class was generated from the following file: