Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cSpatialObject.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cSpatialObject_H
7 #define _INC_cSpatialObject_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../Gray3D.h"
15 
16 namespace Gray3D
17 {
18  struct ISpatialTest;
19 
21  {
26 
27  public:
28  // The location inside the spatial tree. (in world coords)
30 
31  public:
32  cSpatialObject() noexcept
33  : m_s(-1, -1, 0, 0) // invalid.
34  {
35  }
36  virtual ~cSpatialObject()
37  {
39  }
40 
41  const cSpheref& get_BoundSphere() const noexcept
42  {
44  return m_s;
45  }
46  const cVector3f& get_CenterPos() const noexcept
47  {
49  return m_s.m_vCenter; // in map world coords.
50  }
51  float get_Radius() const noexcept
52  {
53  return m_s.m_fRadius; // meters.
54  }
55 
56  virtual void TestTree(const ISpatialTest* pTree) const;
57  };
58 }
59 #endif // _INC_cSpatialObject_H
#define GRAY3D_LINK
Definition: Gray3D.h:15
Definition: cSpatialObject.h:21
const cVector3f & get_CenterPos() const noexcept
Definition: cSpatialObject.h:46
float get_Radius() const noexcept
Definition: cSpatialObject.h:51
const cSpheref & get_BoundSphere() const noexcept
Definition: cSpatialObject.h:41
cSpatialObject() noexcept
Definition: cSpatialObject.h:32
cSpheref m_s
set coords from AddToOctree
Definition: cSpatialObject.h:29
virtual ~cSpatialObject()
Definition: cSpatialObject.h:36
Definition: cSphere.h:20
Definition: cVector.h:94
Definition: cSpatialTest.h:106
Definition: Gray3D.cpp:12