worked on navMesh stuff
- creation - walking - helper
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user