Kaim::DatabaseGenMetrics Class Reference

Kaim::DatabaseGenMetrics Class Reference

#include <databasegenmetrics.h>

Class Description

This class gathers a set of generation parameters of one Database and manages the conversion between the floating-point and integer coordinate systems used internally by NavData.

Each Database object maintains and provides access to an instance of this class

+ Examples:

Public Member Functions

void Clear ()
 

Public Member Functions

KyFloat32 GetCellSize () const
 
KyFloat32 GetGenerationRadius () const
 
KyFloat32 GetGenerationHeight () const
 
KyFloat32 GetGenerationAltitudeTolerance () const
 
KyFloat32 GetPixelSize () const
 
KyInt64 GetNearestInteger64FromFloatValue (KyFloat32 inputValue) const
 
KyFloat32 GetFloatValueFromInteger64 (KyInt64 inputValue) const
 
KyFloat32 GetFloatValueFromInteger32 (KyInt32 inputValue) const
 
CoordPos64 ComputeCellOrigin (const CellPos &cellPos) const
 

Functions to compute CellPos

CellPos ComputeCellPos (const Vec2f &pos) const
 
void ComputeCellPos (const Vec2f &pos, CellPos &cellPos) const
 
CellPos ComputeCellPos (const Vec3f &pos) const
 
void ComputeCellPos (const Vec3f &pos, CellPos &cellPos) const
 
CellPos ComputeCellPosFromCoordPos64 (const CoordPos64 &coordPos64) const
 
void ComputeCellPosFromCoordPos64 (const CoordPos64 &coordPos64, CellPos &cellPos) const
 

Conversion from floating-point coordinates to 64 bits integer coordinates

CoordPos64 GetCoordPos64FromVec3f (const Vec3f &inputPosition) const
 
void GetCoordPos64FromVec3f (const Vec3f &inputPosition, CoordPos64 &result) const
 
CoordPos64 GetCoordPos64FromVec2f (const Vec2f &inputPosition) const
 
void GetCoordPos64FromVec2f (const Vec2f &inputPosition, CoordPos64 &result) const
 

Conversion from 64 bits integer coordinates to floating-point coordinates

Vec2f GetVec2fFromCoordPos64 (const CoordPos64 &inputPosition) const
 
void GetVec2fFromCoordPos64 (const CoordPos64 &inputPosition, Vec2f &result) const
 

Conversion from floating-point coordinates to WorldIntegerPos coordinates

WorldIntegerPos GetWorldIntegerPosFromVec2f (const Vec2f &inputPosition) const
 
void GetWorldIntegerPosFromVec2f (const Vec2f &inputPosition, WorldIntegerPos &result) const
 
WorldIntegerPos GetWorldIntegerPosFromVec3f (const Vec3f &inputPosition) const
 
void GetWorldIntegerPosFromVec3f (const Vec3f &inputPosition, WorldIntegerPos &result) const
 

Conversion from WorldIntegerPos coordinates to floating-point coordinates

Vec2f GetVec2fFromWorldIntegerPos (const WorldIntegerPos &inputPosition) const
 
void GetVec2fFromWorldIntegerPos (const WorldIntegerPos &inputPosition, Vec2f &result) const
 

CoordPos64 <-> WorldIntegerPos Conversion

WorldIntegerPos GetWorldIntegerPosFromCoordPos64 (const CoordPos64 &inputPosition) const
 
void GetWorldIntegerPosFromCoordPos64 (const CoordPos64 &inputPosition, WorldIntegerPos &result) const
 
CoordPos64 GetCoordPos64FromWorldIntegerPos (const WorldIntegerPos &inputPosition) const
 
void GetCoordPos64FromWorldIntegerPos (const WorldIntegerPos &inputPosition, CoordPos64 &result) const
 

CellBox computation

void GetCellBoxOfAnAABBox (const Box2f &aABB, CellBox &cellBox) const
 
void GetCellBoxOfAnAABBox (const Box3f &aABB, CellBox &cellBox) const
 
void GetCellBoxOfAnAABBox (const CoordBox64 &aABB, CellBox &cellBox) const
 

For internal use only

void SetDefaultValues ()
 
KyFloat32 SnapFloatOnIntegerGrid (KyFloat32 inputValue) const
 
KyInt32 SnapFloatOnPixelGrid (KyFloat32 inputValue) const
 
KyInt64 ComputeCellPosXFromInteger64 (KyInt64 x) const
 
KyInt64 ComputeCellPosYFromInteger64 (KyInt64 y) const
 
void Setup ()
 

Members to be initialized before calling Setup()

KyFloat32 m_generationRadius
 
KyFloat32 m_generationHeight
 
KyFloat32 m_altitudeTolerance
 
KyFloat32 m_integerPrecision
 
