Kaim::NavHalfEdgeRawPtr Class Reference

Kaim::NavHalfEdgeRawPtr Class Reference

#include <navhalfedgerawptr.h>

Class Description

Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.

This pointer is guaranteed to be valid only in the frame in which it was retrieved. Never store a NavHalfEdgeRawPtr for use in subsequent frames, because it has no protection against database navmesh changes Use NavHalfEdgePtr instead. Actually, this class is used internally for some performance and working memory usage friendliness reason (no ref-counting increment/decrement, no need to call constructor/destructor), but unless you really know what you do prefer NavHalfEdgePtr which is safer.

+ Examples:

Public Member Functions

bool IsValid () const
 Returns m_navFloorRawPtr.IsValid(). NavHalfEdgeRawPtr validity can be changed when the NavMesh in the database changes, ie Add/remove NavData or Dynamic NavMesh. More...
 
void Invalidate ()
 Invalidates this object. More...
 

Public Attributes

NavFloorRawPtr m_navFloorRawPtr
 The NavFloor that contains this edge. More...
 
CompactNavHalfEdgeIdx m_halfEdgeIdx
 The index of this edge within its NavFloor. More...
 
KyUInt16 m_boundaryEdgeIdx
 Use internally to speed up stitching. Do not modify. More...
 

Member Functions for valid instance

NavHalfEdge GetHalfEdge () const
 All these function should be called only if IsValid() returns true. More...
 
NavHalfEdgeType GetHalfEdgeType () const
 
NavFloorGetNavFloor () const
 
const NavFloorBlobGetNavFloorBlob () const
 
const CellPosGetCellPos () const
 
const NavTag & GetNavTag () const
 
Vec3f GetStartVertexPos3f () const
 Does set the z coordinate. More...
 
Vec3f GetEndVertexPos3f () const
 Does set the z coordinate. More...
 
void GetTriangleVerticesPos3f (Vec3f &start, Vec3f &end, Vec3f &next) const
 next is the vertex in the (start->end->next) triangle More...
 
void GetVerticesPos3f (Vec3f &start, Vec3f &end) const
 
Vec3f GetMiddlePos3f () const
 
CoordPos64 GetStartVertexCoordPos64 () const
 
CoordPos64 GetEndVertexCoordPos64 () const
 
KyFloat32 GetStartVertexAltitude () const
 
KyFloat32 GetEndVertexAltitude () const
 
CoordPos GetStartVertexCoordPosInCell () const
 Returns the start 2D integer coordinates (in pixels) relative to its NavCell origin. More...
 
CoordPos GetEndVertexCoordPosInCell () const
 Returns the end 2D integer coordinates (in pixels) relative to its NavCell origin. More...
 
template<class TLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData) const
 Returns true if this edge can be traversed according the TraverseLogic. More...
 
bool IsHalfEdgeCrossable () const
 Returns true if this edge is not on an external boundary of the NavMesh and not a internal edge that is not correctly stitched. More...
 
template<class TLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData, NavHalfEdgeRawPtr &pair) const
 Returns true if this edge can be traversed using {TLogic, traverseLogicUserData}, and updates pair if it can. More...
 
bool IsHalfEdgeCrossable (NavHalfEdgeRawPtr &resultRawPtr) const
 Returns true if this edge can be traversed using DefaultTraverseLogic, and updates pairHalfEdgeRawPtr if it can. More...
 
template<class TLogic >
bool IsStartVertexOnBorder (void *traverseLogicUserData) const
 Returns true if one of the edges starting from start cannot be traversed using {TLogic, traverseLogicUserData}. More...
 
bool IsStartVertexOnBorder () const
 Returns true if one of the edges starting from start cannot be traversed using DefaultTraverseLogic. More...
 
void GetPairHalfEdgeRawPtr (NavHalfEdgeRawPtr &pair) const
 Updates pair to identify the edge in the adjacent triangle that borders this edge. More...
 
void GetNextHalfEdgeRawPtr (NavHalfEdgeRawPtr &next) const
 Updates next to identify the next edge in the triangle. More...
 
void GetPrevHalfEdgeRawPtr (NavHalfEdgeRawPtr &prev) const
 Updates prev to identify the previous edge in the triangle. More...
 
template<class TLogic >
NavHalfEdgeRawPtr GetNextNavHalfEdgeRawPtrAlongBorder (void *traverseLogicUserData) const
 Returns the next edge along the border of the NavMesh using {TLogic, traverseLogicUserData}. More...
 
