![]() |
Public API Reference |
Density based texture mapper. More...
#include <cstool/primitives.h>
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. | |
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.
| 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.
| 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.
| 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. |
Implements CS::Geometry::TextureMapper.