Kaim::NavHalfEdgePtr Class Reference

Kaim::NavHalfEdgePtr Class Reference

#include <navhalfedgeptr.h>

Class Description

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

Instances of this class can be safely stored and used in subsequent frames.

Public Member Functions

 NavHalfEdgePtr ()
 
 NavHalfEdgePtr (const NavFloorPtr &navFloorPtr, NavHalfEdgeIdx halfEdgeIdx)
 
 NavHalfEdgePtr (const NavHalfEdgeRawPtr &navHalfEdgeRawPtr)
 
NavHalfEdgeIdx GetHalfEdgeIdx () const
 
NavFloorGetNavFloor () const
 
const NavFloorBlobGetNavFloorBlob () const
 
void Invalidate ()
 
bool IsValid () const
 
bool operator!= (const NavHalfEdgePtr &rhs) const
 
bool operator== (const NavHalfEdgePtr &rhs) const
 
void Set (const NavFloorPtr &navFloorPtr, NavHalfEdgeIdx halfEdgeIdx)
 

Public Attributes

CompactNavHalfEdgeIdx m_halfEdgeIdx
 
NavFloorPtr m_navFloorPtr
 

Member Functions for valid instance

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

Precondition
This object must be valid. Its validity is not checked.
NavFloorGetNavFloor_Unsafe () const
 
const NavFloorBlobGetNavFloorBlob_Unsafe () const
 
NavHalfEdgeRawPtr GetRawPtr () const
 
const CellPosGetCellPos () const
 
const NavTag & GetNavTag () const
 
void GetTriangleVerticesPos3f (Vec3f &v0Pos3f, Vec3f &v1Pos3f, Vec3f &v2Pos3f) const
 
void GetVerticesPos3f (Vec3f &v0Pos3f, Vec3f &v1Pos3f) const
 
Vec3f GetStartVertexPos3f () const
 
Vec3f GetEndVertexPos3f () const
 
CoordPos64 GetStartVertexCoordPos64 () const
 
CoordPos64 GetEndVertexCoordPos64 () const
 
KyFloat32 GetStartVertexAltitude () const
 
KyFloat32 GetEndVertexAltitude () const
 
CoordPos GetStartVertexCoordPosInCell () const
 
CoordPos GetEndVertexCoordPosInCell () const
 
template<class TraverseLogic >
bool IsHalfEdgeCrossable (void *traverseLogicUserData) const
 
bool IsHalfEdgeCrossable () const
 
template<class TraverseLogic >
bool IsHalfEdgeCrossable (NavHalfEdgePtr &resultPtr, void *traverseLogicUserData) const
 
bool IsHalfEdgeCrossable (NavHalfEdgePtr &resultPtr) const
 
void GetPairHalfEdgePtr (NavHalfEdgePtr &resultPtr) const
 
void GetNextHalfEdgePtr (NavHalfEdgePtr &resultPtr) const
 
void GetPrevHalfEdgePtr (NavHalfEdgePtr &resultPtr) const
 
template<class TraverseLogic >
NavHalfEdgePtr GetNextNavHalfEdgePtrAlongBorder (void *traverseLogicUserData) const
 
template<class TraverseLogic >
NavHalfEdgePtr GetPrevNavHalfEdgePtrAlongBorder (void *traverseLogicUserData) const
 

Constructor & Destructor Documentation

Kaim::NavHalfEdgePtr::NavHalfEdgePtr ( )
inline

Creates an invalid NavHalfEdgePtr.

Kaim::NavHalfEdgePtr::NavHalfEdgePtr ( const NavFloorPtr navFloorPtr,
NavHalfEdgeIdx  halfEdgeIdx 
)
inline

Creates a new NavHalfEdgePtr referring to the provided NavHalfEdgeIdx in the provided NavFloorPtr.

Parameters
navFloorPtrThe NavFloor that contains the edge this object should refer to.
halfEdgeIdxThe index of this edge within the NavFloor.
Kaim::NavHalfEdgePtr::NavHalfEdgePtr ( const NavHalfEdgeRawPtr navHalfEdgeRawPtr)
inlineexplicit

Creates a new NavHalfEdgePtr copying information from the provided one.

Member Function Documentation

const CellPos & Kaim::NavHalfEdgePtr::GetCellPos ( ) const
inline

