gwnavruntime/queries/utils/pathfinderquerytrycangomode.h Source File

pathfinderquerytrycangomode.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
10 
11 namespace Kaim {
12 
13 class LogicWithNoCustomCost;
14 class LogicWithCostPerNavTag;
15 class LogicWithCostPerTriangle;
16 
23 {
26 
29 
31  // This will give different results than a regular propagation when the TraverseLogic uses costs. When in doubt use PATHFINDER_TRY_RAYCANGO_IF_NO_COST.
33 };
34 
37 inline bool ShouldTryCanGo(const PathFinderQueryTryCanGoMode& mode, bool traverse_logic_try_can_go)
38 {
39 KY_PUSH_ERROR_ON_MISSING_EXPLICIT_CASE_LABEL
40  switch (mode)
41  {
43  return false;
44 
46  return true;
47 
49  return traverse_logic_try_can_go;
50 
51  default:
52  return traverse_logic_try_can_go;
53  }
54 KY_POP_ERROR_ON_MISSING_EXPLICIT_CASE_LABEL
55 }
56 inline bool ShouldTryCanGo(const PathFinderQueryTryCanGoMode& mode, const LogicWithNoCustomCost&) { return ShouldTryCanGo(mode, true); }
57 inline bool ShouldTryCanGo(const PathFinderQueryTryCanGoMode& mode, const LogicWithCostPerNavTag&) { return ShouldTryCanGo(mode, false); }
58 inline bool ShouldTryCanGo(const PathFinderQueryTryCanGoMode& mode, const LogicWithCostPerTriangle&) { return ShouldTryCanGo(mode, false); }
59 
60 typedef KY_DEPRECATED(PathFinderQueryTryCanGoMode AStarQueryTryCanGoMode); // AStarQueryTryCanGoMode is deprecated since 2.17.0, use PathFinderQueryTryCanGoMode instead
61 typedef KY_DEPRECATED(PathFinderQueryTryCanGoMode MultiDestinationPathFinderTryCanGoMode); // MultiDestinationPathFinderTryCanGoMode is deprecated since 2.17.0, use PathFinderQueryTryCanGoMode instead
62 
63 
64 }
Always try RayCanGoQuery, speeds up the PathFinder when a CanGo from Start to Dest succeeds...
Definition: pathfinderquerytrycangomode.h:32
PathFinderQueryTryCanGoMode
This enums tells if a RayCanGoQuery should be performed from start position to destination position b...
Definition: pathfinderquerytrycangomode.h:22
bool ShouldTryCanGo(const PathFinderQueryTryCanGoMode &mode, bool traverse_logic_try_can_go)
ShouldTryCanGo function should be called from functions templated with TraverseLogic the following wa...
Definition: pathfinderquerytrycangomode.h:37
#define KY_DEPRECATED(expr)
The compiler issues a warning when a deprecated function or typedef is used.
Definition: types.h:93
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Never try RayCanGoQuery particularly adapted if user knows there are high altitude differences which ...
Definition: pathfinderquerytrycangomode.h:28
Try RayCanGoQuery if TraverseLogic does not supports cost multipliers (cf. SimpleTraverseLogic). Default behavior.
Definition: pathfinderquerytrycangomode.h:25