Kaim::NavTrianglePtr Class Reference

Kaim::NavTrianglePtr Class Reference
+ Related help topics:

#include <navtriangleptr.h>

Class Description

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

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

Public Member Functions

 NavTrianglePtr ()
 Creates an invalid NavTrianglePtr. More...
 
 NavTrianglePtr (const NavFloorPtr &navFloorPtr, NavTriangleIdx triangleIdx)
 Creates a new NavTrianglePtr referring to the provided NavTriangleIdx in the provided NavFloorPtr. More...
 
 NavTrianglePtr (const NavTriangleRawPtr &navTriangleRawPtr)
 Creates a new NavTrianglePtr copying information from the provided one. More...
 
void Set (const NavFloorPtr &navFloorPtr, NavTriangleIdx triangleIdx)
 Clears all information maintained by this object. More...
 
bool IsValid () const
 Returns true if this object refers to a valid triangle: i.e. a triangle in a validNavFloor. see NavFloorPtr::IsValid(). More...
 
void Invalidate ()
 Invalidates this object. More...
 
bool operator== (const NavTrianglePtr &rhs) const
 Returns true if this object identifies the same triangle as rhs, or if both are invalid. More...
 
bool operator!= (const NavTrianglePtr &rhs) const
 Returns true if this object identifies a different triangle from rhs. More...
 
NavTriangleIdx GetTriangleIdx () const
 Returns the index of this triangle within its NavFloor. More...
 
NavFloorGetNavFloor () const
 Returns a pointer to the NavFloor that contains this triangle. Returns nullptr if this object is not valid. More...
 
const NavFloorBlobGetNavFloorBlob () const
 Returns a const pointer to the NavFloorBlob that contains this triangle. Returns nullptr if this object is not valid. More...
 

Public Attributes

NavFloorPtr m_navFloorPtr
 The NavFloor that contains this triangle. More...
 
CompactNavTriangleIdx m_triangleIdx
 The index of this triangle within its NavFloor. More...
 

Member Functions for valid instance

NavFloorGetNavFloor_Unsafe () const
 All these function should be called only if IsValid() returns true. More...
 
const NavFloorBlobGetNavFloorBlob_Unsafe () const
 Returns a const pointer to the NavFloorBlob that contains this triangle. More...
 
NavTriangleRawPtr GetRawPtr () const
 Constructs and returns a NavTriangleRawPtr that refers to the same NavTriangle. More...
 
const NavTag & GetNavTag () const
 
const CellPosGetCellPos () const
 Returns a const reference to the CellPos that indicates the position of the cell that contains this triangle. More...
 
void GetVerticesPos3f (Vec3f &v0Pos3f, Vec3f &v1Pos3f, Vec3f &v2Pos3f) const
 Updates the parameters to identify the vertices in this triangle. More...
 
void GetVerticesPos3f (Triangle3f &triangle3f) const
 Updates the parameters to identify the vertices in this triangle. More...
 
void GetVerticesCoordPos64 (CoordPos64 &v0CoordPos64, CoordPos64 &v1CoordPos64, CoordPos64 &v2CoordPos64) const
 Updates the parameters to identify the vertices in this triangle. More...
 
void GetVerticesCoordPos (CoordPos &v0CoordPos, CoordPos &v1CoordPos, CoordPos &v2CoordPos) const
 Updates the parameters to identify the vertices in this triangle. More...
 
KyFloat32 GetAltitudeOfPointInTriangle (const Vec3f &pos) const
 Returns the altitude of the point on the plane defined by this triangle that has the same (X,Y) coordinates as the specified position. More...
 

Constructor & Destructor Documentation

Kaim::NavTrianglePtr::NavTrianglePtr ( )
inline

Creates an invalid NavTrianglePtr.

Kaim::NavTrianglePtr::NavTrianglePtr ( const NavFloorPtr navFloorPtr,
NavTriangleIdx  triangleIdx 
)
inline

Creates a new NavTrianglePtr referring to the provided NavTriangleIdx in the provided NavFloorPtr.

Parameters
navFloorPtrThe NavFloor that contains the triangle this object should refer to.
triangleIdxThe index of this triangle within the NavFloor.
Kaim::NavTrianglePtr::NavTrianglePtr ( const NavTriangleRawPtr navTriangleRawPtr)
inlineexplicit

