Assimp  v3.1.1 (June 2014)
Assimp::StandardShapes Class Reference

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

Static Public Member Functions

static void MakeCircle (float radius, unsigned int tess, std::vector< aiVector3D > &positions)
 Generates a flat circle. More...
 
static void MakeCone (float height, float radius1, float 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(*GenerateFunc)(std::vector< aiVector3D > &))
 
static aiMeshMakeMesh (unsigned int(*GenerateFunc)(std::vector< aiVector3D > &, bool))
 
static aiMeshMakeMesh (unsigned int n, void(*GenerateFunc)(unsigned int, std::vector< aiVector3D > &))
 
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

void Assimp::StandardShapes::MakeCircle ( float  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.
void Assimp::StandardShapes::MakeCone ( float  height,
float  radius1,
float  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
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
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
unsigned int Assimp::StandardShapes::MakeIcosahedron ( std::vector< aiVector3D > &  positions)
static

Generates an icosahedron.

Parameters
positionsReceives output triangles.
Returns
Number of vertices per face
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
aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int(*)(std::vector< aiVector3D > &)  GenerateFunc)
static
aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int(*)(std::vector< aiVector3D > &, bool)  GenerateFunc)
static
aiMesh * Assimp::StandardShapes::MakeMesh ( unsigned int  n,
void(*)(unsigned int, std::vector< aiVector3D > &)  GenerateFunc 
)
static
unsigned int Assimp::StandardShapes::MakeOctahedron ( std::vector< aiVector3D > &  positions)
static

Generates an octahedron.

Parameters
positionsReceives output triangles.
Returns
Number of vertices per face
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.
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 files: