CrystalSpace

Public API Reference

CS::Geometry::DensityTextureMapper Class Reference

Density based texture mapper. More...

#include <cstool/primitives.h>

Inheritance diagram for CS::Geometry::DensityTextureMapper:

List of all members.

Public Member Functions

 DensityTextureMapper (float density)
 Create a density texture mapper with the given density.
virtual csVector2 Map (const csVector3 &, const csVector3 &, size_t idx)
 Map a 3D coordinate and a triangle plane to 2D UV space.

Detailed Description

Density based texture mapper.

This mapper tries to achieve a constant texture density on the surface. This texture mapper is really only useful on non-smoothed surfaces. So for GenerateBox(), GenerateQuad(), and GenerateTesselatedQuad().

Definition at line 86 of file primitives.h.


Constructor & Destructor Documentation

CS::Geometry::DensityTextureMapper::DensityTextureMapper ( float  density  )  [inline]

Create a density texture mapper with the given density.

This density value represents the number of times the texture is repeated in a 1x1 unit block. So a density of 10 will repeat the texture exactly 10x10 times.

Definition at line 98 of file primitives.h.


Member Function Documentation

virtual csVector2 CS::Geometry::DensityTextureMapper::Map ( const csVector3 point,
const csVector3 normal,
size_t  idx 
) [virtual]

Map a 3D coordinate and a triangle plane to 2D UV space.

Parameters:
point is the point in 3D space.
normal is the normal of the point that we're mapping.
idx is the index in the model.
Returns:
the resulting uv mapping.

Implements CS::Geometry::TextureMapper.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1