added stuff for bluetooth

worked on resampling methods
This commit is contained in:
mail@toni-fetzer.de
2019-06-05 18:09:15 +02:00
parent cb61e0fe68
commit 8d37e94647
12 changed files with 472 additions and 320 deletions

View File

@@ -161,6 +161,19 @@ namespace NM {
float getWeightBetween(const TemporalNode& n1, const TemporalNode& n2) const {return n1.pt.getDistance(n2.pt);}
};
struct NodeAccessFavorCenter {
int getNumNeighbors(const TemporalNode& n) const {return n.neighbors.size();}
const TemporalNode* getNeighbor(const TemporalNode& n, const int idx) const {return n.neighbors[idx];}
float getWeightBetween(const TemporalNode& n1, const TemporalNode& n2) const {
if(n2.pointIndex == 3){
return n1.pt.getDistance(n2.pt);
} else {
return n1.pt.getDistance(n2.pt) / 0.2f;
}
}
};
public:
/** attach distance/triangle-to-target to the ToTarget struct */
@@ -187,7 +200,8 @@ namespace NM {
// Node* end = nodes[0]; // TODO;
NodeAccess acc;
//NodeAccess acc;
NodeAccessFavorCenter acc;
// dijkstra
Dijkstra<TemporalNode> dijkstra;

View File

@@ -151,7 +151,7 @@ namespace NM {
/**
* higher probability for potints that approach the target location
* higher probability for points that approach the target location
*/
template <typename Tria> class WalkEvalApproachesTarget : public NavMeshWalkEval<Tria> {