## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iMeshGenerator Struct Reference
[Crystal Space 3D Engine]

iMeshGenerator defines the interface for a mesh generator. More...

`#include <iengine/meshgen.h>`

Inheritance diagram for iMeshGenerator:

[legend]
List of all members.

## Public Member Functions

virtual void | AddMesh (iMeshWrapper *mesh)=0
| Add a mesh on which we will map our geometry.
virtual iMeshGeneratorGeometry * | CreateGeometry ()=0
| Create a geometry specification for this mesh generator.
virtual int | GetBlockCount () const =0
| Get the block count.
virtual int | GetCellCount () const =0
| Get the cell count.
virtual iMeshGeneratorGeometry * | GetGeometry (size_t idx)=0
| Get a specific geometry.
virtual size_t | GetGeometryCount () const =0
| Get the number of geometry specifications.
virtual iMeshWrapper * | GetMesh (size_t idx)=0
| Get a specific mesh.
virtual size_t | GetMeshCount () const =0
| Get the number of meshes.
virtual const csBox3 & | GetSampleBox () const =0
| Get the sample box.
virtual iObject * | QueryObject ()=0
| Get the iObject for this mesh generator.
virtual void | RemoveGeometry (size_t idx)=0
| Remove a geometry.
virtual void | RemoveMesh (size_t idx)=0
| Remove a mesh.
virtual void | SetAlphaScale (float mindist, float maxdist)=0
| Set the alpha scale.
virtual void | SetBlockCount (int number)=0
| Set the maximum number of blocks to keep in memory at the same time.
virtual void | SetCellCount (int number)=0
| Set the number of cells to use in one direction.
virtual void | SetDensityScale (float mindist, float maxdist, float maxdensityfactor)=0
| Set the density scale.
virtual void | SetSampleBox (const csBox3 &box)=0
| Get the box where where we will sample.

## Detailed Description

iMeshGenerator defines the interface for a mesh generator.

Definition at line 124 of file meshgen.h.

## Member Function Documentation

virtual void iMeshGenerator::AddMesh | ( | iMeshWrapper * | mesh | ) | `[pure virtual]`

| Add a mesh on which we will map our geometry.

virtual iMeshGeneratorGeometry* iMeshGenerator::CreateGeometry | ( |  | ) | `[pure virtual]`

| Create a geometry specification for this mesh generator.

virtual int iMeshGenerator::GetBlockCount | ( |  | ) | const`[pure virtual]`

| Get the block count.

virtual int iMeshGenerator::GetCellCount | ( |  | ) | const`[pure virtual]`

| Get the cell count.

virtual iMeshGeneratorGeometry* iMeshGenerator::GetGeometry | ( | size_t | idx | ) | `[pure virtual]`

| Get a specific geometry.

virtual size_t iMeshGenerator::GetGeometryCount | ( |  | ) | const`[pure virtual]`

| Get the number of geometry specifications.

virtual iMeshWrapper* iMeshGenerator::GetMesh | ( | size_t | idx | ) | `[pure virtual]`

| Get a specific mesh.

virtual size_t iMeshGenerator::GetMeshCount | ( |  | ) | const`[pure virtual]`

| Get the number of meshes.

virtual const csBox3& iMeshGenerator::GetSampleBox | ( |  | ) | const`[pure virtual]`

| Get the sample box.

virtual iObject* iMeshGenerator::QueryObject | ( |  | ) | `[pure virtual]`

| Get the iObject for this mesh generator.

virtual void iMeshGenerator::RemoveGeometry | ( | size_t | idx | ) | `[pure virtual]`

| Remove a geometry.

virtual void iMeshGenerator::RemoveMesh | ( | size_t | idx | ) | `[pure virtual]`

| Remove a mesh.

virtual void iMeshGenerator::SetAlphaScale | ( | float | mindist,
|  | float | maxdist
| ) | `[pure virtual]`

Set the alpha scale.

If this is set then objects in the distance will use alpha mode.

Parameters:

  | mindist | is the minimum distance at which alpha scale starts. At this distance the alpha factor will be 1 (meaning no alpha).
  | maxdist | is the maximum distance at which alpha scale ends. At this distance the alpha factor will be equal to '0'.

virtual void iMeshGenerator::SetBlockCount | ( | int | number | ) | `[pure virtual]`

| Set the maximum number of blocks to keep in memory at the same time. A block contains generated positions. Generating a block may be expensive (depending on density and size of the cells) so it may be good to have a high number here. Having a high number means more memory usage though. Default is 100.

virtual void iMeshGenerator::SetCellCount | ( | int | number | ) | `[pure virtual]`

| Set the number of cells to use in one direction. Total cells will be 'number*number'. A cell is a logical unit that can keep a number of generated positions. Using bigger (fewer) cells means that more positions are generated at once (possibly causing hickups when this happens). Smaller cells may mean more runtime overhead. Default is 50.

virtual void iMeshGenerator::SetDensityScale | ( | float | mindist,
|  | float | maxdist,
|  | float | maxdensityfactor
| ) | `[pure virtual]`

Set the density scale.

If this is set then objects in the distance can have a lower density.

Parameters:

  | mindist | is the minimum distance at which density scale starts. At this distance the density factor will be 1 (meaning original density as given by the geometry itself).
  | maxdist | is the maximum distance at which density scale ends. At this distance the density factor will be equal to 'maxdensityfactor'. Note that this is a linear function so distances beyond 'maxdist' will get even lower density.
  | maxdensityfactor | is the density factor to use at 'maxdist'. 1 means full density and 0 means nothing left.

virtual void iMeshGenerator::SetSampleBox | ( | const csBox3 & | box | ) | `[pure virtual]`

| Get the box where where we will sample. We will sample starting at the highest y value of the box and pointing down to the lowest y value of the box. (@@ TODO: in future support other directions for the mapping beam).

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

- iengine/meshgen.h