NavArea.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "../Math/BoundingBox.h"
  5. #include "../Scene/Component.h"
  6. namespace Urho3D
  7. {
  8. class URHO3D_API NavArea : public Component
  9. {
  10. URHO3D_OBJECT(NavArea, Component);
  11. public:
  12. /// Construct.
  13. explicit NavArea(Context* context);
  14. /// Destruct.
  15. ~NavArea() override;
  16. /// Register object factory and attributes.
  17. /// @nobind
  18. static void RegisterObject(Context* context);
  19. /// Render debug geometry for the bounds.
  20. void DrawDebugGeometry(DebugRenderer* debug, bool depthTest) override;
  21. /// Get the area id for this volume.
  22. /// @property
  23. unsigned GetAreaID() const { return (unsigned)areaID_; }
  24. /// Set the area id for this volume.
  25. /// @property
  26. void SetAreaID(unsigned newID);
  27. /// Get the bounding box of this navigation area, in local space.
  28. /// @property
  29. BoundingBox GetBoundingBox() const { return boundingBox_; }
  30. /// Set the bounding box of this area, in local space.
  31. /// @property
  32. void SetBoundingBox(const BoundingBox& bnds) { boundingBox_ = bnds; }
  33. /// Get the bounds of this navigation area in world space.
  34. /// @property
  35. BoundingBox GetWorldBoundingBox() const;
  36. private:
  37. /// Bounds of area to mark.
  38. BoundingBox boundingBox_;
  39. /// Area id to assign to the marked area.
  40. unsigned char areaID_;
  41. };
  42. }