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

Capsule mesh element centered at the origin and aligned along the Y axis. More...

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

Inheritance diagram for a3d::Capsule:
[legend]

Public Member Functions

 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. More...
 
float radius () const
 Returns the configured capsule radius. More...
 
float height () const
 Returns the configured distance between the centers of the capsule caps. More...
 
unsigned slices () const
 Returns the circumferential subdivision count. More...
 
unsigned segments () const
 Returns the straight-section subdivision count. More...
 
unsigned rings () const
 Returns the cap subdivision count. 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, 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. More...
 

Detailed Description

Capsule mesh element centered at the origin and aligned along the Y axis.

The height parameter represents the distance between the centers of the hemispherical caps, so the overall tip-to-tip height is height + 2 * radius. Slices subdivide around the capsule, segments subdivide its straight section, and rings subdivide the caps.

Definition at line 29 of file Capsule.h.

Constructor & Destructor Documentation

◆ Capsule()

a3d::Capsule::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.

Member Function Documentation

◆ height()

float a3d::Capsule::height ( ) const

Returns the configured distance between the centers of the capsule caps.

◆ Mesh()

static std::shared_ptr< Mesh > a3d::Capsule::Mesh ( float  radius,
float  height,
unsigned  slices = DEFAULT_SLICES,
unsigned  segments = DEFAULT_SEGMENTS,
unsigned  rings = DEFAULT_RINGS,
std::shared_ptr< Material material = nullptr 
)
static

Creates a Mesh containing a Capsule and optional material.

◆ radius()

float a3d::Capsule::radius ( ) const

Returns the configured capsule radius.

◆ rings()

unsigned a3d::Capsule::rings ( ) const

Returns the cap subdivision count.

◆ segments()

unsigned a3d::Capsule::segments ( ) const

Returns the straight-section subdivision count.

◆ slices()

unsigned a3d::Capsule::slices ( ) const

Returns the circumferential subdivision count.


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