Returns a const reference to the CellPos that indicates the position of the cell that contains this edge within the grid of NavData cells.

Precondition
This object must be valid. Its validity is not checked.
KyFloat32 Kaim::NavHalfEdgePtr::GetEndVertexAltitude ( ) const
inline

Returns the altitude (z coordinate) of the ending vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked
CoordPos64 Kaim::NavHalfEdgePtr::GetEndVertexCoordPos64 ( ) const
inline

Returns the x,y integer coordinates of the ending vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked.
CoordPos Kaim::NavHalfEdgePtr::GetEndVertexCoordPosInCell ( ) const
inline

Returns the 2D integer coordinates of the ending vertex of this edge in its NavCell.

Precondition
This object must be valid. Its validity is not checked.
Vec3f Kaim::NavHalfEdgePtr::GetEndVertexPos3f ( ) const
inline

Returns the coordinates of the ending vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked.
NavHalfEdgeIdx Kaim::NavHalfEdgePtr::GetHalfEdgeIdx ( ) const
inline

Returns the index of this edge within its NavFloor.

NavFloor * Kaim::NavHalfEdgePtr::GetNavFloor ( ) const
inline

Returns a pointer to the NavFloor that contains this edge. Returns KY_NULL if this object is not valid.

NavFloor * Kaim::NavHalfEdgePtr::GetNavFloor_Unsafe ( ) const
inline

Returns a pointer to the NavFloor that contains this edge.

Precondition
This object must be valid. Its validity is not checked.
const NavFloorBlob * Kaim::NavHalfEdgePtr::GetNavFloorBlob ( ) const
inline

Returns a const pointer to the NavFloorBlob that contains this edge. Returns KY_NULL if this object is not valid.

const NavFloorBlob * Kaim::NavHalfEdgePtr::GetNavFloorBlob_Unsafe ( ) const
inline

Returns a const pointer to the NavFloorBlob that contains this edge.

Precondition
This object must be valid. Its validity is not checked.
const NavTag & Kaim::NavHalfEdgePtr::GetNavTag ( ) const
inline

Retrieves the NavTag associated to the NavFloor that contains this halfEdge.

Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavHalfEdgePtr::GetNextHalfEdgePtr ( NavHalfEdgePtr resultPtr) const
inline

Updates resultPtr to identify the next edge in the triangle.

Precondition
This object must be valid. Its validity is not checked.
template<class TraverseLogic >
NavHalfEdgePtr Kaim::NavHalfEdgePtr::GetNextNavHalfEdgePtrAlongBorder ( void *  traverseLogicUserData) const
inline

Returns the next edge along the border of the NavMesh according to TraverseLogic.

Parameters
traverseLogicUserDataA pointer to a traverseLogicUserData
Precondition
This object must be valid. Its validity is not checked.
This object must be on the border of an area of the NavMesh according to TraverseLogic. It may not be paired with another triangle with a traversable NavTag. That means we must have IsHalfEdgeCrossable<TraverseLogic>() == false.
Postcondition
The returned edge is not paired with another triangle with a traversable NavTag.
void Kaim::NavHalfEdgePtr::GetPairHalfEdgePtr ( NavHalfEdgePtr resultPtr) const
inline

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

Precondition
This object must be valid. Its validity is not checked.
The type of the edge returned by a call to NavHalfEdge::GetHalfEdgeType() must not be EDGETYPE_OBSTACLE.
void Kaim::NavHalfEdgePtr::GetPrevHalfEdgePtr ( NavHalfEdgePtr resultPtr) const
inline

Updates resultPtr to identify the previous edge in the triangle.

Precondition
This object must be valid. Its validity is not checked.
template<class TraverseLogic >
NavHalfEdgePtr Kaim::NavHalfEdgePtr::GetPrevNavHalfEdgePtrAlongBorder ( void *  traverseLogicUserData) const
inline

Returns the previous edge along the border of the NavMesh according to TraverseLogic.

Parameters
traverseLogicUserDataA pointer to a traverseLogicUserData
Precondition
This object must be valid. Its validity is not checked.
This object must be on the border of an area of the NavMesh according to TraverseLogic. It may not be paired with another triangle with a traversable NavTag. That means we must have IsHalfEdgeCrossable<TraverseLogic>() == false.
Postcondition
The returned edge is not paired with another triangle with a traversable NavTag.
NavHalfEdgeRawPtr Kaim::NavHalfEdgePtr::GetRawPtr ( ) const
inline

