76 lines
2.0 KiB
C++
76 lines
2.0 KiB
C++
/*
|
||
* © Copyright 2014 – Urheberrechtshinweis
|
||
* Alle Rechte vorbehalten / All Rights Reserved
|
||
*
|
||
* Programmcode ist urheberrechtlich geschuetzt.
|
||
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
|
||
* Keine Verwendung ohne explizite Genehmigung.
|
||
* (vgl. § 106 ff UrhG / § 97 UrhG)
|
||
*/
|
||
|
||
#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 = 80; // (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
|