gwnavruntime/queries/utils/basenearestborderhalfedgefromposquery.h Source File

basenearestborderhalfedgefromposquery.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 
15 
16 namespace Kaim
17 {
18 
21 {
24 
27 
29 };
30 
33 {
34 public:
35  static QueryType GetStaticType() { return TypeNearestBorderHalfEdgeFromPos; }
36  virtual QueryType GetType() const { return TypeNearestBorderHalfEdgeFromPos; }
37  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
38  virtual void InitFromQueryBlob(World* world, void* blob);
39  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
40  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
41 
42  // ------------------------------ Functions -----------------------------
43 
44  void BindToDatabase(Database* database);
45  void Initialize(const Vec3f& inputPos);
46 
47  void SetHorizontalTolerance(KyFloat32 horizontalTolerance) { m_horizontalTolerance = fabsf(horizontalTolerance); }
48  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange) { m_positionSpatializationRange = positionSpatializationRange; }
49  void SetInputIntegerPos(const WorldIntegerPos& inputIntegerPos) { m_inputIntegerPos = inputIntegerPos; }
50  void SetResult(NearestBorderHalfEdgeFromPosQueryResult result) { m_result = result; }
51 
52  NearestBorderHalfEdgeFromPosQueryResult GetResult() const { return m_result; }
53  const Vec3f& GetInputPos() const { return m_inputPos3f; }
54  const Vec3f& GetNearestPosOnHalfEdge() const { return m_nearestPosOnHalfEdge; }
55  const NavHalfEdgePtr& GetNearestHalfEdgePtrOnBorder() const { return m_nearestHalfEdgeOnBorder; }
56  const NavHalfEdgePtr& GetNextHalfEdgePtrAlongBorder() const { return m_nextHalfEdgeOnBorder; }
57  const NavHalfEdgePtr& GetPrevHalfEdgePtrAlongBorder() const { return m_prevHalfEdgeOnBorder; }
58  KyFloat32 GetHorizontalTolerance() const { return m_horizontalTolerance; }
59  KyFloat32 GetSquareDistFromNearestBorder() const { return m_squareDistFromHalfEdge; }
60  const WorldIntegerPos& GetInputIntegerPos() const { return m_inputIntegerPos; }
61  const WorldIntegerPos& GetNearestIntegerPosOnHalfEdge() const { return m_nearestPointOnHalfEdgeIntegerPos; }
62  const PositionSpatializationRange& GetPositionSpatializationRange() const { return m_positionSpatializationRange; }
63 
64 protected:
65  BaseNearestBorderHalfEdgeFromPosQuery();
66  virtual ~BaseNearestBorderHalfEdgeFromPosQuery() {}
67 
68 protected:
69  WorldIntegerPos m_inputIntegerPos;
70  WorldIntegerPos m_nearestPointOnHalfEdgeIntegerPos;
71 
73 
76 
80 
84 
88 
90 
92 
94 };
95 }
Vec3f m_nearestPosOnHalfEdge
Updated during processing to indicate the point on m_nearestHalfEdgeOnBorder that is the nearest to m...
Definition: basenearestborderhalfedgefromposquery.h:89
Indicates that the query was completed successfully, and a NavMesh border was found.
Definition: basenearestborderhalfedgefromposquery.h:28
NearestBorderHalfEdgeFromPosQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: basenearestborderhalfedgefromposquery.h:93
Indicates that a NavMesh border was not found within the query's bounding box.
Definition: basenearestborderhalfedgefromposquery.h:25
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
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:74
KyFloat32 m_squareDistFromHalfEdge
Updated during processing to indicate the square distance between m_inputPos3f and m_nearestPosOnHalf...
Definition: basenearestborderhalfedgefromposquery.h:91
virtual QueryType GetType() const
Get query type.
Definition: basenearestborderhalfedgefromposquery.h:36
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
Base class for NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:32
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
PositionSpatializationRange m_positionSpatializationRange
The Z extent from m_inputPos3f of the axis-aligned bounding box within which the search is performed...
Definition: basenearestborderhalfedgefromposquery.h:75
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that insufficient working memory caused the query to stop.
Definition: basenearestborderhalfedgefromposquery.h:26
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:20
NavHalfEdgePtr m_nextHalfEdgeOnBorder
Updated during processing to store the next triangle edge along the NavMesh border after m_nearestHal...
Definition: basenearestborderhalfedgefromposquery.h:83
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgeptr.h:16
Indicates the query has not yet been initialized.
Definition: basenearestborderhalfedgefromposquery.h:22
NavHalfEdgePtr m_prevHalfEdgeOnBorder
Updated during processing to store the previous triangle edge along the NavMesh border before m_neare...
Definition: basenearestborderhalfedgefromposquery.h:87
Vec3f m_inputPos3f
The starting position for the query.
Definition: basenearestborderhalfedgefromposquery.h:72
Indicates that the query has not yet been launched.
Definition: iquery.h:296
Indicates the query has not yet been launched.
Definition: basenearestborderhalfedgefromposquery.h:23
void Initialize()
Should be called by the derived class prior to perform the query or to push it in a QueryQueue...
Definition: iquery.h:220
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
NavHalfEdgePtr m_nearestHalfEdgeOnBorder
Updated during processing to store the nearest triangle edge found in m_inputPos3f.
Definition: basenearestborderhalfedgefromposquery.h:79