template<class TLogic >
NavHalfEdgeRawPtr GetPrevNavHalfEdgeRawPtrAlongBorder (void *traverseLogicUserData) const
 Returns the previous edge along the border of the NavMesh using {TLogic, traverseLogicUserData}. More...
 
bool IsMinimumAmongPairs () const
 returns !IsHalfEdgeCrossable() || GetStartVertexCoordPosInCell() < GetEndVertexCoordPosInCell() This is useful when browsing all HalfEdges and considering the couple (A,B) once even if both HalfEdges A->B and B->A exist More...
 

For internal use only

NavHalfEdgeRawPtrGetCorrespondingLink ()
 
template<class TLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr) const
 
template<class TLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr) const
 
template<class TLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, KyFloat32 *costMultiplier) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, const Vec3f *position) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, NavHalfEdgeRawPtr &resultRawPtr, const Vec3f *position) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, const Vec3f *position) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, const Vec3f *position, KyFloat32 *costMultiplier) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, KyFloat32 *costMultiplier) const
 
template<class TLogic >
bool IsPairedEdgeCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *, const LogicWithNoCustomCost &) const
 
template<class TLogic >
bool IsPairedEdgeCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *costMultiplier, const LogicWithCostPerNavTag &) const
 
template<class TLogic >
bool IsPairedEdgeCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *costMultiplier, const LogicWithCostPerTriangle &) const
 
template<class TLogic >
bool IsConnexBoundaryCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *, const LogicWithNoCustomCost &) const
 
template<class TLogic >
bool IsConnexBoundaryCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *costMultiplier, const LogicWithCostPerNavTag &) const
 
template<class TLogic >
bool IsConnexBoundaryCrossable (void *traverseLogicUserData, const NavFloorBlob *navFloorBlob, NavTriangleIdx pairTriangleIdx, KyFloat32 *costMultiplier, const LogicWithCostPerTriangle &) const
 
template<class TLogic >
bool IsFloorOrCellLinkCrossable (void *traverseLogicUserData, const NavHalfEdgeRawPtr &link, KyFloat32 *costMultiplier, const LogicWithNoCustomCost &) const
 
template<class TLogic >
bool IsFloorOrCellLinkCrossable (void *traverseLogicUserData, const NavHalfEdgeRawPtr &link, KyFloat32 *costMultiplier, const LogicWithCostPerNavTag &) const
 
template<class TLogic >
bool IsFloorOrCellLinkCrossable (void *traverseLogicUserData, const NavHalfEdgeRawPtr &link, KyFloat32 *costMultiplier, const LogicWithCostPerTriangle &) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, const Vec3f *position, KyFloat32 *costMultiplier, const LogicDoNotUseCanEnterNavTag &) const
 
template<class TLogic >
bool IsHalfEdgeOneWayCrossable (void *traverseLogicUserData, NavHalfEdge navHalfEdge, const NavFloorBlob *navFloorBlob, NavHalfEdgeRawPtr &resultRawPtr, const Vec3f *position, KyFloat32 *costMultiplier, const LogicDoUseCanEnterNavTag &) const
 
void GetVerticesPos3f (KyFloat32 integerPrecision, const CoordPos64 &cellOrigin, const NavFloorBlob *navFloorBlob, Vec3f &v0Pos3f, Vec3f &v1Pos3f) const
 

Member Function Documentation

CoordPos Kaim::NavHalfEdgeRawPtr::GetEndVertexCoordPosInCell ( ) const
inline

Returns the end 2D integer coordinates (in pixels) relative to its NavCell origin.

Vec3f Kaim::NavHalfEdgeRawPtr::GetEndVertexPos3f ( ) const

Does set the z coordinate.

NavHalfEdge Kaim::NavHalfEdgeRawPtr::GetHalfEdge ( ) const
inline

All these function should be called only if IsValid() returns true.

void Kaim::NavHalfEdgeRawPtr::GetNextHalfEdgeRawPtr ( NavHalfEdgeRawPtr next) const
inline

Updates next to identify the next edge in the triangle.

template<class TLogic >
NavHalfEdgeRawPtr Kaim::NavHalfEdgeRawPtr::GetNextNavHalfEdgeRawPtrAlongBorder ( void *  traverseLogicUserData) const
inline

