Kaim::NavTriangleRawPtr Class Reference

Kaim::NavTriangleRawPtr Class Reference

#include <navtrianglerawptr.h>

Class Description

Identifies a single NavTriangle in a NavFloor.

This pointer is guaranteed to be valid only in the frame in which it was retrieved because its memory may be overwritten because of dynamic/ navmesh. Use NavTrianglePtr instead. 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 NavTrianglePtr which is safer.

+ Examples:

Public Attributes

NavFloorRawPtr m_navFloorRawPtr
 The NavFloor that contains this triangle. More...
 
CompactNavTriangleIdx m_triangleIdx
 The index of this triangle within its NavFloor. More...
 

Functions

 NavTriangleRawPtr ()
 Creates an invalid NavTriangleRawPtr. More...
 
 NavTriangleRawPtr (const NavFloorRawPtr &navFloorRawPtr, NavTriangleIdx triangleIdx)
 Init from NavFloorRawPtr. More...
 
 NavTriangleRawPtr (NavFloor *navFloor, NavTriangleIdx triangleIdx)
 Init from NavFloorRawPtr. More...
 
void Set (const NavFloorRawPtr &navFloorRawPtr, NavTriangleIdx triangleIdx)
 Init from NavFloorRawPtr. More...
 
void Set (NavFloor *navFloor, NavTriangleIdx triangleIdx)
 Init from a NavFloor*. More...
 
bool IsValid () const
 Returns true if this object refers to a valid triangle. More...
 
void Invalidate ()
 
bool operator== (const NavTriangleRawPtr &rhs) const
 
bool operator!= (const NavTriangleRawPtr &rhs) const
 
NavTriangleIdx GetTriangleIdx () const
 Returns the index of the triangle within its NavFloor. More...
 

Functions that do NOT check IsValid()

NavFloorGetNavFloor () const
 Returns the triangle NavFloor. More...
 
const NavFloorBlobGetNavFloorBlob () const
 Returns a reference to the NavFloorBlob that contains this triangle. More...
 
const CellPosGetCellPos () const
 Returns the triangle NavCell 2d position. More...
 
const NavTag & GetNavTag () const
 Retrieves the triangle NavTag. More...
 
void GetVerticesPos3f (Vec3f &A, Vec3f &B, Vec3f &C) const
 Get the triangle Navigation world coordinates. More...
 
void GetVerticesPos3f (Triangle3f &triangle3f) const
 Get the triangle world floating point 3d coordinates. More...
 
void GetVerticesCoordPos64 (CoordPos64 &A, CoordPos64 &B, CoordPos64 &C) const
 Get the triangle world integer 2d coordinates. More...
 
void GetVerticesCoordPos (CoordPos &A, CoordPos &B, CoordPos &C) const
 Get the triangle local to cell integer 2d coordinates. More...
 
KyFloat32 GetAltitudeOfPointInTriangle (const Vec3f &pos) const
 Returns the altitude of the vertical projection of pos on the triangle plane. More...
 
template<class TLogic >
bool CanBeTraversed (void *traverseLogicUserData, KyFloat32 *costMultiplier=nullptr) const
 

Constructor & Destructor Documentation

Kaim::NavTriangleRawPtr::NavTriangleRawPtr ( )
inline

Creates an invalid NavTriangleRawPtr.

Kaim::NavTriangleRawPtr::NavTriangleRawPtr ( const NavFloorRawPtr navFloorRawPtr,
NavTriangleIdx  triangleIdx 
)
inline

Init from NavFloorRawPtr.

Kaim::NavTriangleRawPtr::NavTriangleRawPtr ( NavFloor navFloor,
NavTriangleIdx  triangleIdx 
)
inline

Init from NavFloorRawPtr.

Member Function Documentation

KyFloat32 Kaim::NavTriangleRawPtr::GetAltitudeOfPointInTriangle ( const Vec3f pos) const

Returns the altitude of the vertical projection of pos on the triangle plane.

Precondition
IsValid() == true.
const CellPos& Kaim::NavTriangleRawPtr::GetCellPos ( ) const
inline

Returns the triangle NavCell 2d position.

Precondition
IsValid() == true.
+ Examples:
NavFloor* Kaim::NavTriangleRawPtr::GetNavFloor ( ) const
inline

Returns the triangle NavFloor.

Precondition
IsValid() == true.
const NavFloorBlob* Kaim::NavTriangleRawPtr::GetNavFloorBlob ( ) const
inline

Returns a reference to the NavFloorBlob that contains this triangle.

Precondition
IsValid() == true.
+ Examples:
const NavTag& Kaim::NavTriangleRawPtr::GetNavTag ( ) const
inline

Retrieves the triangle NavTag.

Precondition
IsValid() == true.
NavTriangleIdx Kaim::NavTriangleRawPtr::GetTriangleIdx ( ) const
inline

Returns the index of the triangle within its NavFloor.

+ Examples:
void Kaim::NavTriangleRawPtr::GetVerticesCoordPos ( CoordPos A,
CoordPos B,
CoordPos C 
) const

Get the triangle local to cell integer 2d coordinates.

Precondition
IsValid() == true.
void Kaim::NavTriangleRawPtr::GetVerticesCoordPos64 ( CoordPos64 A,
CoordPos64 B,
CoordPos64 C 
) const

Get the triangle world integer 2d coordinates.

Precondition
IsValid() == true.
void Kaim::NavTriangleRawPtr::GetVerticesPos3f ( Vec3f A,
Vec3f B,
Vec3f C 
) const

Get the triangle Navigation world coordinates.

Precondition
IsValid() == true.
+ Examples:
void Kaim::NavTriangleRawPtr::GetVerticesPos3f ( Triangle3f triangle3f) const
inline

Get the triangle world floating point 3d coordinates.

Precondition
IsValid() == true.
bool Kaim::NavTriangleRawPtr::IsValid ( ) const
inline

Returns true if this object refers to a valid triangle.

void Kaim::NavTriangleRawPtr::Set ( const NavFloorRawPtr navFloorRawPtr,
NavTriangleIdx  triangleIdx 
)
inline

Init from NavFloorRawPtr.

void Kaim::NavTriangleRawPtr::Set ( NavFloor navFloor,
NavTriangleIdx  triangleIdx 
)
inline

Init from a NavFloor*.

Member Data Documentation

NavFloorRawPtr Kaim::NavTriangleRawPtr::m_navFloorRawPtr

The NavFloor that contains this triangle.

+ Examples:
CompactNavTriangleIdx Kaim::NavTriangleRawPtr::m_triangleIdx

The index of this triangle within its NavFloor.


The documentation for this class was generated from the following files:
  • gwnavruntime/navmesh/identifiers/navtrianglerawptr.h
  • gwnavruntime/navmesh/identifiers/navtrianglerawptr.cpp