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 SPHERE_INTERSECTION_H_ 00026 #define SPHERE_INTERSECTION_H_ 00027 00028 namespace Lamp{ 00029 00030 class Intersection; 00031 class Sphere; 00032 class Triangle; 00033 00034 //------------------------------------------------------------------------------ 00035 /** 00036 * 球交差 00037 */ 00038 class SphereIntersection{ 00039 public: 00040 //-------------------------------------------------------------------------- 00041 // 点 00042 //-------------------------------------------------------------------------- 00043 /** 00044 * 点交差 00045 * @param sphere 球 00046 * @param point 点 00047 * @return 交差していればtrue 00048 */ 00049 static bool intersect(const Sphere& sphere, const Vector3& point); 00050 00051 //-------------------------------------------------------------------------- 00052 // 球 00053 //-------------------------------------------------------------------------- 00054 /** 00055 * 球交差 00056 * @param sphere0 球 00057 * @param sphere1 球 00058 * @return 交差していればtrue 00059 */ 00060 static bool intersect(const Sphere& sphere0, const Sphere& sphere1); 00061 00062 /** 00063 * 球交差 00064 * @param intersecion 交差、返り値がtrueなら設定されている 00065 * @param sphere0 球 00066 * @param sphere1 球 00067 * @return 交差していればtrue 00068 */ 00069 static bool intersect(Intersection* intersection, 00070 const Sphere& sphere0, const Sphere& sphere1); 00071 00072 //-------------------------------------------------------------------------- 00073 // 三角 00074 //-------------------------------------------------------------------------- 00075 /** 00076 * 三角交差 00077 * @param sphere 球 00078 * @param triangle 三角 00079 * @return 交差していればtrue 00080 */ 00081 static bool intersect(const Sphere& sphere, const Triangle& triangle); 00082 00083 /** 00084 * 三角交差 00085 * @param intersecion 交差、返り値がtrueなら設定されている 00086 * @param sphere 球 00087 * @param triangle 三角 00088 * @return 交差していればtrue 00089 */ 00090 static bool intersect(Intersection* intersection, 00091 const Sphere& sphere, const Triangle& triangle); 00092 00093 private: 00094 //-------------------------------------------------------------------------- 00095 // コンストラクタの隠蔽 00096 SphereIntersection(); 00097 00098 }; 00099 00100 //------------------------------------------------------------------------------ 00101 } // End of namespace Lamp 00102 #endif // End of SPHERE_INTERSECTION_H_ 00103 //------------------------------------------------------------------------------