gwnavruntime/queries/utils/basenearestborderhalfedgefromposquery.h Source File

basenearestborderhalfedgefromposquery.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 
8 
9 
10 // Primary contact: JUBA - secondary contact: NOBODY
11 #ifndef Navigation_BaseNearestBorderHalfEdgeFromPosQuery_H
12 #define Navigation_BaseNearestBorderHalfEdgeFromPosQuery_H
13 
20 
21 
22 namespace Kaim
23 {
24 
25 class ActiveCell;
26 template <class T> class WorkingMemArray;
27 
30 {
33 
36 
38 };
39 
42 {
43 public:
44  static QueryType GetStaticType() { return TypeNearestBorderHalfEdgeFromPos; }
45  virtual QueryType GetType() const { return TypeNearestBorderHalfEdgeFromPos; }
46  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
47  virtual void InitFromQueryBlob(World* world, void* blob);
48  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
49  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
50 
51 
52  // ---------------------------------- Main API Functions ----------------------------------
53 
55  const Vec3f& GetInputPos() const;
56  const Vec3f& GetNearestPosOnHalfEdge() const;
57  const NavHalfEdgePtr& GetNearestHalfEdgePtrOnBorder() const;
58  const NavHalfEdgePtr& GetNextHalfEdgePtrAlongBorder() const;
59  const NavHalfEdgePtr& GetPrevHalfEdgePtrAlongBorder() const;
60  KyFloat32 GetHorizontalTolerance() const;
61  KyFloat32 GetSquareDistFromNearestBorder() const;
62  const WorldIntegerPos& GetInputIntegerPos() const;
63  const WorldIntegerPos& GetNearestIntegerPosOnHalfEdge() const;
64  const PositionSpatializationRange& GetPositionSpatializationRange() const;
65 
66 
67 protected:
70 
71  void BindToDatabase(Database* database);
72  void Initialize(const Vec3f& inputPos);
73 
74  void SetHorizontalTolerance(KyFloat32 horizontalTolerance);
75  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
76  void SetInputIntegerPos(const WorldIntegerPos& inputIntegerPos);
77  void SetResult(NearestBorderHalfEdgeFromPosQueryResult result);
78 
79 protected:
80  WorldIntegerPos m_inputIntegerPos;
81  WorldIntegerPos m_nearestPointOnHalfEdgeIntegerPos;
82 
84 
86  PositionSpatializationRange m_positionSpatializationRange;
87 
91 
95 
99 
103 
105 };
106 
108 }
112 #endif //Navigation_BaseNearestBorderHalfEdgeFromPosQuery_H
113 
Vec3f m_nearestPosOnHalfEdge
Updated during processing to indicate the point on m_nearestHalfEdgeOnBorder that is the nearest to m...
Definition: basenearestborderhalfedgefromposquery.h:107
Indicates that the query was completed successfully, and a NavMesh border was found.
Definition: basenearestborderhalfedgefromposquery.h:37
NearestBorderHalfEdgeFromPosQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: basenearestborderhalfedgefromposquery.h:111
Indicates that a NavMesh border was not found within the query's bounding box.
Definition: basenearestborderhalfedgefromposquery.h:34
KyFloat32 m_horizontalTolerance
The horizontal half-width (along both the X and Y axes) of the axis-aligned bounding box within which...
Definition: basenearestborderhalfedgefromposquery.h:92
KyFloat32 m_squareDistFromHalfEdge
Updated during processing to indicate the square distance between m_inputPos3f and m_nearestPosOnHalf...
Definition: basenearestborderhalfedgefromposquery.h:109
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:289
Base class for NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:41
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
PositionSpatializationRange m_positionSpatializationRange
The Z extent from m_inputPos3f of the axis-aligned bounding box within which the search is performed...
Definition: basenearestborderhalfedgefromposquery.h:93
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
Definition: gamekitcrowddispersion.h:20
Indicates that insufficient working memory caused the query to stop.
Definition: basenearestborderhalfedgefromposquery.h:35
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:29
NavHalfEdgePtr m_nextHalfEdgeOnBorder
Updated during processing to store the next triangle edge along the NavMesh border after m_nearestHal...
Definition: basenearestborderhalfedgefromposquery.h:101
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgeptr.h:19
Indicates the query has not yet been initialized.
Definition: basenearestborderhalfedgefromposquery.h:31
NavHalfEdgePtr m_prevHalfEdgeOnBorder
Updated during processing to store the previous triangle edge along the NavMesh border before m_neare...
Definition: basenearestborderhalfedgefromposquery.h:105
Vec3f m_inputPos3f
The starting position for the query.
Definition: basenearestborderhalfedgefromposquery.h:90
Indicates that the query has not yet been launched.
Definition: iquery.h:347
Indicates the query has not yet been launched.
Definition: basenearestborderhalfedgefromposquery.h:32
void Initialize()
Should be called by the derived class before trying to perform the query or to push it in a QueryQueu...
Definition: iquery.h:372
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
NavHalfEdgePtr m_nearestHalfEdgeOnBorder
Updated during processing to store the nearest triangle edge found in m_inputPos3f.
Definition: basenearestborderhalfedgefromposquery.h:97