00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * 平面交差ヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef PLANE_INTERSECTION_H_ 00026 #define PLANE_INTERSECTION_H_ 00027 00028 namespace Lamp{ 00029 00030 class Plane; 00031 class Ray; 00032 class Segment; 00033 class Sphere; 00034 class Triangle; 00035 00036 //------------------------------------------------------------------------------ 00037 /** 00038 * 平面交差 00039 */ 00040 class PlaneIntersection{ 00041 public: 00042 //-------------------------------------------------------------------------- 00043 // 点 00044 //-------------------------------------------------------------------------- 00045 /** 00046 * 点交差 00047 * @param plane 平面 00048 * @param point 点 00049 * @param range 交差範囲 00050 * @return 交差していればtrue 00051 */ 00052 static bool intersect(const Plane& plane, const Vector3& point, 00053 float range = Math::epsilon); 00054 00055 //-------------------------------------------------------------------------- 00056 // 平面 00057 //-------------------------------------------------------------------------- 00058 /** 00059 * 平面交差 00060 * @param plane0 平面 00061 * @param plane1 平面 00062 * @return 交差していればtrue 00063 */ 00064 static bool intersect(const Plane& plane0, const Plane& plane1); 00065 00066 //-------------------------------------------------------------------------- 00067 // レイ 00068 //-------------------------------------------------------------------------- 00069 /** 00070 * レイ交差 00071 * @param plane 平面 00072 * @param ray レイ 00073 * @return 交差していればtrue 00074 */ 00075 static bool intersect(const Plane& plane, const Ray& ray); 00076 00077 //-------------------------------------------------------------------------- 00078 // セグメント 00079 //-------------------------------------------------------------------------- 00080 /** 00081 * セグメント交差 00082 * @param plane 平面 00083 * @param segment セグメント 00084 * @return 交差していればtrue 00085 */ 00086 static bool intersect(const Plane& plane, const Segment& segment); 00087 00088 //-------------------------------------------------------------------------- 00089 // 球 00090 //-------------------------------------------------------------------------- 00091 /** 00092 * 球交差 00093 * @param plane 平面 00094 * @param sphere 球 00095 * @return 交差していればtrue 00096 */ 00097 static bool intersect(const Plane& plane, const Sphere& sphere); 00098 00099 //-------------------------------------------------------------------------- 00100 // 三角 00101 //-------------------------------------------------------------------------- 00102 /** 00103 * 三角交差 00104 * @param plane 平面 00105 * @param triangle 三角 00106 * @return 交差していればtrue 00107 */ 00108 static bool intersect(const Plane& plane, const Triangle& triangle); 00109 00110 private: 00111 //-------------------------------------------------------------------------- 00112 // コンストラクタの隠蔽 00113 PlaneIntersection(); 00114 00115 }; 00116 00117 //------------------------------------------------------------------------------ 00118 } // End of namespace Lamp 00119 #endif // End of PLANE_INTERSECTION_H_ 00120 //------------------------------------------------------------------------------