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

Rounded box mesh element centered at the origin. More...

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

Inheritance diagram for a3d::RoundedBox:
[legend]

Public Member Functions

 RoundedBox (float radius, float length, float width, float height, unsigned slices=DEFAULT_SLICES, unsigned lengthSegments=DEFAULT_SEGMENTS, unsigned widthSegments=DEFAULT_SEGMENTS, unsigned heightSegments=DEFAULT_SEGMENTS)
 Generates rounded-box geometry with the supplied dimensions and subdivisions. More...
 
float radius () const
 Returns the configured edge radius. More...
 
float length () const
 Returns the configured box length along Z. More...
 
float width () const
 Returns the configured box width along X. More...
 
float height () const
 Returns the configured box height along Y. More...
 
unsigned slices () const
 Returns the rounded-edge subdivision count. More...
 
unsigned lengthSegments () const
 Returns the length subdivision count. More...
 
unsigned widthSegments () const
 Returns the width subdivision count. More...
 
unsigned heightSegments () const
 Returns the height 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 length, float width, float height, unsigned slices=DEFAULT_SLICES, unsigned lengthSegments=DEFAULT_SEGMENTS, unsigned widthSegments=DEFAULT_SEGMENTS, unsigned heightSegments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
 Creates a Mesh containing a RoundedBox and optional material. More...
 

Detailed Description

Rounded box mesh element centered at the origin.

Width spans X, height spans Y, and length spans Z. Radius controls the rounded edges, slices subdivide the rounded portions, and the segment counts subdivide the corresponding flat-face dimensions.

Definition at line 28 of file RoundedBox.h.

Constructor & Destructor Documentation

◆ RoundedBox()

a3d::RoundedBox::RoundedBox ( float  radius,
float  length,
float  width,
float  height,
unsigned  slices = DEFAULT_SLICES,
unsigned  lengthSegments = DEFAULT_SEGMENTS,
unsigned  widthSegments = DEFAULT_SEGMENTS,
unsigned  heightSegments = DEFAULT_SEGMENTS 
)

Generates rounded-box geometry with the supplied dimensions and subdivisions.

Member Function Documentation

◆ height()

float a3d::RoundedBox::height ( ) const

Returns the configured box height along Y.

◆ heightSegments()

unsigned a3d::RoundedBox::heightSegments ( ) const

Returns the height subdivision count.

◆ length()

float a3d::RoundedBox::length ( ) const

Returns the configured box length along Z.

◆ lengthSegments()

unsigned a3d::RoundedBox::lengthSegments ( ) const

Returns the length subdivision count.

◆ Mesh()

static std::shared_ptr< Mesh > a3d::RoundedBox::Mesh ( float  radius,
float  length,
float  width,
float  height,
unsigned  slices = DEFAULT_SLICES,
unsigned  lengthSegments = DEFAULT_SEGMENTS,
unsigned  widthSegments = DEFAULT_SEGMENTS,
unsigned  heightSegments = DEFAULT_SEGMENTS,
std::shared_ptr< Material material = nullptr 
)
static

Creates a Mesh containing a RoundedBox and optional material.

◆ radius()

float a3d::RoundedBox::radius ( ) const

Returns the configured edge radius.

◆ slices()

unsigned a3d::RoundedBox::slices ( ) const

Returns the rounded-edge subdivision count.

◆ width()

float a3d::RoundedBox::width ( ) const

Returns the configured box width along X.

◆ widthSegments()

unsigned a3d::RoundedBox::widthSegments ( ) const

Returns the width subdivision count.


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