GLUS
Data Structures | Typedefs | Functions
glus_shape.h File Reference

Go to the source code of this file.

Data Structures

struct  _GLUSshape
 Structure for holding geometry data. More...
 

Typedefs

typedef struct _GLUSshape GLUSshape
 Structure for holding geometry data. More...
 

Functions

GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreatePlanef (GLUSshape *shape, const GLUSfloat halfExtend)
 Creates a quadratic plane. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularPlanef (GLUSshape *shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend)
 Creates a rectangular plane. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularGridPlanef (GLUSshape *shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend, const GLUSuint rows, const GLUSuint columns, const GLUSboolean triangleStrip)
 Creates a rectangular plane organized as a grid with given number rows and columns. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDiscf (GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSectors)
 Creates a disc with the given radius and number sectors. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCubef (GLUSshape *shape, const GLUSfloat halfExtend)
 Creates a cube. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateSpheref (GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSlices)
 Creates a sphere. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDomef (GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSlices)
 Creates a dome. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateTorusf (GLUSshape *shape, const GLUSfloat innerRadius, const GLUSfloat outerRadius, const GLUSuint numberSlices, const GLUSuint numberStacks)
 Creates a torus / doughnut. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCylinderf (GLUSshape *shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices)
 Creates a cylinder. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateConef (GLUSshape *shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices, const GLUSuint numberStacks)
 Creates a cone. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCalculateTangentBitangentf (GLUSshape *shape)
 Calculates and creates the tangent and bitangent vectors. More...
 
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCopyf (GLUSshape *shape, const GLUSshape *source)
 Copies the shape. More...
 
GLUSAPI GLUSvoid GLUSAPIENTRY glusShapeDestroyf (GLUSshape *shape)
 Destroys the shape by freeing the allocated memory. More...
 

Typedef Documentation

typedef struct _GLUSshape GLUSshape

Structure for holding geometry data.

Function Documentation

GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCalculateTangentBitangentf ( GLUSshape shape)

Calculates and creates the tangent and bitangent vectors.

Uses the previous created memory for the tangents and bitangents.

Parameters
shapeThe structure which will be filled with the calculated vectors.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCopyf ( GLUSshape shape,
const GLUSshape source 
)

Copies the shape.

Parameters
shapeThe target shape.
sourceThe source shape.
Returns
GLUS_TRUE, if copy succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateConef ( GLUSshape shape,
const GLUSfloat  halfExtend,
const GLUSfloat  radius,
const GLUSuint  numberSlices,
const GLUSuint  numberStacks 
)

Creates a cone.

More slices and stacks makes the torus more round and smooth.

Parameters
shapeThe data is stored into this structure.
halfExtendThe distance from the center point to the bottom disc of the cone.
radiusThe radius of the cone at the bottom.
numberSlicesThe number of slices the cone should have.
numberStacksThe number of stacks the cone should have.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCubef ( GLUSshape shape,
const GLUSfloat  halfExtend 
)

Creates a cube.

Parameters
shapeThe data is stored into this structure.
halfExtendThe distance from the center point to any face of the cube.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCylinderf ( GLUSshape shape,
const GLUSfloat  halfExtend,
const GLUSfloat  radius,
const GLUSuint  numberSlices 
)

Creates a cylinder.

More slices makes the cylinder more round.

Parameters
shapeThe data is stored into this structure.
halfExtendThe distance from the center point to the bottom and top disc of the cylinder.
radiusThe radius of the cylinder.
numberSlicesThe number of slices the cylinder should have.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDiscf ( GLUSshape shape,
const GLUSfloat  radius,
const GLUSuint  numberSectors 
)

Creates a disc with the given radius and number sectors.

More sectors makes the disc more round.

Parameters
shapeThe data is stored into this structure.
radiusThe radius of the disc.
numberSectorsThe number of sectors the disc should have.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDomef ( GLUSshape shape,
const GLUSfloat  radius,
const GLUSuint  numberSlices 
)

Creates a dome.

More slices makes the dome more round.

Parameters
shapeThe data is stored into this structure.
radiusThe radius of the dome.
numberSlicesThe number of slices the dome should have.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreatePlanef ( GLUSshape shape,
const GLUSfloat  halfExtend 
)

Creates a quadratic plane.

Parameters
shapeThe data is stored into this structure.
halfExtendThe length from the center point to any border of the plane.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularGridPlanef ( GLUSshape shape,
const GLUSfloat  horizontalExtend,
const GLUSfloat  verticalExtend,
const GLUSuint  rows,
const GLUSuint  columns,
const GLUSboolean  triangleStrip 
)

Creates a rectangular plane organized as a grid with given number rows and columns.

Parameters
shapeThe data is stored into this structure.
horizontalExtendThe length from the center point to the left/right border of the plane.
verticalExtendThe length from the center point to the upper/lower border of the plane.
rowsThe number of rows the grid should have.
columnsThe number of columns the grid should have.
triangleStripSet to GLUS_TRUE, if a triangle strip should be created.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularPlanef ( GLUSshape shape,
const GLUSfloat  horizontalExtend,
const GLUSfloat  verticalExtend 
)

Creates a rectangular plane.

Parameters
shapeThe data is stored into this structure.
horizontalExtendThe length from the center point to the left/right border of the plane.
verticalExtendThe length from the center point to the upper/lower border of the plane.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateSpheref ( GLUSshape shape,
const GLUSfloat  radius,
const GLUSuint  numberSlices 
)

Creates a sphere.

More slices makes the sphere more round.

Parameters
shapeThe data is stored into this structure.
radiusThe radius of the sphere.
numberSlicesThe number of slices the sphere should have.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateTorusf ( GLUSshape shape,
const GLUSfloat  innerRadius,
const GLUSfloat  outerRadius,
const GLUSuint  numberSlices,
const GLUSuint  numberStacks 
)

Creates a torus / doughnut.

More slices and stacks makes the torus more round.

Parameters
shapeThe data is stored into this structure.
innerRadiusThe inner radius of the torus. This is the distance from the center point to the closest point from the torus surface.
outerRadiusThe outer radius of the torus. This is the distance from the center point to the farthest point from the torus surface.
numberSlicesThe number of slices the torus should have.
numberStacksThe number of stacks / elements the torus should have per slice.
Returns
GLUS_TRUE, if creation succeeded.
GLUSAPI GLUSvoid GLUSAPIENTRY glusShapeDestroyf ( GLUSshape shape)

Destroys the shape by freeing the allocated memory.

Parameters
shapeThe structure which contains the dynamic allocated shape data, which will be freed by this function.