9#ifndef AVARA3D_MESH_PRIMITIVE_CAPSULE_H
10#define AVARA3D_MESH_PRIMITIVE_CAPSULE_H
14#include "a3d/mesh/MeshElement.h"
37 unsigned slices = DEFAULT_SLICES,
38 unsigned segments = DEFAULT_SEGMENTS,
39 unsigned rings = DEFAULT_RINGS,
40 std::shared_ptr<Material> material =
nullptr);
47 unsigned slices = DEFAULT_SLICES,
48 unsigned segments = DEFAULT_SEGMENTS,
49 unsigned rings = DEFAULT_RINGS);
71 static constexpr unsigned DEFAULT_SLICES = 32;
72 static constexpr unsigned DEFAULT_SEGMENTS = 4;
73 static constexpr unsigned DEFAULT_RINGS = 8;
Capsule mesh element centered at the origin and aligned along the Y axis.
unsigned slices() const
Returns the circumferential subdivision count.
Capsule(float radius, float height, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS, unsigned rings=DEFAULT_RINGS)
Generates capsule geometry with the supplied dimensions and subdivisions.
static std::shared_ptr< Mesh > Mesh(float radius, float height, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS, unsigned rings=DEFAULT_RINGS, std::shared_ptr< Material > material=nullptr)
Creates a Mesh containing a Capsule and optional material.
float height() const
Returns the configured distance between the centers of the capsule caps.
unsigned segments() const
Returns the straight-section subdivision count.
unsigned rings() const
Returns the cap subdivision count.
float radius() const
Returns the configured capsule radius.
Owns the vertex and optional index data for one mesh primitive.