gwnavruntime/queries/trianglefromposandtriangleseedquery.h Source File

trianglefromposandtriangleseedquery.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 
12 
13 namespace Kaim
14 {
15 
16 class NavHalfEdgeRawPtr;
17 template <class T> class WorkingMemArray;
18 
21 {
24 
27 
29 
31 };
32 
33 
38 {
39 public:
40  // ------------------------------ Functions -----------------------------
41 
42  static QueryType GetStaticType() { return TypeTriangleFromPosAndTriangleSeed; }
43  virtual QueryType GetType() const { return TypeTriangleFromPosAndTriangleSeed; }
44 
47 
48  // ---------------------------------- Functions to set up the query ----------------------------------
49 
53  void BindToDatabase(Database* database);
54 
60  void Initialize(const NavTrianglePtr& seedTrianglePtr, const Vec3f& pos);
61 
62  // ---------------------------------- Query framework functions ----------------------------------
63 
64  virtual void Advance(WorkingMemory* workingMemory);
65 
67  void PerformQuery(WorkingMemory* workingMemory = nullptr);
68 
69  // ---------------------------------- Accessors ----------------------------------
70 
71  TriangleFromPosAndTriangleSeedResult GetResult() const;
72  const Vec3f& GetInputPos() const;
73  const NavTrianglePtr& GetSeedTrianglePtr() const;
74  const NavTrianglePtr& GetResultTrianglePtr() const;
75 
76 public: // internal
77  void SetInputIntegerPos(const WorldIntegerPos& integerPos);
78  const WorldIntegerPos& GetInputIntegerPos() const;
79  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
80 
81 private:
82  void SetResult(TriangleFromPosAndTriangleSeedResult result);
83  void GetNearestTrianglePtrFromTriangleSeed_Crown();
84  bool IsPointInsideCurrentTriangle(const NavHalfEdgeRawPtr& currentOutComingEdge) const;
85 
86 private:
88 
90 
92 
96 
98 };
99 
100 }
101 
103 
104 
105 
106 
Insufficient working memory caused the query to stop.
Definition: trianglefromposandtriangleseedquery.h:28
NavTrianglePtr m_seedTrianglePtr
start of the propagation.
Definition: trianglefromposandtriangleseedquery.h:89
The query has not yet been initialized.
Definition: trianglefromposandtriangleseedquery.h:22
virtual QueryType GetType() const
Get query type.
Definition: trianglefromposandtriangleseedquery.h:43
Vec3f m_inputPos3f
input position
Definition: trianglefromposandtriangleseedquery.h:91
The query completed, a triangle was found.
Definition: trianglefromposandtriangleseedquery.h:30
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
void PerformQuery(WorkingMemory *workingMemory=nullptr)
If workingMemory param is nullptr, m_database.GetWorkingMemory() will be used.
Definition: trianglefromposandtriangleseedquery.cpp:52
The query has not yet been launched.
Definition: trianglefromposandtriangleseedquery.h:23
TriangleFromPosAndTriangleSeedResult
Enumerates the possible results of a TriangleFromPosAndTriangleSeedQuery.
Definition: trianglefromposandtriangleseedquery.h:20
The query completed, no triangle was found.
Definition: trianglefromposandtriangleseedquery.h:26
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Finds a triangle that contains the m_inputPos3f 2d coords by testing m_seedTrianglePtr and m_seedTria...
Definition: trianglefromposandtriangleseedquery.h:37
NavTrianglePtr m_resultTrianglePtr
Updated during processing to store the nearest triangle found to m_inputPos3f.
Definition: trianglefromposandtriangleseedquery.h:95
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: trianglefromposandtriangleseedquery.inl:10
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:19
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: trianglefromposandtriangleseedquery.cpp:22
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
TriangleFromPosAndTriangleSeedResult m_result
Updated during processing to indicate the result of the query.
Definition: trianglefromposandtriangleseedquery.h:97
Indicates that the query has not yet been launched.
Definition: iquery.h:296
WorldIntegerPos m_inputIntegerPos
input position in integer coordinates
Definition: trianglefromposandtriangleseedquery.h:87
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
An invalid NavTrianglePtr was provided as the seed point; the query cannot be processed.
Definition: trianglefromposandtriangleseedquery.h:25
3d vector using 32bits floating points.
Definition: vec3f.h:16