KyInt32 m_cellSizeInPixel
 

Initialized from other members in Setup()

KyFloat32 m_integerPrecisionInv
 
KyFloat32 m_pixelSize
 
KyInt32 m_cellSizeInCoord
 

Member Function Documentation

void Kaim::DatabaseGenMetrics::Clear ( )
inline

Clears all information maintained by this object. For internal use.

CoordPos64 Kaim::DatabaseGenMetrics::ComputeCellOrigin ( const CellPos cellPos) const
inline

Retrieves the 64-bit integer coordinates that mark the origin point of theNavCell at the specified position.

CellPos Kaim::DatabaseGenMetrics::ComputeCellPos ( const Vec2f pos) const
inline

Retrieves the position of theNavCell in the grid that is responsible for the specified (X,Y) coordinates.

+ Examples:
void Kaim::DatabaseGenMetrics::ComputeCellPos ( const Vec2f pos,
CellPos cellPos 
) const
inline

Retrieves the position of theNavCell in the grid that is responsible for the specified (X,Y) coordinates.

Parameters
posThe coordinates you want to find the whichNavCell is responsible for.
[out]cellPosThe position of the NavCell responsible for pos.
CellPos Kaim::DatabaseGenMetrics::ComputeCellPos ( const Vec3f pos) const
inline

Retrieves the position within the grid of theNavCell that is responsible for the specified coordinates.

void Kaim::DatabaseGenMetrics::ComputeCellPos ( const Vec3f pos,
CellPos cellPos 
) const
inline

Retrieves the position of theNavCell in the grid that is responsible for the specified coordinates.

Parameters
posThe coordinates you want to find the whichNavCell is responsible for.
[out]cellPosThe position of the NavCell responsible for pos.
CellPos Kaim::DatabaseGenMetrics::ComputeCellPosFromCoordPos64 ( const CoordPos64 coordPos64) const
inline

Retrieves the position of theNavCell in the grid that is responsible for the specified (X,Y) coordinates.

void Kaim::DatabaseGenMetrics::ComputeCellPosFromCoordPos64 ( const CoordPos64 coordPos64,
CellPos cellPos 
) const
inline

Retrieves the position of theNavCell in the grid that is responsible for the specified (X,Y) coordinates.

Parameters
coordPos64The coordinates you want to find the whichNavCell is responsible for.
[out]cellPosThe position of the NavCell responsible for pos.
void Kaim::DatabaseGenMetrics::GetCellBoxOfAnAABBox ( const Box2f aABB,
CellBox cellBox 
) const
inline

Computes a CellBox from a Box2f.

void Kaim::DatabaseGenMetrics::GetCellBoxOfAnAABBox ( const Box3f aABB,
CellBox cellBox 
) const
inline

Computes a CellBox from a Box3f.

void Kaim::DatabaseGenMetrics::GetCellBoxOfAnAABBox ( const CoordBox64 aABB,
CellBox cellBox 
) const
inline

Computes a CellBox from a CoordBox64.

KyFloat32 Kaim::DatabaseGenMetrics::GetCellSize ( ) const
inline

Retrieves the size (length and width) of theNavCells in this Database.

CoordPos64 Kaim::DatabaseGenMetrics::GetCoordPos64FromVec2f ( const Vec2f inputPosition) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified floating-point coordinates.

void Kaim::DatabaseGenMetrics::GetCoordPos64FromVec2f ( const Vec2f inputPosition,
CoordPos64 result 
) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified floating-point coordinates.

CoordPos64 Kaim::DatabaseGenMetrics::GetCoordPos64FromVec3f ( const Vec3f inputPosition) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified floating-point coordinates.

void Kaim::DatabaseGenMetrics::GetCoordPos64FromVec3f ( const Vec3f inputPosition,
CoordPos64 result 
) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified floating-point coordinates.

CoordPos64 Kaim::DatabaseGenMetrics::GetCoordPos64FromWorldIntegerPos ( const WorldIntegerPos inputPosition) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified WorldIntegerPos coordinates.

void Kaim::DatabaseGenMetrics::GetCoordPos64FromWorldIntegerPos ( const WorldIntegerPos inputPosition,
CoordPos64 result 
) const
inline

Retrieves the 64-bit integer coordinates that correspond to the specified WorldIntegerPos coordinates.

KyFloat32 Kaim::DatabaseGenMetrics::GetFloatValueFromInteger32 ( KyInt32  inputValue) const
inline

Retrieves the float nearest to the specified 32-bit integer.

KyFloat32 Kaim::DatabaseGenMetrics::GetFloatValueFromInteger64 ( KyInt64  inputValue) const
inline

Retrieves the float nearest to the specified 64-bit integer.

KyFloat32 Kaim::DatabaseGenMetrics::GetGenerationAltitudeTolerance ( ) const
inline

