This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/navMesh/NavMeshSettings.h
2018-01-24 11:44:08 +01:00

64 lines
1.7 KiB
C++

#ifndef NAVMESHSETTINGS_H
#define NAVMESHSETTINGS_H
namespace NM {
enum class SamplePartitionType {
SAMPLE_PARTITION_WATERSHED,
SAMPLE_PARTITION_MONOTONE,
SAMPLE_PARTITION_LAYERS,
};
struct NavMeshSettings {
/** maximum resolution for outputs. nothing below this size will be detected (walls, doors, ..) */
float maxQuality_m = 0.20f;
/** height of the walking person (used to delete regions below other regions) */
float agentHeight = 1.8f;
/** radius of the walking person (used to shrink the walkable area) */
float agentRadius = 0.2f;
/** the max angle (degree) the pedestrian is able to walk */
float agentMaxSlope = 45.0f; // elevator???
/** maximal size for one triangle. too high = too many samples when walking! */
float edgeMaxLen = 10.0f;
/** higher values allow joining some small triangles */
float edgeMaxError = 1.1f; //1.3f;
/** algorithm choice */
SamplePartitionType partitionType = SamplePartitionType::SAMPLE_PARTITION_WATERSHED;
float regionMinSize = 2;//8; // (isolated) regions smaller than this will not be rendered?!
const float regionMergeSize = 20; //??
const int vertsPerPoly = 3;//6.0f;
const float detailSampleDist = 6.0f;
const float detailSampleMaxError = 1.0f;//1.0f;
float getCellSizeXY() const {
return maxQuality_m / 2.0f;
}
float getCellSizeZ() const {
return maxQuality_m / 2.0f;
}
/** allow jumping onto stairs from the side. usually we do not want this -> set it as low as possible */
float getMaxClimb() const {
return maxQuality_m; // prevent jumping onto stairs from the side of the stair. setting this below 2xgrid-size will fail!
}
};
}
#endif // NAVMESHSETTINGS_H