Kaim::Generator Class Reference
#include <generator.h>
The Generator is the principal class in the NavData generation system.
Output files
The Generator is capable of generating multiple kinds of data files:
- .ClientInput files, which are records of the input triangles, NavTags and TagVolumes that describe your terrain, passed as inputs to the NavData generation system.
- .GenIO files, which record the list of sectors and the generation parameters that where used when the Generator::Generate() function was called. See Kaim::GeneratorInputOutput class
- Intermediate data files, which record temporary data calculated during the generation process. Mostly for debug purposes.
- Final .NavData files, which contain the final data that you will load into your game at runtime. You can control which types of data files you want to generate each time you use the Generator.
Sectors and multi-sectors
The Generator can be set up with any number of sectors, each of which is responsible for a block of terrain geometry within a defined area of your game world. Separate input, intermediate and output data are created for each sector, so that the sectors can be streamed into memory independently at runtime. Adjacent sectors whose triangles lie close to each other will be linked automatically at runtime. You can also configure the Generator to re-partition each sector that you provide into smaller sectors automatically.
Inherits Kaim::RefCountBaseNTS< C, Stat >.
Constructs a new Generator initialized with the provided information.
- Parameters
-
producer | A pointer to an object that the Generator will use to retrieve the input data for each sector.This object is ref-counted : It will be destroyed automatically when appropriate. |
parallelForInterface | A pointer to an object that the Generator will use to parallelize computations over multiple processors, or nullptr in order to perform all computations sequentially on a single processor. This object is ref-counted; It will be destroyed automatically when appropriate. |
tlsAlloc | A pointer to an object that the Generator will use to allocate and free memory in secondary threads, when configured to use parallel generation. This object is ref-counted; It will be destroyed automatically when appropriate. |
collisionInterface | A pointer to an object that the Generator will use to cast 3D raycast against the input geometry. Not used at the moment. |
Launch the generation of the sectors stored in config
, using the config parameters and runOptions also defined in this structure.
See GeneratorInputOutput for more information
const String& Kaim::Generator::GetAbsoluteOutputDirectory |
( |
| ) |
const |
|
inline |
const GeneratorProfiling& Kaim::Generator::GetGeneratorProfiling |
( |
| ) |
const |
|
inline |
Get some profiling information about the time taken by the various steps of the generation.
Retrieves a detailed record of the results of the last call to Generate().
template<class OSTREAM >
void Kaim::Generator::LogConfiguration |
( |
OSTREAM & |
os | ) |
|
|
inline |
Creates a detailed record of all configuration parameters and sector information, and writes the record to the specified stream.
Sets the Kaim::FileOpenerBase derived class that will be used to open any files.
This is not mandatory to call this function, an instance of DefaultFileOpener
will be used automatically.
void Kaim::Generator::SetOutputDirectory |
( |
const char * |
absoluteOutputBaseDir, |
|
|
const char * |
relativeOutputDir |
|
) |
| |
Sets the directory used for the generation.
It is passed as an absolute directory and a relative path. The relative path will be embedded in the generated data, so when visual debugging all data can be found by providing absoluteBaseDirectory to the NavigationLab.
- Parameters
-
absoluteOutputBaseDir | An absolute path used as a base path for relativeOutputDir |
relativeOutputDir | A relative path to absoluteOutputBaseDir. The absolute path to this directory is : absoluteOutputBaseDir/relativeOutputDir |
The documentation for this class was generated from the following files:
- gwnavgeneration/generator/generator.h
- gwnavgeneration/generator/generator.cpp