CrystalSpace

Public API Reference

Static Public Member Functions
CS::Geometry::Primitives Class Reference

A primitive mesh generator. More...

#include <cstool/primitives.h>

Inheritance diagram for CS::Geometry::Primitives:
csPrimitives

List of all members.

Static Public Member Functions

static void GenerateBox (const csBox3 &box, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, uint32 flags=CS_PRIMBOX_SMOOTH, TextureMapper *mapper=0)
 Generate a box with 24 vertices and 12 triangles so that the normals of every face point in or outwards (the normals of the vertices belonging to a face will point with the correct normal of the face).
static void GenerateCapsule (float l, float r, uint sides, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, TextureMapper *mapper=0)
 Generate a capsule of given length and radius.
static void GenerateCone (float l, float r, uint sides, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, TextureMapper *mapper=0)
 Generate a cone of given length and radius.
static void GenerateCylinder (float l, float r, uint sides, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, TextureMapper *mapper=0)
 Generate a cylinder of given length and radius.
static void GenerateQuad (const csVector3 &v1, const csVector3 &v2, const csVector3 &v3, const csVector3 &v4, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, TextureMapper *mapper=0)
 Generate a double-sided quad.
static void GenerateSphere (const csEllipsoid &ellips, int num, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, bool cyl_mapping=false, bool toponly=false, bool reversed=false, TextureMapper *mapper=0)
 Generate a sphere with 'num' vertices on the rim.
static void GenerateTesselatedQuad (const csVector3 &v0, const csVector3 &v1, const csVector3 &v2, int tesselations, csDirtyAccessArray< csVector3 > &mesh_vertices, csDirtyAccessArray< csVector2 > &mesh_texels, csDirtyAccessArray< csVector3 > &mesh_normals, csDirtyAccessArray< csTriangle > &mesh_triangles, TextureMapper *mapper=0)
 Generate a single-sided tesselations quad.

Detailed Description

A primitive mesh generator.

Definition at line 106 of file primitives.h.


Member Function Documentation

static void CS::Geometry::Primitives::GenerateBox ( const csBox3 box,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
uint32  flags = CS_PRIMBOX_SMOOTH,
TextureMapper mapper = 0 
) [static]

Generate a box with 24 vertices and 12 triangles so that the normals of every face point in or outwards (the normals of the vertices belonging to a face will point with the correct normal of the face).

Parameters:
flagsis a combination of BoxFlags enumeration values. Default is CS_PRIMBOX_SMOOTH.
mapperis an optional texture mapper. If not given the default TableTextureMapper is used with boxTable.
static void CS::Geometry::Primitives::GenerateCapsule ( float  l,
float  r,
uint  sides,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
TextureMapper mapper = 0 
) [static]

Generate a capsule of given length and radius.

Parameters:
lCapsule length.
rCapsule radius.
sidesNumber of sides.
mapperis an optional texture mapper. If not given the default capsule texture mapping will be used (currently not implemented, you have to specify a mapper).
static void CS::Geometry::Primitives::GenerateCone ( float  l,
float  r,
uint  sides,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
TextureMapper mapper = 0 
) [static]

Generate a cone of given length and radius.

Parameters:
lCone length.
rCone radius.
sidesNumber of sides.
mapperis an optional texture mapper. If not given the default Cone texture mapping will be used (currently not implemented, you have to specify a mapper).
static void CS::Geometry::Primitives::GenerateCylinder ( float  l,
float  r,
uint  sides,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
TextureMapper mapper = 0 
) [static]

Generate a cylinder of given length and radius.

Parameters:
lCylinder length.
rCylinder radius.
sidesNumber of sides.
mapperis an optional texture mapper. If not given the default cylinder texture mapping will be used (currently not implemented, you have to specify a mapper).
static void CS::Geometry::Primitives::GenerateQuad ( const csVector3 v1,
const csVector3 v2,
const csVector3 v3,
const csVector3 v4,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
TextureMapper mapper = 0 
) [static]

Generate a double-sided quad.

Parameters:
mapperis an optional texture mapper. If not given the default TableTextureMapper is used with quadTable.
static void CS::Geometry::Primitives::GenerateSphere ( const csEllipsoid ellips,
int  num,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
bool  cyl_mapping = false,
bool  toponly = false,
bool  reversed = false,
TextureMapper mapper = 0 
) [static]

Generate a sphere with 'num' vertices on the rim.

Parameters:
ellipsProperties of the ellipsoid to create.
numNumber of vertices in the generated mesh.
mesh_verticesReturns the generated vertices.
mesh_texelsReturns the generated texture coordinates.
mesh_normalsReturns the generated normals.
mesh_trianglesReturns the generated triangles.
cyl_mappingif true then use cylindrical texture mapping.
toponlyif true then only generate the top half of the sphere.
reversedif true then generate the sphere so it is visible from the inside.
mapperis an optional texture mapper. If not given the mapping as defined by the 'cyl_mapping' flag will be used.
static void CS::Geometry::Primitives::GenerateTesselatedQuad ( const csVector3 v0,
const csVector3 v1,
const csVector3 v2,
int  tesselations,
csDirtyAccessArray< csVector3 > &  mesh_vertices,
csDirtyAccessArray< csVector2 > &  mesh_texels,
csDirtyAccessArray< csVector3 > &  mesh_normals,
csDirtyAccessArray< csTriangle > &  mesh_triangles,
TextureMapper mapper = 0 
) [static]

Generate a single-sided tesselations quad.

v0-v1 and v0-v2 should be oriented clockwise from the visible side.

Parameters:
v0is the origin of the quad.
v1is the first axis.
v2is the second axis.
tesselationsis the number of tesselations.
mapperis an optional texture mapper. If not given the default DensityTextureMapper is used with density 1.

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

Generated for Crystal Space 2.0 by doxygen 1.7.6.1