Constructs and returns a NavHalfEdgeRawPtr that refers to the same NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked.
KyFloat32 Kaim::NavHalfEdgePtr::GetStartVertexAltitude ( ) const
inline

Returns the altitude (z coordinate) of the starting vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked
CoordPos64 Kaim::NavHalfEdgePtr::GetStartVertexCoordPos64 ( ) const
inline

Returns the x,y integer coordinates of the starting vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked.
CoordPos Kaim::NavHalfEdgePtr::GetStartVertexCoordPosInCell ( ) const
inline

Returns the 2D integer coordinates of the starting vertex of this edge in its NavCell.

Precondition
This object must be valid. Its validity is not checked.
Vec3f Kaim::NavHalfEdgePtr::GetStartVertexPos3f ( ) const
inline

Returns the coordinates of the starting vertex of this NavHalfEdge.

Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavHalfEdgePtr::GetTriangleVerticesPos3f ( Vec3f v0Pos3f,
Vec3f v1Pos3f,
Vec3f v2Pos3f 
) const
inline

Updates the parameters to identify the vertices in the specified triangle.

Parameters
[out]v0Pos3fThe 3D position of the start vertex of the edge.
[out]v1Pos3fThe 3D position of the end vertex in the edge.
[out]v2Pos3fThe 3D position of the third vertex in the triangle.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavHalfEdgePtr::GetVerticesPos3f ( Vec3f v0Pos3f,
Vec3f v1Pos3f 
) const
inline

Updates the parameters to identify the start and end vertices of the specified edge.

Parameters
[out]v0Pos3fThe 3D position of the start vertex of the edge.
[out]v1Pos3fThe 3D position of the end vertex in the edge.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavHalfEdgePtr::Invalidate ( )
inline

Invalidates this object.

template<class TraverseLogic >
bool Kaim::NavHalfEdgePtr::IsHalfEdgeCrossable ( void *  traverseLogicUserData) const
inline

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

Parameters
traverseLogicUserDataA pointer to a traverseLogicUserData
Precondition
This object must be valid. Its validity is not checked.
bool Kaim::NavHalfEdgePtr::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.

Precondition
This object must be valid. Its validity is not checked.
template<class TraverseLogic >
bool Kaim::NavHalfEdgePtr::IsHalfEdgeCrossable ( NavHalfEdgePtr resultPtr,
void *  traverseLogicUserData 
) const
inline

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

Parameters
[out]resultPtrThe edge in the next adjacent triangle that borders this edge.
traverseLogicUserDataA pointer to a traverseLogicUserData
Precondition
This object must be valid. Its validity is not checked.
bool Kaim::NavHalfEdgePtr::IsHalfEdgeCrossable ( NavHalfEdgePtr resultPtr) 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, and updates resultPtr.

Parameters
[out]resultPtrThe edge in the next adjacent triangle that borders this edge.
Precondition
This object must be valid. Its validity is not checked.
bool Kaim::NavHalfEdgePtr::IsValid ( ) const
inline

Returns true if this object refers to a valid edge: i.e. an edge in a valid NavFloor. see NavFloorPtr::IsValid()

bool Kaim::NavHalfEdgePtr::operator!= ( const NavHalfEdgePtr rhs) const
inline

Returns true if this object identifies a different edge from rhs.

bool Kaim::NavHalfEdgePtr::operator== ( const NavHalfEdgePtr rhs) const
inline

Returns true if this object identifies the same edge as rhs, or if both are invalid.

void Kaim::NavHalfEdgePtr::Set ( const NavFloorPtr navFloorPtr,
NavHalfEdgeIdx  halfEdgeIdx 
)
inline

Clears all information maintained by this object.

Parameters
navFloorPtrThe NavFloor that contains the edge this object should refer to.
halfEdgeIdxThe index of this edge within the NavFloor.

Member Data Documentation

CompactNavHalfEdgeIdx Kaim::NavHalfEdgePtr::m_halfEdgeIdx

The index of this edge within its NavFloor.

NavFloorPtr Kaim::NavHalfEdgePtr::m_navFloorPtr

The NavFloor that contains this edge.


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