All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DoublePlane.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "MathFunc.h"
6 #include "VectorMath.h"
7 
8 namespace Eegeo
9 {
10  namespace Geometry
11  {
13  {
14  public:
15  dv3 Normal;
16  double Distance;
17 
18 
19  double SignedDistanceToPoint(const dv3& point) const
20  {
21  return dv3::Dot(Normal, point) - Distance;
22  }
23 
24  bool IsOnPositiveSide(const dv3& point) const
25  {
26  return SignedDistanceToPoint(point) >= 0.0;
27  }
28 
29 
30  static DoublePlane CreateFromPoints(const dv3& p0, const dv3& p1, const dv3& p2);
31 
32  static DoublePlane CreateFromNormalAndPoint(const dv3& normal, const dv3& pointOnPlane);
33 
34  static DoublePlane Zero();
35  };
36  }
37 }