Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Plane.cpp

Go to the documentation of this file.
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 #include "LampBasic.h"
00026 #include "Geometry/Primitive/Plane.h"
00027 #include "Geometry/Distance/AxisAlignedBoxDistance.h"
00028 #include "Geometry/Distance/CapsuleDistance.h"
00029 #include "Geometry/Distance/ConeDistance.h"
00030 #include "Geometry/Distance/LineDistance.h"
00031 #include "Geometry/Distance/OrientedBoxDistance.h"
00032 #include "Geometry/Distance/PlaneDistance.h"
00033 #include "Geometry/Intersection/AxisAlignedBoxIntersection.h"
00034 #include "Geometry/Intersection/CapsuleIntersection.h"
00035 #include "Geometry/Intersection/ConeIntersection.h"
00036 #include "Geometry/Intersection/LineIntersection.h"
00037 #include "Geometry/Intersection/OrientedBoxIntersection.h"
00038 #include "Geometry/Intersection/PlaneIntersection.h"
00039 
00040 namespace Lamp{
00041 
00042 //------------------------------------------------------------------------------
00043 // 定数
00044 //------------------------------------------------------------------------------
00045 // ゼロ平面
00046 const Plane Plane::zero(0.f, 0.f, 0.f, 0.f);
00047 
00048 // X単位平面
00049 const Plane Plane::unitX(1.f, 0.f, 0.f, 0.f);
00050 
00051 // Y単位平面
00052 const Plane Plane::unitY(0.f, 1.f, 0.f, 0.f);
00053 
00054 // Z単位平面
00055 const Plane Plane::unitZ(0.f, 0.f, 1.f, 0.f);
00056 
00057 //------------------------------------------------------------------------------
00058 // 距離
00059 //------------------------------------------------------------------------------
00060 // 点距離
00061 float Plane::getDistance(const Vector3& point) const{
00062     return PlaneDistance::distance(*this, point);
00063 }
00064 //------------------------------------------------------------------------------
00065 // 軸沿いボックス距離
00066 float Plane::getDistance(const AxisAlignedBox& axisAlignedBox) const{
00067     return AxisAlignedBoxDistance::distance(axisAlignedBox, *this);
00068 }
00069 //------------------------------------------------------------------------------
00070 // カプセル距離
00071 float Plane::getDistance(const Capsule& capsule) const{
00072     return CapsuleDistance::distance(capsule, *this);
00073 }
00074 //------------------------------------------------------------------------------
00075 // コーン距離
00076 float Plane::getDistance(const Cone& cone) const{
00077     return ConeDistance::distance(cone, *this);
00078 }
00079 //------------------------------------------------------------------------------
00080 // ライン距離
00081 float Plane::getDistance(const Line& line) const{
00082     return LineDistance::distance(line, *this);
00083 }
00084 //------------------------------------------------------------------------------
00085 // 平面距離
00086 float Plane::getDistance(const Plane& plane) const{
00087     return PlaneDistance::distance(*this, plane);
00088 }
00089 //------------------------------------------------------------------------------
00090 // 指向性ボックス距離
00091 float Plane::getDistance(const OrientedBox& orientedBox) const{
00092     return OrientedBoxDistance::distance(orientedBox, *this);
00093 }
00094 //------------------------------------------------------------------------------
00095 // レイ距離
00096 float Plane::getDistance(const Ray& ray) const{
00097     return PlaneDistance::distance(*this, ray);
00098 }
00099 //------------------------------------------------------------------------------
00100 // セグメント距離
00101 float Plane::getDistance(const Segment& segment) const{
00102     return PlaneDistance::distance(*this, segment);
00103 }
00104 //------------------------------------------------------------------------------
00105 // 球距離
00106 float Plane::getDistance(const Sphere& sphere) const{
00107     return PlaneDistance::distance(*this, sphere);
00108 }
00109 //------------------------------------------------------------------------------
00110 // 三角距離
00111 float Plane::getDistance(const Triangle& triangle) const{
00112     return PlaneDistance::distance(*this, triangle);
00113 }
00114 //------------------------------------------------------------------------------
00115 // 交差
00116 //------------------------------------------------------------------------------
00117 // 点交差
00118 bool Plane::intersect(const Vector3& point, float range) const{
00119     return PlaneIntersection::intersect(*this, point, range);
00120 }
00121 //------------------------------------------------------------------------------
00122 // 軸沿いボックス交差
00123 bool Plane::intersect(const AxisAlignedBox& axisAlignedBox) const{
00124     return AxisAlignedBoxIntersection::intersect(axisAlignedBox, *this);
00125 }
00126 //------------------------------------------------------------------------------
00127 // カプセル交差
00128 bool Plane::intersect(const Capsule& capsule) const{
00129     return CapsuleIntersection::intersect(capsule, *this);
00130 }
00131 //------------------------------------------------------------------------------
00132 // コーン交差
00133 bool Plane::intersect(const Cone& cone) const{
00134     return ConeIntersection::intersect(cone, *this);
00135 }
00136 //------------------------------------------------------------------------------
00137 // ライン交差
00138 bool Plane::intersect(const Line& line) const{
00139     return LineIntersection::intersect(line, *this);
00140 }
00141 //------------------------------------------------------------------------------
00142 // 指向性ボックス交差
00143 bool Plane::intersect(const OrientedBox& orientedBox) const{
00144     return OrientedBoxIntersection::intersect(orientedBox, *this);
00145 }
00146 //------------------------------------------------------------------------------
00147 // 平面交差
00148 bool Plane::intersect(const Plane& plane) const{
00149     return PlaneIntersection::intersect(*this, plane);
00150 }
00151 //------------------------------------------------------------------------------
00152 // レイ交差
00153 bool Plane::intersect(const Ray& ray) const{
00154     return PlaneIntersection::intersect(*this, ray);
00155 }
00156 //------------------------------------------------------------------------------
00157 // セグメント交差
00158 bool Plane::intersect(const Segment& segment) const{
00159     return PlaneIntersection::intersect(*this, segment);
00160 }
00161 //------------------------------------------------------------------------------
00162 // 球交差
00163 bool Plane::intersect(const Sphere& sphere) const{
00164     return PlaneIntersection::intersect(*this, sphere);
00165 }
00166 //------------------------------------------------------------------------------
00167 // 三角交差
00168 bool Plane::intersect(const Triangle& triangle) const{
00169     return PlaneIntersection::intersect(*this, triangle);
00170 }
00171 //------------------------------------------------------------------------------
00172 } // End of namespace Lamp
00173 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:33 2005 for Lamp by doxygen 1.3.2