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 Member Functions

void BuildBlob (BlobHandler< GeneratorParametersBlob > &handler) const
 
void Clear ()
 
bool operator!= (const GeneratorParameters &other) const
 
bool operator== (const GeneratorParameters &other) const
 
KyResult ReadFromAggregate (BlobAggregate &aggregate)
 
KyResult ReadFromBlob (const GeneratorParametersBlob &blob)
 
KyResult ReadFromBlobHandler (BlobHandler< GeneratorParametersBlob > &handler)
 
void SetDefaultValues ()
 

Public Attributes

GeneratorAdvancedParameters m_advancedParameters
 
KyFloat32 m_altitudeTolerance
 
KyFloat32 m_cellSize
 
KyFloat32 m_entityHeight
 
KyFloat32 m_entityRadius
 
KyFloat32 m_rasterPrecision
 
KyFloat32 m_slopeMax
 
KyFloat32 m_stepMax
 

Private Attributes

DynamicNavTag m_defaultNavTag
 

Member Function Documentation

void Kaim::GeneratorParameters::BuildBlob ( BlobHandler< GeneratorParametersBlob > &  handler) const

Build a GeneratorParametersBlob from these parameters.

void Kaim::GeneratorParameters::Clear ( )

default constructor

Reset members as if the object was freshly constructed

bool Kaim::GeneratorParameters::operator!= ( const GeneratorParameters other) const
inline
Returns
true if the specified GeneratorParameters contains at least one value that is different from this object.
bool Kaim::GeneratorParameters::operator== ( const GeneratorParameters other) const
Returns
true if the specified GeneratorParameters contains the same values as this object.
KyResult Kaim::GeneratorParameters::ReadFromAggregate ( BlobAggregate &  aggregate)

Read parameters values from a BlobAggregate.

Returns
KY_SUCCESS if one and only one GeneratorParametersBlob was found in the aggregate, KY_ERROR otherwise.
KyResult Kaim::GeneratorParameters::ReadFromBlob ( const GeneratorParametersBlob &  blob)

Read parameters values from a GeneratorParametersBlob.

Returns
KY_SUCCESS if GeneratorParametersBlob has been successfully read, KY_ERROR otherwise (namely in case of bad Blob version).
KyResult Kaim::GeneratorParameters::ReadFromBlobHandler ( BlobHandler< GeneratorParametersBlob > &  handler)
inline

Read parameters values from a GeneratorParametersBlob.

Returns
KY_SUCCESS if GeneratorParametersBlob has been successfully read, KY_ERROR otherwise (namely in case of bad Blob version).
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 that will use the NavData at runtime.

units:  meters

default value:  2.0f

KyFloat32 Kaim::GeneratorParameters::m_entityRadius

The radius (or half-width) of the character that will use the NavData at runtime.

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 that will use the NavData at runtime 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 that will use the NavData at runtime can traverse in its normal movement.

units:  meters

default value:  0.6f


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