9 #ifndef Navigation_RayQueryUtils_H
10 #define Navigation_RayQueryUtils_H
23 class NavTriangleRawPtr;
25 class NavHalfEdgeRawPtr;
26 class TriangleFromPosAndTriangleSeedQuery;
27 class WorldIntegerPos;
28 class LocalStoreActiveDataWorkspaceContext;
29 class RawNavTagSubSegment;
32 template <
class T>
class WorkingMemArray;
41 class CompositeSubSegment
44 CompositeSubSegment() {}
45 CompositeSubSegment(
const Vec3f& startPos3f,
const NavTriangleRawPtr& startTriangle,
KyFloat32 costMultiplier)
47 m_rawNavTagSubSegment.m_navTriangleRawPtr = startTriangle;
48 m_rawNavTagSubSegment.m_entrancePos3f = startPos3f;
49 m_costMultiplierSubSegment.m_costMultiplier = costMultiplier;
50 m_costMultiplierSubSegment.m_entrancePos3f = startPos3f;
53 RawNavTagSubSegment m_rawNavTagSubSegment;
54 CostMultiplierSubSegment m_costMultiplierSubSegment;
69 template<
class TraverseLogic>
78 void UpdateCostAlongAxis(
const Vec3f& endOfCostMultiplierSegment,
KyFloat32& cost);
80 template<
class TLogic>
83 return NeedToCommputeOrStoreDataFromCost(
typename TLogic::CostMultiplierUsage(), dynamicOutputMode, computeCostMode);
87 static KyResult FinalizeLastSubSegment(
DynamicOutputMode dynamicOutputMode, ScopedDynamicOutput& scopedDynamicOutput,
const Vec3f& lastPos, CompositeSubSegment& subSegment);
103 bool updateDataFromCostLimit,
KyFloat32& cost);
106 static KY_INLINE
bool NeedToCommputeOrStoreDataFromCost(
const LogicWithCostMultiplerPerNavTag&,
DynamicOutputMode dynamicOutputMode,
ComputeCostMode computeCostMode)
108 return NeedToCommputeOrStoreDataFromCost_Impl(dynamicOutputMode, computeCostMode);
110 static KY_INLINE
bool NeedToCommputeOrStoreDataFromCost(
const LogicWithCostMultiplerPerTriangle&,
DynamicOutputMode dynamicOutputMode,
ComputeCostMode computeCostMode)
112 return NeedToCommputeOrStoreDataFromCost_Impl(dynamicOutputMode, computeCostMode);
121 void* m_traverseLogicUserData;
125 ScopedDynamicOutput* m_scopedDynamicOutput;
128 Vec3f m_currentCostMultiplierStartPos;
132 template<
class TLogic>
133 KY_INLINE
KyResult RayQueryUtils::StoreOrComputeCostFromPropagationData(
KyFloat32 integerPrecision,
const NavHalfEdgeRawPtr& currentPairHalfEdgeRawPtr,
134 CompositeSubSegment& currentSubSegment,
const CoordPos64& cellOrigin,
const NavFloorBlob* navFloorBlob,
KyFloat32 nextCostMultiplier,
KyFloat32& cost)
136 bool updateDataFromCostLimit = NeedToCommputeOrStoreDataFromCost<TLogic>(m_dynamicOutputMode, m_computeCostMode);
137 return StoreOrComputeCostFromPropagationData(integerPrecision, currentPairHalfEdgeRawPtr, currentSubSegment,
138 cellOrigin,navFloorBlob, nextCostMultiplier, updateDataFromCostLimit, cost);
144 #endif //Navigation_RayQueryUtils_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
The NavFloorBlob contains a connected and not overlapping part of triangle mesh static data within a ...
Definition: navfloorblob.h:42
The cost is not computed.
Definition: rayqueryutils.h:37
KyUInt32 NavHalfEdgeIdx
An index that uniquely identifies a single edge of a triangle within the set of edges owned by a NavF...
Definition: navmeshtypes.h:87
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
This class defines a two-dimensional vector whose coordinates are stored using 64-bit integers...
Definition: vec2ll.h:27
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
This class is a "volatile" version of the NavTagSubSegment class.
Definition: navtagsubsegment.h:20
ComputeCostMode
Enumerates the possible ways a RayCanGoQuery can compute the cost of following the ray...
Definition: rayqueryutils.h:35
Vec2LL CoordPos64
A type that represents the position of a point within the 2D integer grid.
Definition: navmeshtypes.h:19
Definition: gamekitcrowddispersion.h:20
This class is an helper used internaly to factorize code of Ray queries (RayCanGoQuery, RayCastGoQuery, ...)
Definition: rayqueryutils.h:60
Indicates that QueryDynamicOutput will not be used to store anything.
Definition: querydynamicoutput.h:28
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtrianglerawptr.h:30
This class represents a CostMultiplier sub-segment of a ray (within a RayCastQuery or a RayCanGoQuery...
Definition: costmultipliersubsegment.h:25
The cost is computed according to the CanTraverseAndGetCostMultiplier function of the traverseLogic...
Definition: rayqueryutils.h:38
Indicates that QueryDynamicOutput will be used to store CostMultiplierSubSegment. ...
Definition: querydynamicoutput.h:33
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
Each instance of this class uniquely identifies a singleNavHalfEdge in a NavFloor.
Definition: navhalfedgerawptr.h:34
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23