8 #ifndef Navigation_NearestObstacleHalfEdgeFromPosQueryBlob_H
9 #define Navigation_NearestObstacleHalfEdgeFromPosQueryBlob_H
20 class NearestBorderHalfEdgeFromPosQueryOutputBlob
24 NearestBorderHalfEdgeFromPosQueryOutputBlob() : m_result(0) {}
29 NavHalfEdgeBlob m_nearestHalfEdgeOnBorder;
30 NavHalfEdgeBlob m_nextHalfEdgeOnBorder;
31 NavHalfEdgeBlob m_prevHalfEdgeOnBorder;
32 Vec3f m_nearestPosOnHalfEdge;
35 inline void SwapEndianness(
Endianness::Target e, NearestBorderHalfEdgeFromPosQueryOutputBlob&
self)
37 SwapEndianness(e,
self.m_result);
38 SwapEndianness(e,
self.m_nearestHalfEdgeOnBorder);
39 SwapEndianness(e,
self.m_nextHalfEdgeOnBorder );
40 SwapEndianness(e,
self.m_prevHalfEdgeOnBorder );
41 SwapEndianness(e,
self.m_nearestPosOnHalfEdge );
42 SwapEndianness(e,
self.m_squareDistFromHalfEdge );
46 class NearestBorderHalfEdgeFromPosQueryOutputBlobBuilder :
public BaseBlobBuilder<NearestBorderHalfEdgeFromPosQueryOutputBlob>
49 NearestBorderHalfEdgeFromPosQueryOutputBlobBuilder(BaseNearestBorderHalfEdgeFromPosQuery* query) { m_query = query; }
50 virtual void DoBuild()
53 BLOB_BUILD(
m_blob->m_nearestHalfEdgeOnBorder, NavHalfEdgeBlobBuilder(m_query->GetNearestHalfEdgePtrOnBorder()));
54 BLOB_BUILD(
m_blob->m_nextHalfEdgeOnBorder , NavHalfEdgeBlobBuilder(m_query->GetNextHalfEdgePtrAlongBorder()));
55 BLOB_BUILD(
m_blob->m_prevHalfEdgeOnBorder , NavHalfEdgeBlobBuilder(m_query->GetPrevHalfEdgePtrAlongBorder()));
56 BLOB_SET(
m_blob->m_nearestPosOnHalfEdge, m_query->GetNearestPosOnHalfEdge());
57 BLOB_SET(
m_blob->m_squareDistFromHalfEdge, m_query->GetSquareDistFromNearestBorder());
61 BaseNearestBorderHalfEdgeFromPosQuery* m_query;
65 class NearestBorderHalfEdgeFromPosQueryBlob
68 KY_ROOT_BLOB_CLASS(Query, NearestBorderHalfEdgeFromPosQueryBlob, 0)
70 NearestBorderHalfEdgeFromPosQueryBlob() : m_queryInfoId(
KyUInt32MAXVAL), m_databaseIdx(KyUInt32MAXVAL) {}
78 PositionSpatializationRange m_positionSpatializationRange;
80 BlobRef<NearestBorderHalfEdgeFromPosQueryOutputBlob> m_queryOutput;
82 inline void SwapEndianness(
Endianness::Target e, NearestBorderHalfEdgeFromPosQueryBlob&
self)
84 SwapEndianness(e,
self.m_queryInfoId);
85 SwapEndianness(e,
self.m_databaseIdx);
86 SwapEndianness(e,
self.m_inputPos3f);
87 SwapEndianness(e,
self.m_horizontalTolerance);
88 SwapEndianness(e,
self.m_positionSpatializationRange);
90 SwapEndianness(e,
self.m_queryOutput);
93 class NearestBorderHalfEdgeFromPosQueryBlobBuilder :
public BaseBlobBuilder<NearestBorderHalfEdgeFromPosQueryBlob>
96 NearestBorderHalfEdgeFromPosQueryBlobBuilder(BaseNearestBorderHalfEdgeFromPosQuery* query) { m_query = query; }
97 virtual void DoBuild()
101 if (m_query->m_database !=
KY_NULL)
103 BLOB_SET(
m_blob->m_databaseIdx , m_query->m_database->GetDatabaseIndex());
105 BLOB_SET(
m_blob->m_horizontalTolerance , m_query->GetHorizontalTolerance());
106 BLOB_SET(
m_blob->m_positionSpatializationRange, m_query->GetPositionSpatializationRange());
108 switch (m_query->GetResult())
121 BaseNearestBorderHalfEdgeFromPosQuery* m_query;
125 #endif // Kaim_NearestObstacleHalfEdgeFromPosQueryInputBlob_H
#define BLOB_SET(blob, value)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:136
#define BLOB_BUILD(blob, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:189
#define KY_NULL
Null value.
Definition: types.h:247
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
NearestBorderHalfEdgeFromPosQueryOutputBlob * m_blob
The blob maintained by this builder. Only modify using the macros listed under DoBuild().
Definition: baseblobbuilder.h:117
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
NearestBorderHalfEdgeFromPosQueryResult
Enumerates the possible results of a NearestBorderHalfEdgeFromPosQuery.
Definition: basenearestborderhalfedgefromposquery.h:29
Indicates the query has not yet been initialized.
Definition: basenearestborderhalfedgefromposquery.h:31
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates the query has not yet been launched.
Definition: basenearestborderhalfedgefromposquery.h:32
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
#define BUILD_REFERENCED_BLOB(blobRef, builder)
Use this macro only in implementations of BaseBlobBuilder::DoBuild().
Definition: baseblobbuilder.h:197