gwnavruntime/navmesh/identifiers/navtrianglerawptr.h Source File

navtrianglerawptr.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 
9 // ---------- Primary contact: JUBA - secondary contact: NOBODY
10 #ifndef Navigation_NavTriangleRawPtr_H
11 #define Navigation_NavTriangleRawPtr_H
12 
16 
17 namespace Kaim
18 {
19 
27 class NavTriangleRawPtr
28 {
29  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
30 
31 public:
34 
38  NavTriangleRawPtr(const NavFloorRawPtr& navFloorRawPtr, NavTriangleIdx triangleIdx);
39 
43  NavTriangleRawPtr(NavFloor* navFloor, NavTriangleIdx triangleIdx);
44 
45 
49  void Set(const NavFloorRawPtr& navFloorRawPtr, NavTriangleIdx triangleIdx);
50 
54  void Set(NavFloor* navFloor, NavTriangleIdx triangleIdx);
55 
57  bool IsValid() const;
58 
59  void Invalidate();
60 
61  bool operator==(const NavTriangleRawPtr& rhs) const;
62  bool operator!=(const NavTriangleRawPtr& rhs) const;
63 
65 
66  // ---------------------------------- Member Functions for valid instance ----------------------------------
69 
72  NavFloor* GetNavFloor() const;
73 
76  const NavFloorBlob* GetNavFloorBlob() const;
77 
81  const CellPos& GetCellPos() const;
82 
85  const NavTag& GetNavTag() const;
86 
92  void GetVerticesPos3f(Vec3f& v0Pos3f, Vec3f& v1Pos3f, Vec3f& v2Pos3f) const;
93 
97  void GetVerticesPos3f(Triangle3f& triangle3f) const;
98 
104  void GetVerticesCoordPos64(CoordPos64& v0CoordPos64, CoordPos64& v1CoordPos64, CoordPos64& v2CoordPos64) const;
105 
111  void GetVerticesCoordPos(CoordPos& v0CoordPos, CoordPos& v1CoordPos, CoordPos& v2CoordPos) const;
112 
117  KyFloat32 GetAltitudeOfPointInTriangle(const Vec3f& pos) const;
118 
119  template<class TraverseLogic>
120  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier = KY_NULL) const;
121 
122 public: // internal
123  template<class TraverseLogic>
124  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithoutCostMultipler&) const;
125  template<class TraverseLogic>
126  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostMultiplerPerNavTag&) const;
127  template<class TraverseLogic>
128  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostMultiplerPerTriangle&) const;
129 public:
131  CompactNavTriangleIdx m_triangleIdx;
132 };
133 
134 }
135 
136 #include "gwnavruntime/navmesh/identifiers/navtrianglerawptr.inl"
137 
138 #endif //Navigation_NavTriangleRawPtr_H
139 
void Invalidate()
Invalidates this object.
Definition: navtrianglerawptr.inl:35
KyUInt32 NavTriangleIdx
An index that uniquely identifies a single triangle within the set of triangles owned by a NavFloor...
Definition: navmeshtypes.h:100
This class is a runtime wrapper of a NavFloorBlob, it gathers all the runtime information associated ...
Definition: navfloor.h:40
The NavFloorBlob contains a connected and not overlapping part of triangle mesh static data within a ...
Definition: navfloorblob.h:42
const NavTag & GetNavTag() const
Retrieves the NavTag associated to the NavFloor that contains this triangle.
Definition: navtrianglerawptr.inl:45
This class represents a triangle in three-dimensional space, whose dimensions are stored using float ...
Definition: triangle3f.h:22
void Set(const NavFloorRawPtr &navFloorRawPtr, NavTriangleIdx triangleIdx)
Clears all information maintained by this object.
Definition: navtrianglerawptr.inl:19
#define KY_NULL
Null value.
Definition: types.h:247
NavTriangleIdx GetTriangleIdx() const
Retrieves the index of this triangle within its NavFloorBlob.
Definition: navtrianglerawptr.inl:40
const NavFloorBlob * GetNavFloorBlob() const
Returns a reference to the NavFloorBlob that contains this triangle.
Definition: navtrianglerawptr.inl:43
This class defines a two-dimensional vector whose coordinates are stored using 64-bit integers...
Definition: vec2ll.h:27
NavFloorRawPtr m_navFloorRawPtr
The NavFloor that contains this triangle.
Definition: navtrianglerawptr.h:142
NavFloor * GetNavFloor() const
Returns a reference to the NavFloor that contains this triangle.
Definition: navtrianglerawptr.inl:42
void GetVerticesCoordPos(CoordPos &v0CoordPos, CoordPos &v1CoordPos, CoordPos &v2CoordPos) const
Updates the parameters to identify the vertices in this triangle.
bool IsValid() const
Returns true if this object refers to a valid edge: i.e. an edge in a validNavFloor. see NavFloorPtr::IsValid()
Definition: navtrianglerawptr.inl:34
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
void GetVerticesPos3f(Vec3f &v0Pos3f, Vec3f &v1Pos3f, Vec3f &v2Pos3f) const
Updates the parameters to identify the vertices in this triangle.
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtrianglerawptr.h:30
const CellPos & GetCellPos() const
Returns a const reference to the CellPos that indicates the position of the cell that contains this t...
Definition: navtrianglerawptr.inl:44
KyFloat32 GetAltitudeOfPointInTriangle(const Vec3f &pos) const
Returns the altitude of the point on the plane defined by this triangle that has the same (X...
CompactNavTriangleIdx m_triangleIdx
The index of this triangle within its NavFloor.
Definition: navtrianglerawptr.h:143
void GetVerticesCoordPos64(CoordPos64 &v0CoordPos64, CoordPos64 &v1CoordPos64, CoordPos64 &v2CoordPos64) const
Updates the parameters to identify the vertices in this triangle.
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
Each instance of this class uniquely identifies a single NavFloor.
Definition: navfloorrawptr.h:30