Kaim::ClientInputConsumer Class Reference

#include <clientinputconsumer.h>

Class Description

The ClientInputConsumer class is one of the primary components of the NavData generation system.

Its role is to accept data that describes your terrain from within Kaim::GeneratorInputProducer::Produce(const GeneratorSector& sector, ClientInputConsumer& consumer). This data is then used as input for the NavData generation process. This data includes:

  • The triangles that make up the terrain mesh, along with an optional color for each that defines its
  • material: the type of terrain it represents.
  • Optional 3D Tag volumes that tag all triangles within their volumes with a particular NavTag.
  • Optional seed points that identify walkable areas.
+ Examples:

Public Attributes

ClientInputConsumerStatistics m_stats
 Maintains statistics about the data added to this object. Do not modify. More...
 
GeneratorSystemm_sys
 Fast access to the Generator-related information. More...
 

Private Member Functions

void Flush ()
 internal usage by GeneratorSectorBuilder More...
 

Private Attributes

Ptr< GeneratorSectorm_sector
 Internal member: The sector being processed. More...
 
DynamicNavTag m_defaultNavTag
 shortcut for m_sys m_genParams.m_defaultNavTag; More...
 
bool m_backFaceTrianglesWalkable
 Internal member: Accessed using ToggleBackfaceTriangleFiltering. More...
 
KyFloat32 m_cosSlopeMax
 Internal member: cosinus of maximum slope. More...
 
DynamicClientInputChunk m_dynamicClientInputChunk
 Internal member: Original input chunk. More...
 
KyUInt32 m_clientInputFlushCount
 Internal member: Count how many times the ClientInput was flushed. More...
 
SpatializedSectorInput * m_spatializedSectorInput
 Internal member:sSpatialized input in Navigation coordinates. More...
 
KyArray< Vec3f > * m_seedPoints
 Internal member: Consumed seedpoints in Navigation coordinates. More...
 
KyArray< Triangle3fi > m_tessellatedOutput
 Temporary buffer for tessellated triangles - in Navigation coordinates. More...
 
KyArray< Triangle3fi > m_tessellatedStack
 Temporary buffer for tessellated - in Navigation coordinates. More...
 
KyArray< Ptr< IndexedMesh > > * m_indexedMeshes
 Internal member: Consumed IndexedMesh in Navigation coordinates. More...
 
Ptr< HeightField > * m_heightfield
 Internal member: Consumed heightField in Navigation coordinates. More...
 

Consumption

KyResult ConsumeTriangle (const Vec3f &A, const Vec3f &B, const Vec3f &C)
 A, B and C are in Navigation coordinate system. m_defaultNavTag is used. More...
 
KyResult ConsumeTriangle (const Vec3f &client_A, const Vec3f &client_B, const Vec3f &client_C, const CoordSystem &clientCoordSystem)
 A, B and Care in client coordinate system. m_defaultNavTag is used. More...
 
KyResult ConsumeTriangle (const Vec3f &A, const Vec3f &B, const Vec3f &C, const DynamicNavTag &navTag)
 A, B and C are in Navigation coordinate system. More...
 
KyResult ConsumeTriangle (const Vec3f &client_A, const Vec3f &client_B, const Vec3f &client_C, const DynamicNavTag &navTag, const CoordSystem &clientCoordSystem)
 A, B and C are in client coordinate system. More...
 
KyResult ConsumeTagVolume (const ClientInputTagVolume &inputTagVolume)
 Provides a single tag volume to the ClientInputConsumer. More...
 
KyResult ConsumeSeedPoint (const Vec3f &position)
 Provides a seed point that identifies a walkable area of the terrain. More...
 
KyResult ConsumeSeedPointInClientCoordinates (const Vec3f &client_position, const CoordSystem &clientCoordSystem)
 Identical to previous function but uses vertices in client coordinate system that must be specified in order to convert them in Navigation CoordSystem. More...
 
KyResult ConsumeHeightField (Ptr< HeightField > heightfield)
 
KyResult ConsumeHeightFieldFile (const String &heightfieldFileName)
 
KyResult ConsumeIndexedMesh (Ptr< IndexedMesh > indexedMesh)
 
KyResult ConsumeIndexedMeshFile (const String &indexedMeshFileName)
 
ClientInputConsumerStatistics & GetStats ()
 Retrieves information about the triangles consumed by this object. More...
 
