worked on navMesh stuff

- creation
- walking
- helper
This commit is contained in:
k-a-z-u
2018-01-10 16:57:19 +01:00
parent 3fc9688825
commit fee6cd3496
15 changed files with 1282 additions and 957 deletions

View File

@@ -3,17 +3,35 @@
#include "../geo/Point3.h"
template <typename Tria> struct NavMeshLocation {
class NavMeshTriangle;
const Tria* tria;
namespace NM {
Point3 pos;
/**
* as Point3 -> Triangle (on Mesh) lookups are expensive,
* we try to combine both information (point -> triangle)
* most of the time using this structure
*/
template <typename Tria> struct NavMeshLocation {
/** ctor */
NavMeshLocation(Point3 pos, const Tria* tria) : pos(pos), tria(tria) {
;
}
/** point within the world (in meter) */
Point3 pos;
};
/** NavMeshTriangle the point belongs to */
const Tria* tria;
/** empty ctor */
NavMeshLocation() : pos(0,0,0), tria(nullptr) {
;
}
/** ctor */
NavMeshLocation(const Point3 pos, const Tria* tria) : pos(pos), tria(tria) {
;
}
};
}
#endif // NAVMESHLOCATION_H