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

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

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

Inheritance diagram for a3d::Box:
[legend]

Public Member Functions

 Box (float width, float height, float length, unsigned widthSegments=DEFAULT_SEGMENTS, unsigned heightSegments=DEFAULT_SEGMENTS, unsigned lengthSegments=DEFAULT_SEGMENTS)
 Generates box geometry with the supplied dimensions and subdivision counts. 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 lengthSegments () const
 Returns the stored length subdivision count. More...
 
unsigned widthSegments () const
 Returns the stored width subdivision count. More...
 
unsigned heightSegments () const
 Returns the stored 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 width, float height, float length, unsigned widthSegments=DEFAULT_SEGMENTS, unsigned heightSegments=DEFAULT_SEGMENTS, unsigned lengthSegments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
 Creates a Mesh containing a Box and optional material. More...
 

Detailed Description

Box mesh element centered at the origin.

Width spans the X axis, height spans Y, and length spans Z.

Definition at line 26 of file Box.h.

Constructor & Destructor Documentation

◆ Box()

a3d::Box::Box ( float  width,
float  height,
float  length,
unsigned  widthSegments = DEFAULT_SEGMENTS,
unsigned  heightSegments = DEFAULT_SEGMENTS,
unsigned  lengthSegments = DEFAULT_SEGMENTS 
)

Generates box geometry with the supplied dimensions and subdivision counts.

Member Function Documentation

◆ height()

float a3d::Box::height ( ) const

Returns the configured box height along Y.

◆ heightSegments()

unsigned a3d::Box::heightSegments ( ) const

Returns the stored height subdivision count.

◆ length()

float a3d::Box::length ( ) const

Returns the configured box length along Z.

◆ lengthSegments()

unsigned a3d::Box::lengthSegments ( ) const

Returns the stored length subdivision count.

◆ Mesh()

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

Creates a Mesh containing a Box and optional material.

Parameters
widthfull size along X.
heightfull size along Y.
lengthfull size along Z.
widthSegmentssubdivisions along X.
heightSegmentssubdivisions along Y.
lengthSegmentssubdivisions along Z.

◆ width()

float a3d::Box::width ( ) const

Returns the configured box width along X.

◆ widthSegments()

unsigned a3d::Box::widthSegments ( ) const

Returns the stored width subdivision count.


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