Color GetNavTagColor (const DynamicNavTag &dynamicNavTag) const
 

Member Function Documentation

KyResult Kaim::ClientInputConsumer::ConsumeSeedPoint ( const Vec3f position)

Provides a seed point that identifies a walkable area of the terrain.

If you provide a seed point, any areas of NavData that are not reachable from that seed point are automatically discarded during a post-processing phase. You can provide as many seed points as necessary for each sector. All coordinates and altitudes must be expressed in Navigation coordinate system.

Parameters
positionThe position of the seed point
KyResult Kaim::ClientInputConsumer::ConsumeSeedPointInClientCoordinates ( const Vec3f client_position,
const CoordSystem clientCoordSystem 
)
inline

Identical to previous function but uses vertices in client coordinate system that must be specified in order to convert them in Navigation CoordSystem.

KyResult Kaim::ClientInputConsumer::ConsumeTagVolume ( const ClientInputTagVolume inputTagVolume)

Provides a single tag volume to the ClientInputConsumer.

They will be transformed automatically according to the CoordSystem set up for the Generator.

KyResult Kaim::ClientInputConsumer::ConsumeTriangle ( const Vec3f A,
const Vec3f B,
const Vec3f C 
)
inline
KyResult Kaim::ClientInputConsumer::ConsumeTriangle ( const Vec3f client_A,
const Vec3f client_B,
const Vec3f client_C,
const CoordSystem clientCoordSystem 
)
inline

A, B and Care in client coordinate system. m_defaultNavTag is used.

KyResult Kaim::ClientInputConsumer::ConsumeTriangle ( const Vec3f A,
const Vec3f B,
const Vec3f C,
const DynamicNavTag &  navTag 
)

A, B and C are in Navigation coordinate system.

KyResult Kaim::ClientInputConsumer::ConsumeTriangle ( const Vec3f client_A,
const Vec3f client_B,
const Vec3f client_C,
const DynamicNavTag &  navTag,
const CoordSystem clientCoordSystem 
)

A, B and C are in client coordinate system.

void Kaim::ClientInputConsumer::Flush ( )
private

internal usage by GeneratorSectorBuilder

ClientInputConsumerStatistics& Kaim::ClientInputConsumer::GetStats ( )
inline

Retrieves information about the triangles consumed by this object.

Member Data Documentation

bool Kaim::ClientInputConsumer::m_backFaceTrianglesWalkable
private

Internal member: Accessed using ToggleBackfaceTriangleFiltering.

KyUInt32 Kaim::ClientInputConsumer::m_clientInputFlushCount
private

Internal member: Count how many times the ClientInput was flushed.

KyFloat32 Kaim::ClientInputConsumer::m_cosSlopeMax
private

Internal member: cosinus of maximum slope.

DynamicNavTag Kaim::ClientInputConsumer::m_defaultNavTag
private

shortcut for m_sys m_genParams.m_defaultNavTag;

DynamicClientInputChunk Kaim::ClientInputConsumer::m_dynamicClientInputChunk
private

Internal member: Original input chunk.

Ptr<HeightField>* Kaim::ClientInputConsumer::m_heightfield
private

Internal member: Consumed heightField in Navigation coordinates.

KyArray<Ptr<IndexedMesh> >* Kaim::ClientInputConsumer::m_indexedMeshes
private

Internal member: Consumed IndexedMesh in Navigation coordinates.

Ptr<GeneratorSector> Kaim::ClientInputConsumer::m_sector
private

Internal member: The sector being processed.

KyArray<Vec3f>* Kaim::ClientInputConsumer::m_seedPoints
private

Internal member: Consumed seedpoints in Navigation coordinates.

SpatializedSectorInput* Kaim::ClientInputConsumer::m_spatializedSectorInput
private

Internal member:sSpatialized input in Navigation coordinates.

ClientInputConsumerStatistics Kaim::ClientInputConsumer::m_stats

Maintains statistics about the data added to this object. Do not modify.

GeneratorSystem* Kaim::ClientInputConsumer::m_sys

Fast access to the Generator-related information.

KyArray<Triangle3fi> Kaim::ClientInputConsumer::m_tessellatedOutput
private

Temporary buffer for tessellated triangles - in Navigation coordinates.

KyArray<Triangle3fi> Kaim::ClientInputConsumer::m_tessellatedStack
private

Temporary buffer for tessellated - in Navigation coordinates.


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