48 lines
1022 B
C++
48 lines
1022 B
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 NAVMESHLOCATION_H
|
||
#define NAVMESHLOCATION_H
|
||
|
||
#include "../geo/Point3.h"
|
||
|
||
class NavMeshTriangle;
|
||
|
||
namespace NM {
|
||
|
||
/**
|
||
* 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 {
|
||
|
||
/** 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
|