00001 // Wild Magic Source Code 00002 // David Eberly 00003 // http://www.geometrictools.com 00004 // Copyright (c) 1998-2007 00005 // 00006 // This library is free software; you can redistribute it and/or modify it 00007 // under the terms of the GNU Lesser General Public License as published by 00008 // the Free Software Foundation; either version 2.1 of the License, or (at 00009 // your option) any later version. The license is available for reading at 00010 // either of the locations: 00011 // http://www.gnu.org/copyleft/lgpl.html 00012 // http://www.geometrictools.com/License/WildMagicLicense.pdf 00013 // The license applies to versions 0 through 4 of Wild Magic. 00014 // 00015 // Version: 4.0.0 (2006/06/28) 00016 00017 #ifndef WM4DISTVECTOR3PLANE3_H 00018 #define WM4DISTVECTOR3PLANE3_H 00019 00020 #include "Wm4FoundationLIB.h" 00021 #include "Wm4Distance.h" 00022 #include "Wm4Plane3.h" 00023 00024 namespace Wm4 00025 { 00026 00027 template <class Real> 00028 class WM4_FOUNDATION_ITEM DistVector3Plane3 00029 : public Distance<Real,Vector3<Real> > 00030 { 00031 public: 00032 DistVector3Plane3 (const Vector3<Real>& rkVector, 00033 const Plane3<Real>& rkPlane); 00034 00035 // object access 00036 const Vector3<Real>& GetVector () const; 00037 const Plane3<Real>& GetPlane () const; 00038 00039 // static distance queries 00040 virtual Real Get (); 00041 virtual Real GetSquared (); 00042 00043 // function calculations for dynamic distance queries 00044 virtual Real Get (Real fT, const Vector3<Real>& rkVelocity0, 00045 const Vector3<Real>& rkVelocity1); 00046 virtual Real GetSquared (Real fT, const Vector3<Real>& rkVelocity0, 00047 const Vector3<Real>& rkVelocity1); 00048 00049 private: 00050 using Distance<Real,Vector3<Real> >::m_kClosestPoint0; 00051 using Distance<Real,Vector3<Real> >::m_kClosestPoint1; 00052 00053 const Vector3<Real>& m_rkVector; 00054 const Plane3<Real>& m_rkPlane; 00055 }; 00056 00057 typedef DistVector3Plane3<float> DistVector3Plane3f; 00058 typedef DistVector3Plane3<double> DistVector3Plane3d; 00059 00060 } 00061 00062 #endif