All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Sphere.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "VectorMath.h"
6 #include "IntersectionTests.h"
7 
8 namespace Eegeo
9 {
10  namespace Geometry
11  {
12  class Sphere
13  {
14  public:
15  Eegeo::dv3 center;
16  double radius;
17 
18  bool IntersectsWithRay(Eegeo::dv3 rayStartPoint, Eegeo::dv3 rayDirection) const
19  {
20  return IntersectionTests::TestRaySphere(rayStartPoint, rayDirection, center, radius);
21  }
22 
23  bool IntersectsWithSphere(Sphere& sphere)
24  {
25  return IntersectionTests::TestSphereSphere(this->center, this->radius, sphere.center, sphere.radius);
26  }
27  };
28  }
29 }