#ifndef BLUECORE_PLANE_H #define BLUECORE_PLANE_H #include "Scalar.h" #include "Vector.h" namespace BlueCore { template class PlaneTemplate { public: Vector3Template _n; T _d; /** * contructor */ inline PlaneTemplate() : _d( 0. ) { } /** * contructor */ inline PlaneTemplate( Vector3Template a, Vector3Template b, Vector3Template c ) { _n = (a - b).cross(a - c).normalized(); _d = _n.dot( a ); } /** * distance */ inline T distance( const Vector3Template a ) { return _n.dot( a ) - _d; } }; typedef PlaneTemplate PlaneFloat; typedef PlaneTemplate PlaneDouble; typedef PlaneTemplate Plane; } #endif