9#ifndef AVARA3D_MESH_PRIMITIVE_TORUS_H
10#define AVARA3D_MESH_PRIMITIVE_TORUS_H
14#include "a3d/mesh/MeshElement.h"
34 unsigned slices = DEFAULT_SLICES,
35 unsigned segments = DEFAULT_SEGMENTS,
36 std::shared_ptr<Material> material =
nullptr);
43 unsigned slices = DEFAULT_SLICES,
44 unsigned segments = DEFAULT_SEGMENTS);
63 static constexpr unsigned DEFAULT_SLICES = 16;
64 static constexpr unsigned DEFAULT_SEGMENTS = 32;
Owns the vertex and optional index data for one mesh primitive.
Torus mesh element centered at the origin in the XY plane.
unsigned segments() const
Returns the major-ring subdivision count.
unsigned slices() const
Returns the minor-ring subdivision count.
float majorRadius() const
Returns the configured major-radius parameter.
static std::shared_ptr< Mesh > Mesh(float minorRadius, float majorRadius, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
Creates a Mesh containing a Torus and optional material.
Torus(float minorRadius, float majorRadius, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS)
Generates torus geometry with the supplied radii and subdivision counts.
float minorRadius() const
Returns the configured minor-radius parameter.