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 WM4INTRLINE3PLANE3_H 00018 #define WM4INTRLINE3PLANE3_H 00019 00020 #include "Wm4FoundationLIB.h" 00021 #include "Wm4Intersector.h" 00022 #include "Wm4Line3.h" 00023 #include "Wm4Plane3.h" 00024 00025 namespace Wm4 00026 { 00027 00028 template <class Real> 00029 class WM4_FOUNDATION_ITEM IntrLine3Plane3 00030 : public Intersector<Real,Vector3<Real> > 00031 { 00032 public: 00033 IntrLine3Plane3 (const Line3<Real>& rkLine, const Plane3<Real>& rkPlane); 00034 00035 // object access 00036 const Line3<Real>& GetLine () const; 00037 const Plane3<Real>& GetPlane () const; 00038 00039 // test-intersection query 00040 virtual bool Test (); 00041 00042 // Find-intersection query. The point of intersection is 00043 // P = origin + t*direction. 00044 virtual bool Find (); 00045 Real GetLineT () const; 00046 00047 private: 00048 using Intersector<Real,Vector3<Real> >::IT_EMPTY; 00049 using Intersector<Real,Vector3<Real> >::IT_POINT; 00050 using Intersector<Real,Vector3<Real> >::IT_LINE; 00051 using Intersector<Real,Vector3<Real> >::m_iIntersectionType; 00052 00053 // the objects to intersect 00054 const Line3<Real>& m_rkLine; 00055 const Plane3<Real>& m_rkPlane; 00056 00057 // information about the intersection set 00058 Real m_fLineT; 00059 }; 00060 00061 typedef IntrLine3Plane3<float> IntrLine3Plane3f; 00062 typedef IntrLine3Plane3<double> IntrLine3Plane3d; 00063 00064 } 00065 00066 #endif