20 template <
class T>
class WorkingMemArray;
49 static QueryType GetStaticType() {
return TypeTriangleFromPos; }
51 virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
52 virtual void InitFromQueryBlob(
World* world,
void* blob);
53 virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() {
return CreateStaticQueryBlobHandler(); }
54 static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
58 TriangleFromPosQuery();
59 virtual ~TriangleFromPosQuery() {}
87 virtual void Advance(WorkingMemory* workingMemory);
90 void PerformQuery(WorkingMemory* workingMemory =
nullptr);
95 const Vec3f& GetInputPos()
const;
96 const NavTrianglePtr& GetResultTrianglePtr()
const;
98 KyFloat32 GetAltitudeOfProjectionInTriangle()
const;
100 const PositionSpatializationRange& GetPositionSpatializationRange()
const;
103 void SetInputIntegerPos(
const WorldIntegerPos& integerPos);
104 const WorldIntegerPos& GetInputIntegerPos()
const;
105 void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
109 void GetNearestTrianglePtrFromPos(WorkingMemory* workingMemory);
110 KyResult FilterNavFloorsFromAltitudeRange(WorkingMemArray<NavFloor*>& floorIndicesToTest, ActiveCell& activeCell);
111 void ProcessFilteredNavFloors(
const WorkingMemArray<NavFloor*>& filteredMetaFloorIndices,
const Vec3f& pos3fInCell,
KyFloat32 multiplicatorValidyForQueryType);
112 void FindTriangleInFloor(
const Vec3f& posInCell, NavFloor* navFloor,
const NavFloorBlob* floorBlob,
bool& triangleFound,
KyFloat32& minDist,
113 KyFloat32 multiplicatorValidyForQueryType);
116 WorldIntegerPos m_inputIntegerPos;
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: trianglefromposquery.inl:16
virtual QueryType GetType() const
Get query type.
Definition: trianglefromposquery.h:50
Indicates the query has not yet been initialized.
Definition: trianglefromposquery.h:25
TriangleFromPosQueryResult
Enumerates the possible results of a TriangleFromPosQuery.
Definition: trianglefromposquery.h:23
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: trianglefromposquery.cpp:46
Indicates that insufficient working memory caused the query to stop.
Definition: trianglefromposquery.h:29
Vertical range (above, below) that represents the altitude tolerance for a position to be inside the ...
Definition: positionspatializationrange.h:17
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: trianglefromposquery.inl:10
KyFloat32 m_altitudeInTriangle
Updated during processing to indicate the projected altitude of m_inputPos3f on the triangle stored i...
Definition: trianglefromposquery.h:132
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
Vec3f m_inputPos3f
input position
Definition: trianglefromposquery.h:118
PositionSpatializationRange m_positionSpatializationRange
The altitude tolerance around m_inputPos3f that will be searched for triangles.
Definition: trianglefromposquery.h:120
TriangleFromPosQueryType m_queryType
An element from the TriangleFromPosQueryType enumeration that indicates whether to look for triangles...
Definition: trianglefromposquery.h:125
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
NavTrianglePtr m_resultTrianglePtr
Updated during processing to store the nearest triangle found to m_inputPos3f.
Definition: trianglefromposquery.h:129
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
Instructs the query to retrieve the first triangle above the point provided.
Definition: trianglefromposquery.h:39
TriangleFromPosQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: trianglefromposquery.h:134
void SetQueryType(TriangleFromPosQueryType queryType)
Write accessor for m_queryType.
Definition: trianglefromposquery.inl:21
Instructs the query to retrieve the first triangle below the point provided.
Definition: trianglefromposquery.h:38
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:17
Indicates that the query has not yet been launched.
Definition: iquery.h:296
The TriangleFromPosQuery class takes a position in the 3D space (m_inputPos3f), and finds the nearest...
Definition: trianglefromposquery.h:46
Indicates that the point provided is outside the navigable boundaries of the NavMesh.
Definition: trianglefromposquery.h:28
TriangleFromPosQueryType
Enumerates the possible ways a TriangleFromPosQuery can choose the triangle it retrieves.
Definition: trianglefromposquery.h:35
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
void PerformQuery(WorkingMemory *workingMemory=nullptr)
If workingMemory param is nullptr, m_database.GetWorkingMemory() will be used.
Definition: trianglefromposquery.cpp:78
Indicates that the query was completed successfully; a triangle was found.
Definition: trianglefromposquery.h:31
float KyFloat32
float
Definition: types.h:32
Indicates the query has not yet been launched.
Definition: trianglefromposquery.h:26
3d vector using 32bits floating points.
Definition: vec3f.h:16
Instructs the query to retrieve the nearest triangle to the point provided, regardless of whether it ...
Definition: trianglefromposquery.h:37