Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::StandardShapes Class Reference

Helper class to generate vertex buffers for standard geometric shapes, such as cylinders, cones, boxes, spheres, elipsoids ... . More...

#include <StandardShapes.h>

Static Public Member Functions

static void MakeCircle (ai_real radius, unsigned int tess, std::vector< aiVector3D > &positions)
 Generates a flat circle. More...
 
static void MakeCone (ai_real height, ai_real radius1, ai_real radius2, unsigned int tess, std::vector< aiVector3D > &positions, bool bOpen=false)
 Generates a cone or a cylinder, either open or closed. More...
 
static unsigned int MakeDodecahedron (std::vector< aiVector3D > &positions, bool polygons=false)
 Generates a dodecahedron. More...
 
static unsigned int MakeHexahedron (std::vector< aiVector3D > &positions, bool polygons=false)
 Generates a hexahedron (cube) More...
 
static unsigned int MakeIcosahedron (std::vector< aiVector3D > &positions)
 Generates an icosahedron. More...
 
static aiMeshMakeMesh (const std::vector< aiVector3D > &positions, unsigned int numIndices)
 Generates a mesh from an array of vertex positions. More...
 
static aiMeshMakeMesh (unsigned int n, void(*GenerateFunc)(unsigned int, std::vector< aiVector3D > &))
 
static aiMeshMakeMesh (unsigned int(*GenerateFunc)(std::vector< aiVector3D > &))
 
static aiMeshMakeMesh (unsigned int(*GenerateFunc)(std::vector< aiVector3D > &, bool))
 
static unsigned int MakeOctahedron (std::vector< aiVector3D > &positions)
 Generates an octahedron. More...
 
static void MakeSphere (unsigned int tess, std::vector< aiVector3D > &positions)
 Generates a sphere. More...
 
static unsigned int MakeTetrahedron (std::vector< aiVector3D > &positions)
 Generates a tetrahedron. More...
 

Detailed Description

Helper class to generate vertex buffers for standard geometric shapes, such as cylinders, cones, boxes, spheres, elipsoids ... .

Member Function Documentation

◆ MakeCircle()

static void Assimp::StandardShapes::MakeCircle ( ai_real  radius,
unsigned int  tess,
std::vector< aiVector3D > &  positions 
)
static

Generates a flat circle.

The circle is constructed in the planned formed by the x,z axes of the cartesian coordinate system.

Parameters
radiusRadius of the circle
tessNumber of segments.
positionsReceives output triangles.

◆ MakeCone()

static void Assimp::StandardShapes::MakeCone ( ai_real  height,
ai_real  radius1,
ai_real  radius2,
unsigned int  tess,
std::vector< aiVector3D > &  positions,
bool  bOpen = false 
)
static

Generates a cone or a cylinder, either open or closed.

|-----| <- radius 1
__x__ <- ] ^
/ \ | height |
/ \ | Y
/ \ |
/ \ |
/______x______\ <- ] <- end cap
|-------------| <- radius 2
Parameters
heightHeight of the cone
radius1First radius
radius2Second radius
tessNumber of triangles.
bOpenedtrue for an open cone/cylinder. An open shape has no 'end caps'
positionsReceives output triangles

◆ MakeDodecahedron()

static unsigned int Assimp::StandardShapes::MakeDodecahedron ( std::vector< aiVector3D > &  positions,
bool  polygons = false 
)
static

Generates a dodecahedron.

Parameters
positionsReceives output triangles
polygonsIf you pass true here pentagons will be returned
Returns
Number of vertices per face

◆ MakeHexahedron()

static unsigned int Assimp::StandardShapes::MakeHexahedron ( std::vector< aiVector3D > &  positions,
bool  polygons = false 
)
static

Generates a hexahedron (cube)

Hexahedrons can be scaled on all axes.

Parameters
positionsReceives output triangles.
polygonsIf you pass true here quads will be returned
Returns
Number of vertices per face

◆ MakeIcosahedron()

static unsigned int Assimp::StandardShapes::MakeIcosahedron ( std::vector< aiVector3D > &  positions)
static

Generates an icosahedron.

Parameters
positionsReceives output triangles.
Returns
Number of vertices per face

◆ MakeMesh() [1/4]

static aiMesh * Assimp::StandardShapes::MakeMesh ( const std::vector< aiVector3D > &  positions,
unsigned int  numIndices 
)
static

Generates a mesh from an array of vertex positions.

Parameters
positionsList of vertex positions
numIndicesNumber of indices per primitive
Returns
Output mesh

◆ MakeMesh() [2/4]

static aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int  n,
void(*)(unsigned int, std::vector< aiVector3D > &)  GenerateFunc 
)
static

◆ MakeMesh() [3/4]

static aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int(*)(std::vector< aiVector3D > &)  GenerateFunc)
static

◆ MakeMesh() [4/4]

static aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int(*)(std::vector< aiVector3D > &, bool)  GenerateFunc)
static

◆ MakeOctahedron()

static unsigned int Assimp::StandardShapes::MakeOctahedron ( std::vector< aiVector3D > &  positions)
static

Generates an octahedron.

Parameters
positionsReceives output triangles.
Returns
Number of vertices per face

◆ MakeSphere()

static void Assimp::StandardShapes::MakeSphere ( unsigned int  tess,
std::vector< aiVector3D > &  positions 
)
static

Generates a sphere.

Parameters
tessNumber of subdivions - 0 generates a octahedron
positionsReceives output triangles.

◆ MakeTetrahedron()

static unsigned int Assimp::StandardShapes::MakeTetrahedron ( std::vector< aiVector3D > &  positions)
static

Generates a tetrahedron.

Parameters
positionsReceives output triangles.
Returns
Number of vertices per face

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