Retrieves the altitude tolerance parameters that the NavMeshes in this Database were generated with.

KyFloat32 Kaim::DatabaseGenMetrics::GetGenerationHeight ( ) const
inline

Retrieves the height of the character that the NavMeshes in this Database were generated for.

+ Examples:
KyFloat32 Kaim::DatabaseGenMetrics::GetGenerationRadius ( ) const
inline

Retrieves the radius of the character that NavMeshes in this Database were generated for.

+ Examples:
KyInt64 Kaim::DatabaseGenMetrics::GetNearestInteger64FromFloatValue ( KyFloat32  inputValue) const
inline

Retrieves the 64-bit integer nearest to the specified float.

+ Examples:
KyFloat32 Kaim::DatabaseGenMetrics::GetPixelSize ( ) const
inline

Retrieves the size of pixel (raster precision) that the NavMeshes in this Database were generated with.

Vec2f Kaim::DatabaseGenMetrics::GetVec2fFromCoordPos64 ( const CoordPos64 inputPosition) const
inline

Retrieves the floating-point coordinates that correspond to the specified 64-bit integer coordinates.

void Kaim::DatabaseGenMetrics::GetVec2fFromCoordPos64 ( const CoordPos64 inputPosition,
Vec2f result 
) const
inline

Retrieves the floating-point coordinates that correspond to the specified 64-bit integer coordinates.

Vec2f Kaim::DatabaseGenMetrics::GetVec2fFromWorldIntegerPos ( const WorldIntegerPos inputPosition) const
inline

Retrieves the floating-point coordinates that correspond to the specified WorldIntegerPos coordinates.

void Kaim::DatabaseGenMetrics::GetVec2fFromWorldIntegerPos ( const WorldIntegerPos inputPosition,
Vec2f result 
) const
inline

Retrieves the floating-point coordinates that correspond to the specified WorldIntegerPos coordinates.

WorldIntegerPos Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromCoordPos64 ( const CoordPos64 inputPosition) const
inline

Retrieves the integer coordinates that correspond to the specified 64-bit integer coordinates.

void Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromCoordPos64 ( const CoordPos64 inputPosition,
WorldIntegerPos result 
) const

Retrieves the integer coordinates that correspond to the specified 64-bit integer coordinates.

WorldIntegerPos Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromVec2f ( const Vec2f inputPosition) const
inline

Retrieves the WorldIntegerPos coordinates that correspond to the specified floating-point coordinates.

void Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromVec2f ( const Vec2f inputPosition,
WorldIntegerPos result 
) const

Retrieves the WorldIntegerPos coordinates that correspond to the specified floating-point coordinates.

WorldIntegerPos Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromVec3f ( const Vec3f inputPosition) const
inline

Retrieves the WorldIntegerPos coordinates that correspond to the specified floating-point coordinates.

void Kaim::DatabaseGenMetrics::GetWorldIntegerPosFromVec3f ( const Vec3f inputPosition,
WorldIntegerPos result 
) const
inline

Retrieves the WorldIntegerPos coordinates that correspond to the specified floating-point coordinates.

void Kaim::DatabaseGenMetrics::SetDefaultValues ( )
inline

Clears all information maintained by this object. For internal use.

void Kaim::DatabaseGenMetrics::Setup ( )

Initialize m_integerPrecisionInv, m_pixelSize and m_cellSizeInCoord, it has to be called after other members were properly initialized.

Member Data Documentation

KyFloat32 Kaim::DatabaseGenMetrics::m_altitudeTolerance

The maximum difference in altitude that may exist between the NavMesh and the original terrain mesh. Do not modify.

KyInt32 Kaim::DatabaseGenMetrics::m_cellSizeInCoord

The number of integer steps in the length and width of each cell. Do not modify. Value set in Setup() based on m_cellSizeInPixel.

+ Examples:
KyInt32 Kaim::DatabaseGenMetrics::m_cellSizeInPixel

The number of raster pixels in the length and width of each cell. Do not modify.

KyFloat32 Kaim::DatabaseGenMetrics::m_generationHeight

The height of the character the NavMeshes in this DatabaseGenMetrics were generated for. Do not modify.

KyFloat32 Kaim::DatabaseGenMetrics::m_generationRadius

The radius of the character the NavMeshes in this DatabaseGenMetrics were generated for. Do not modify.

KyFloat32 Kaim::DatabaseGenMetrics::m_integerPrecision

For internal use. Do not modify.

KyFloat32 Kaim::DatabaseGenMetrics::m_integerPrecisionInv

For internal use. Do not modify. Value set in Setup() based on m_integerPrecision.

KyFloat32 Kaim::DatabaseGenMetrics::m_pixelSize

For internal use. Do not modify. Value set in Setup() based on m_integerPrecision.


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