gwnavruntime/navmesh/identifiers/navfloorrawptr.h Source File

navfloorrawptr.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
10 
11 namespace Kaim
12 {
13 
14 class NavFloorBlob;
15 
24 {
25  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
26 public:
27  NavFloorRawPtr();
28 
31  explicit NavFloorRawPtr(NavFloor* navFloor);
32 
35  void Set(NavFloor* navFloor);
36 
41  bool IsValid() const;
42 
44  void Invalidate();
45 
46  bool operator==(const NavFloorRawPtr& rhs) const;
47  bool operator!=(const NavFloorRawPtr& rhs) const;
48 
50  NavFloor* GetNavFloor() const;
51 
54  const NavFloorBlob* GetNavFloorBlob() const;
55 
59  const CellPos& GetCellPos() const;
60 
61 public:
62  NavFloor* m_navFloor;
63 };
64 
65 KY_INLINE NavFloorRawPtr::NavFloorRawPtr() : m_navFloor(nullptr) {}
66 KY_INLINE NavFloorRawPtr::NavFloorRawPtr(NavFloor* navFloor) : m_navFloor(navFloor) {}
67 KY_INLINE void NavFloorRawPtr::Set(NavFloor* navFloor) { m_navFloor = navFloor; }
68 
69 KY_INLINE bool NavFloorRawPtr::IsValid() const { return m_navFloor != nullptr && m_navFloor->IsStillLoaded() && m_navFloor->IsActive(); }
70 KY_INLINE void NavFloorRawPtr::Invalidate() { m_navFloor = nullptr; }
71 
72 KY_INLINE bool NavFloorRawPtr::operator==(const NavFloorRawPtr& rhs) const { return m_navFloor == rhs.m_navFloor; }
73 KY_INLINE bool NavFloorRawPtr::operator!=(const NavFloorRawPtr& rhs) const { return !(*this == rhs); }
74 
75 KY_INLINE NavFloor* NavFloorRawPtr::GetNavFloor() const { return m_navFloor; }
77 KY_INLINE const CellPos& NavFloorRawPtr::GetCellPos() const { return GetNavFloor()->GetCellPos(); }
78 
79 }
80 
81 
This class is a runtime wrapper of a NavFloorBlob, it gathers all the runtime information associated ...
Definition: navfloor.h:32
The NavFloorBlob contains a connected and not overlapping part of triangle mesh static data within a ...
Definition: navfloorblob.h:38
const CellPos & GetCellPos() const
Returns a const reference to the CellPos that indicates the position of the cell that contains this N...
Definition: navfloorrawptr.h:77
const NavFloorBlob * GetNavFloorBlob() const
Retrieves the NavFloorBlob that contains the static data for this NavFloor.
Definition: navfloor.h:116
bool operator!=(const NavFloorRawPtr &rhs) const
Returns true if this object identifies a different NavFloor from rhs.
Definition: navfloorrawptr.h:73
const NavFloorBlob * GetNavFloorBlob() const
Returns a reference to the NavFloor identified by this object.
Definition: navfloorrawptr.h:76
NavFloorRawPtr()
Creates an invalid NavFloorRawPtr.
Definition: navfloorrawptr.h:65
NavFloor * GetNavFloor() const
Returns a reference to the NavFloor identified by this object.
Definition: navfloorrawptr.h:75
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
2d vector using KyInt32
Definition: vec2i.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
void Set(NavFloor *navFloor)
Sets the information maintained by this object.
Definition: navfloorrawptr.h:67
void Invalidate()
Invalidates this object.
Definition: navfloorrawptr.h:70
bool IsActive() const
This function returns true if the NavFloor has been "activated" in term of overlap, dynamic version,...
Definition: navfloor.h:126
bool IsStillLoaded() const
This function returns false if the NavData containing corresponding NavFloorBlob has been removed fro...
Definition: navfloor.h:125
bool IsValid() const
Returns true if this object refers to a valid NavFloor, which means a NavFloor:that exists...
Definition: navfloorrawptr.h:69
bool operator==(const NavFloorRawPtr &rhs) const
Returns true if this object identifies the same NavFloor as rhs, or if both are invalid.
Definition: navfloorrawptr.h:72
const CellPos & GetCellPos() const
Returns the position of this NavFloor within the grid of NavData cells.
Definition: navfloor.h:128
Each instance of this class uniquely identifies a single NavFloor.
Definition: navfloorrawptr.h:23