Creates a new NavTrianglePtr copying information from the provided one.

Member Function Documentation

KyFloat32 Kaim::NavTrianglePtr::GetAltitudeOfPointInTriangle ( const Vec3f pos) const
inline

Returns the altitude of the point on the plane defined by this triangle that has the same (X,Y) coordinates as the specified position.

Parameters
posThe 3D position of the point
Precondition
This object must be valid. Its validity is not checked.
const CellPos & Kaim::NavTrianglePtr::GetCellPos ( ) const
inline

Returns a const reference to the CellPos that indicates the position of the cell that contains this triangle.

Precondition
This object must be valid. Its validity is not checked.
NavFloor * Kaim::NavTrianglePtr::GetNavFloor ( ) const
inline

Returns a pointer to the NavFloor that contains this triangle. Returns nullptr if this object is not valid.

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

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

Precondition
This object must be valid. Its validity is not checked. Returns a pointer to the NavFloor that contains this triangle.
This object must be valid. Its validity is not checked.
const NavFloorBlob * Kaim::NavTrianglePtr::GetNavFloorBlob ( ) const
inline

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

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

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

Precondition
This object must be valid. Its validity is not checked.
NavTriangleRawPtr Kaim::NavTrianglePtr::GetRawPtr ( ) const
inline

Constructs and returns a NavTriangleRawPtr that refers to the same NavTriangle.

Precondition
This object must be valid. Its validity is not checked. Returns a const reference to the NavTag associated to this navTriangle.
This object must be valid. Its validity is not checked.
NavTriangleIdx Kaim::NavTrianglePtr::GetTriangleIdx ( ) const
inline

Returns the index of this triangle within its NavFloor.

void Kaim::NavTrianglePtr::GetVerticesCoordPos ( CoordPos v0CoordPos,
CoordPos v1CoordPos,
CoordPos v2CoordPos 
) const
inline

Updates the parameters to identify the vertices in this triangle.

Parameters
[out]v0CoordPosThe 2D integer position in cell of the first vertex in the triangle.
[out]v1CoordPosThe 2D integer position in cell of the second vertex in the triangle.
[out]v2CoordPosThe 2D integer position in cell of the third vertex in the triangle.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavTrianglePtr::GetVerticesCoordPos64 ( CoordPos64 v0CoordPos64,
CoordPos64 v1CoordPos64,
CoordPos64 v2CoordPos64 
) const
inline

Updates the parameters to identify the vertices in this triangle.

Parameters
[out]v0CoordPos64The 2D integer position of the first vertex in the triangle.
[out]v1CoordPos64The 2D integer position of the second vertex in the triangle.
[out]v2CoordPos64The 2D integer position of the third vertex in the triangle.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavTrianglePtr::GetVerticesPos3f ( Vec3f v0Pos3f,
Vec3f v1Pos3f,
Vec3f v2Pos3f 
) const
inline

Updates the parameters to identify the vertices in this triangle.

Parameters
[out]v0Pos3fThe 3D position of the first vertex in the triangle.
[out]v1Pos3fThe 3D position of the second vertex in the triangle.
[out]v2Pos3fThe 3D position of the third vertex in the triangle.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavTrianglePtr::GetVerticesPos3f ( Triangle3f triangle3f) const
inline

Updates the parameters to identify the vertices in this triangle.

Parameters
[out]triangle3fThe 3 3D positions of the vertices in the triangle.
Precondition
This object must be valid. Its validity is not checked.
void Kaim::NavTrianglePtr::Invalidate ( )
inline

Invalidates this object.

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

Returns true if this object refers to a valid triangle: i.e. a triangle in a validNavFloor. see NavFloorPtr::IsValid().

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

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

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

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

void Kaim::NavTrianglePtr::Set ( const NavFloorPtr navFloorPtr,
NavTriangleIdx  triangleIdx 
)
inline

Clears all information maintained by this object.

Parameters
navFloorPtrThe NavFloor that contains the triangle this object should refer to.
triangleIdxThe index of this triangle within the NavFloor.

Member Data Documentation

NavFloorPtr Kaim::NavTrianglePtr::m_navFloorPtr

The NavFloor that contains this triangle.

CompactNavTriangleIdx Kaim::NavTrianglePtr::m_triangleIdx

The index of this triangle within its NavFloor.


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