16 #include <matrix/vlVector.h>
18 #include "boost/shared_ptr.hpp"
19 #include "boost/weak_ptr.hpp"
57 typedef boost::shared_ptr<DtNavAreaQuery>
Ptr;
63 virtual bool tick() = 0;
64 virtual bool success() = 0;
67 virtual bool navDataChanged() = 0;
68 virtual bool outOfWorkingMemory() = 0;
69 virtual bool hadComputationError() = 0;
71 virtual std::vector<DtVector> results() = 0;
72 virtual std::vector<DtVector>
debugPoints() {
return std::vector<DtVector>(); };
73 virtual void* internalQuery() = 0;
84 virtual bool tick() {
return true; };
90 virtual std::vector<DtVector>
results() {
return std::vector<DtVector>(); };
98 regenerateAtRuntime(true), maxRegenerationThreads(2), regenerationDelay(2.5) {};
102 int workingMemorySize;
150 typedef void (*DtSearchAreaPointCostModifierEvaluatorFcn)(
const DtVector& localPoint,
float* currentCost,
void* userData);
152 typedef void(*DtSectorRegenerationCb)(
void* userData);
155 static void setNavAreaCreatorFcn(DtNavAreaCreatorFcn fcn);
157 static bool navAreaDebuggingEnabled();
158 static void setNavAreaDebuggingEnabled(
bool enable);
162 std::vector<DtString> profiles = std::vector<DtString>()) = 0;
163 virtual void update(
float deltaTimeInSeconds) = 0;
167 virtual bool inNavArea(
const DtVector& localPos) = 0;
171 virtual bool validForProfile(
const DtString& profile)
const = 0;
173 virtual DtNavDataDebugInfo* debugInfo() = 0;
175 virtual void setExtent(
DtExtent* e) = 0;
185 DtPointOfInterestEvaluatorFcn evalFcn = 0, DtPathCalculatedEvaluatorFcn pathFcn = 0,
void* evalFcnUserData = 0) = 0;
192 DtPointOfInterestNavTagEvaluatorFcn evalFcn = 0, DtPathCalculatedEvaluatorFcn pathFcn = 0,
void* evalFcnUserData = 0) = 0;
199 DtPointOfInterestEvaluatorFcn evalFcn = 0, DtPathCalculatedEvaluatorFcn pathFcn = 0,
void* evalFcnUserData = 0) = 0;
202 virtual bool findInsidePositionFromOutsidePosition(
const DtString& profile,
203 double searchRadius,
double searchHeight,
const DtVector& fromFromHere,
204 DtVector& result,
int& halfEdgeType) = 0;
208 const std::vector<DtVector>& localDestinationPositions,
DtNavBot* searcher,
int tag = -1,
209 DtSearchAreaPointCostModifierEvaluatorFcn = 0, DtPointOfInterestEvaluatorFcn = 0, DtPathCalculatedEvaluatorFcn = 0,
210 void* usrData = 0,
bool startMovingWhenFound =
false) = 0;
214 const DtVector& destination,
bool useAbstractGraphs =
true,
215 const DtVector& locationToAvoid =
DtVector(),
double avoidanceRadius = 0) = 0;
219 virtual bool findFarthestPositionAlongHeading(
const DtString& profile,
const DtVector& start,
220 double heading,
double maxDistance,
DtVector& result,
bool& reachedMaxDist) = 0;
253 const DtVector& localAccessibilityPoint = DtVector::zero(),
254 double minRadius = -1,
255 double maxRadius = -1,
257 unsigned numberOfPoints = 1,
258 double minDistanceBetweenPoints = 0.0,
259 const DtString& placementRestriction = DtString::nullString(),
260 bool isStrict =
true,
261 bool tightlyPack =
false,
262 bool needLos =
false,
263 bool groundClamp =
false,
265 DtLocalPointUserEvalCallback callbackFcn = emptyCallback,
266 void* userData = 0) = 0;
269 virtual bool tagVolumesToBeIntegrated()
const = 0;
278 virtual std::vector<DtVector> searchInArea(
const DtString& profile,
279 const DtVector& startLocalPos,
double radius,
double postSpacing,
DtNavBot* searcher,
280 DtPointOfInterestEvaluatorFcn evalFcn = 0,
void* evalFcnUserData = 0,
int tag = -1) = 0;
283 virtual unsigned newNavTagVolumeId() = 0;
286 virtual void associateNavTagVolumeIdWithObject(
unsigned tagVolumeId,
const DtUUID& objectUUID) = 0;
290 virtual DtUUID uuidFromNavTagVolumeId(
unsigned navTagId) = 0;
294 virtual unsigned navTagVolumeIdFromUuid(
const DtUUID& objectUUID) = 0;
304 virtual void addSectorRegenerationCallback(DtSectorRegenerationCb cb,
void* usr) = 0;
305 virtual void removeSectorRegenerationCallback(DtSectorRegenerationCb cb,
void* usr) = 0;
311 const std::set<DtString>& profiles = std::set<DtString>()) = 0;