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 CAPSULE_INTERSECTION_H_ 00026 #define CAPSULE_INTERSECTION_H_ 00027 00028 namespace Lamp{ 00029 00030 class Capsule; 00031 class Cone; 00032 class Line; 00033 class OrientedBox; 00034 class Plane; 00035 class Ray; 00036 class Segment; 00037 class Sphere; 00038 class Triangle; 00039 00040 //------------------------------------------------------------------------------ 00041 /** 00042 * カプセル交差 00043 */ 00044 class CapsuleIntersection{ 00045 public: 00046 //-------------------------------------------------------------------------- 00047 // 点 00048 //-------------------------------------------------------------------------- 00049 /** 00050 * 点交差 00051 * @param capsule カプセル 00052 * @param point 点 00053 * @return 交差していればtrue 00054 */ 00055 static bool intersect(const Capsule& capsule, const Vector3& point); 00056 00057 //-------------------------------------------------------------------------- 00058 // カプセル 00059 //-------------------------------------------------------------------------- 00060 /** 00061 * カプセル交差 00062 * @param capsule0 カプセル 00063 * @param capsule1 カプセル 00064 * @return 交差していればtrue 00065 */ 00066 static bool intersect(const Capsule& capsule0, const Capsule& capsule1); 00067 00068 //-------------------------------------------------------------------------- 00069 // コーン 00070 //-------------------------------------------------------------------------- 00071 /** 00072 * コーン交差 00073 * @param capsule カプセル 00074 * @param cone コーン 00075 * @return 交差していればtrue 00076 */ 00077 static bool intersect(const Capsule& capsule, const Cone& cone); 00078 00079 //-------------------------------------------------------------------------- 00080 // ライン 00081 //-------------------------------------------------------------------------- 00082 /** 00083 * ライン交差 00084 * @param capsule カプセル 00085 * @param line ライン 00086 * @return 交差していればtrue 00087 */ 00088 static bool intersect(const Capsule& capsule, const Line& line); 00089 00090 //-------------------------------------------------------------------------- 00091 // 指向性ボックス 00092 //-------------------------------------------------------------------------- 00093 /** 00094 * 指向性ボックス交差 00095 * @param capsule カプセル 00096 * @param ob 指向性ボックス 00097 * @return 交差していればtrue 00098 */ 00099 static bool intersect(const Capsule& capsule, const OrientedBox& ob); 00100 00101 //-------------------------------------------------------------------------- 00102 // 平面 00103 //-------------------------------------------------------------------------- 00104 /** 00105 * 平面交差 00106 * @param capsule カプセル 00107 * @param plane 平面 00108 * @return 交差していればtrue 00109 */ 00110 static bool intersect(const Capsule& capsule, const Plane& plane); 00111 00112 //-------------------------------------------------------------------------- 00113 // レイ 00114 //-------------------------------------------------------------------------- 00115 /** 00116 * レイ交差 00117 * @param capsule カプセル 00118 * @param ray レイ 00119 * @return 交差していればtrue 00120 */ 00121 static bool intersect(const Capsule& capsule, const Ray& ray); 00122 00123 //-------------------------------------------------------------------------- 00124 // セグメント 00125 //-------------------------------------------------------------------------- 00126 /** 00127 * セグメント交差 00128 * @param capsule カプセル 00129 * @param segment セグメント 00130 * @return 交差していればtrue 00131 */ 00132 static bool intersect(const Capsule& capsule, const Segment& segment); 00133 00134 //-------------------------------------------------------------------------- 00135 // 球 00136 //-------------------------------------------------------------------------- 00137 /** 00138 * 球交差 00139 * @param capsule カプセル 00140 * @param sphere 球 00141 * @return 交差していればtrue 00142 */ 00143 static bool intersect(const Capsule& capsule, const Sphere& sphere); 00144 00145 //-------------------------------------------------------------------------- 00146 // 三角 00147 //-------------------------------------------------------------------------- 00148 /** 00149 * 三角交差 00150 * @param capsule カプセル 00151 * @param triangle 三角 00152 * @return 交差していればtrue 00153 */ 00154 static bool intersect(const Capsule& capsule, const Triangle& triangle); 00155 00156 private: 00157 //-------------------------------------------------------------------------- 00158 // コンストラクタの隠蔽 00159 CapsuleIntersection(); 00160 00161 }; 00162 00163 //------------------------------------------------------------------------------ 00164 } // End of namespace Lamp 00165 #endif // End of CAPSULE_INTERSECTION_H_ 00166 //------------------------------------------------------------------------------