Returns the next edge along the border of the NavMesh using {TLogic, traverseLogicUserData}.

Precondition
The edge must be on the border, ie IsHalfEdgeCrossable<TLogic>(traverseLogicUserData) == false.
void Kaim::NavHalfEdgeRawPtr::GetPairHalfEdgeRawPtr ( NavHalfEdgeRawPtr pair) const

Updates pair to identify the edge in the adjacent triangle that borders this edge.

void Kaim::NavHalfEdgeRawPtr::GetPrevHalfEdgeRawPtr ( NavHalfEdgeRawPtr prev) const
inline

Updates prev to identify the previous edge in the triangle.

template<class TLogic >
NavHalfEdgeRawPtr Kaim::NavHalfEdgeRawPtr::GetPrevNavHalfEdgeRawPtrAlongBorder ( void *  traverseLogicUserData) const
inline

Returns the previous edge along the border of the NavMesh using {TLogic, traverseLogicUserData}.

Precondition
The edge must be on the border, ie IsHalfEdgeCrossable<TLogic>(traverseLogicUserData) == false.
CoordPos Kaim::NavHalfEdgeRawPtr::GetStartVertexCoordPosInCell ( ) const
inline

Returns the start 2D integer coordinates (in pixels) relative to its NavCell origin.

Vec3f Kaim::NavHalfEdgeRawPtr::GetStartVertexPos3f ( ) const

Does set the z coordinate.

void Kaim::NavHalfEdgeRawPtr::GetTriangleVerticesPos3f ( Vec3f start,
Vec3f end,
Vec3f next 
) const

next is the vertex in the (start->end->next) triangle

void Kaim::NavHalfEdgeRawPtr::Invalidate ( )
inline

Invalidates this object.

template<class TLogic >
bool Kaim::NavHalfEdgeRawPtr::IsHalfEdgeCrossable ( void *  traverseLogicUserData) const
inline

Returns true if this edge can be traversed according the TraverseLogic.

+ Examples:
bool Kaim::NavHalfEdgeRawPtr::IsHalfEdgeCrossable ( ) const
inline

Returns true if this edge is not on an external boundary of the NavMesh and not a internal edge that is not correctly stitched.

template<class TLogic >
bool Kaim::NavHalfEdgeRawPtr::IsHalfEdgeCrossable ( void *  traverseLogicUserData,
NavHalfEdgeRawPtr pair 
) const
inline

Returns true if this edge can be traversed using {TLogic, traverseLogicUserData}, and updates pair if it can.

bool Kaim::NavHalfEdgeRawPtr::IsHalfEdgeCrossable ( NavHalfEdgeRawPtr resultRawPtr) const
inline

Returns true if this edge can be traversed using DefaultTraverseLogic, and updates pairHalfEdgeRawPtr if it can.

bool Kaim::NavHalfEdgeRawPtr::IsMinimumAmongPairs ( ) const
inline

returns !IsHalfEdgeCrossable() || GetStartVertexCoordPosInCell() < GetEndVertexCoordPosInCell() This is useful when browsing all HalfEdges and considering the couple (A,B) once even if both HalfEdges A->B and B->A exist

template<class TLogic >
bool Kaim::NavHalfEdgeRawPtr::IsStartVertexOnBorder ( void *  traverseLogicUserData) const
inline

Returns true if one of the edges starting from start cannot be traversed using {TLogic, traverseLogicUserData}.

bool Kaim::NavHalfEdgeRawPtr::IsStartVertexOnBorder ( ) const
inline

Returns true if one of the edges starting from start cannot be traversed using DefaultTraverseLogic.

bool Kaim::NavHalfEdgeRawPtr::IsValid ( ) const
inline

Returns m_navFloorRawPtr.IsValid(). NavHalfEdgeRawPtr validity can be changed when the NavMesh in the database changes, ie Add/remove NavData or Dynamic NavMesh.

Member Data Documentation

KyUInt16 Kaim::NavHalfEdgeRawPtr::m_boundaryEdgeIdx

Use internally to speed up stitching. Do not modify.

CompactNavHalfEdgeIdx Kaim::NavHalfEdgeRawPtr::m_halfEdgeIdx

The index of this edge within its NavFloor.

NavFloorRawPtr Kaim::NavHalfEdgeRawPtr::m_navFloorRawPtr

The NavFloor that contains this edge.


The documentation for this class was generated from the following files: