minor changes to floorplan
fixed some compile issues worked on nav-meshes added some tests
This commit is contained in:
63
navMesh/NavMeshSettings.h
Normal file
63
navMesh/NavMeshSettings.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#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;
|
||||
|
||||
const 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
|
||||
Reference in New Issue
Block a user