Kaim::GeneratorParameters Class Reference

#include <generatorparameters.h>

Class Description

The GeneratorParameters class contains configuration parameters that control the characteristics of the NavData created by the Generator.

You can create an instance of this class, set up its data members as desired, and pass it in a call to Generator::SetGeneratorParameters().

Public Attributes

KyFloat32 m_entityHeight
 The height of the character. More...
 
KyFloat32 m_entityRadius
 The radius (or half-width) of the character. More...
 
KyFloat32 m_stepMax
 The maximum difference in altitude that the character can traverse in its normal movement. More...
 
KyFloat32 m_slopeMax
 The maximum slope that the character can traverse in its normal movement. More...
 
KyFloat32 m_rasterPrecision
 Determines the approximate width and length of each pixel used to rasterize the input triangles. More...
 
KyFloat32 m_cellSize
 Determines the approximate width and length of each cell in the grid used to partition the NavMesh internally. More...
 
KyFloat32 m_altitudeTolerance
 Determines the maximum difference in altitude that may exist between the NavMesh and the original terrain mesh. More...
 
GeneratorAdvancedParameters m_advancedParameters
 Contains more advanced configuration parameters. More...
 

Private Attributes

DynamicNavTag m_defaultNavTag
 Specifies the default NavTag that will be applied to all input triangles that do not otherwise have a NavTag set explicitly. More...
 

Functions

 GeneratorParameters ()
 
void Clear ()
 default constructor More...
 
void SetDefaultValues ()
 alias for Clear() More...
 
void SetDefaultNavTag (const KyArrayPOD< KyUInt32 > &blindDataArray)
 
void SetDefaultNavTag (const KyUInt32 *blindDataBuffer, KyUInt32 blindDataCount)
 
void SetEmptyDefaultNavTagColor (Color color)
 
void SetNonEmptyDefaultNavTagColor (Color color)
 
void SetNonDefaultNavTagColor (Color color)
 
const DynamicNavTag & GetDefaultNavTag () const
 

For internal use only

void ComputeNormalizedParams ()
 
void ComputeDatabaseGenMetrics (DatabaseGenMetrics &genMetrics) const
 
void BuildBlob (BlobHandler< GeneratorParametersBlob > &handler) const
 
KyResult ReadFromBlobHandler (BlobHandler< GeneratorParametersBlob > &handler)
 
KyResult ReadFromAggregate (BlobAggregate &aggregate)
 
bool operator== (const GeneratorParameters &other) const
 
bool operator!= (const GeneratorParameters &other) const
 
void InitBlobFieldMapping (BlobFieldsMapping &mapping, KyUInt32 &version)
 
void InitBlobFieldMapping (BlobFieldsMapping &mapping, KyUInt32 &version) const
 
KyResult ReadFromBlob (const GeneratorParametersBlob &blob)
 

Member Function Documentation

void Kaim::GeneratorParameters::Clear ( )

default constructor

Reset members as if the object was freshly constructed

void Kaim::GeneratorParameters::SetDefaultValues ( )
inline

alias for Clear()

Member Data Documentation

GeneratorAdvancedParameters Kaim::GeneratorParameters::m_advancedParameters

Contains more advanced configuration parameters.

The default values of the parameters offered by GeneratorAdvancedParameters should suffice for most projects.

KyFloat32 Kaim::GeneratorParameters::m_altitudeTolerance

Determines the maximum difference in altitude that may exist between the NavMesh and the original terrain mesh.

units:  meters

default value:  0.5f

KyFloat32 Kaim::GeneratorParameters::m_cellSize

Determines the approximate width and length of each cell in the grid used to partition the NavMesh internally.

This value will be rounded so that a cell contains exactly "n" pixels where n is an integer The "Normalized" value is accessible using ComputeNormalizedCellSize()

units:  meters

default value:  20.0f

DynamicNavTag Kaim::GeneratorParameters::m_defaultNavTag
private

Specifies the default NavTag that will be applied to all input triangles that do not otherwise have a NavTag set explicitly.

KyFloat32 Kaim::GeneratorParameters::m_entityHeight

The height of the character.

units:  meters

default value:  2.0f

KyFloat32 Kaim::GeneratorParameters::m_entityRadius

The radius (or half-width) of the character.

Particularly this radius is used to keep the navMesh borders at a distance of m_entityRadius from the walls, so that characters do not collide with the at runtime.

units:  meters

default value:  0.4f

+ Examples:
KyFloat32 Kaim::GeneratorParameters::m_rasterPrecision

Determines the approximate width and length of each pixel used to rasterize the input triangles.

This value is rounded to a "Normalized" value so that a pixel is exactly m_entityRadius / N where N is an integer value of at least 1. Ex: m_entityRadius = 0.4, m_rasterPrecision = 0.25 => m_normalizedRasterPrecision = 0.2

units:  meters

default value:  0.2f

+ Examples:
KyFloat32 Kaim::GeneratorParameters::m_slopeMax

The maximum slope that the character can traverse in its normal movement.

Any input triangle with a slope greater than this value is automatically tagged with the exclusive NavTag, and no NavData will be generated for that triangle.

units:  degrees

default value:  50.0f

KyFloat32 Kaim::GeneratorParameters::m_stepMax

The maximum difference in altitude that the character can traverse in its normal movement.

units:  meters

default value:  0.6f


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