00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "LampBasic.h"
00026 #include "Geometry/Primitive/Line.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/Intersection/AxisAlignedBoxIntersection.h"
00032 #include "Geometry/Intersection/CapsuleIntersection.h"
00033 #include "Geometry/Intersection/ConeIntersection.h"
00034 #include "Geometry/Intersection/LineIntersection.h"
00035
00036 namespace Lamp{
00037
00038
00039
00040
00041
00042 const Line Line::zero(0.f, 0.f, 0.f, 0.f, 0.f, 0.f);
00043
00044
00045
00046
00047
00048 float Line::getSquaredDistance(const Vector3& point) const{
00049 return LineDistance::squaredDistance(*this, point);
00050 }
00051
00052
00053 float Line::getSquaredDistance(const AxisAlignedBox& axisAlignedBox) const{
00054 return AxisAlignedBoxDistance::squaredDistance(axisAlignedBox, *this);
00055 }
00056
00057
00058 float Line::getSquaredDistance(const Capsule& capsule) const{
00059 return CapsuleDistance::squaredDistance(capsule, *this);
00060 }
00061
00062
00063 float Line::getSquaredDistance(const Cone& cone) const{
00064 return ConeDistance::squaredDistance(cone, *this);
00065 }
00066
00067
00068 float Line::getSquaredDistance(const Line& line) const{
00069 return LineDistance::squaredDistance(*this, line);
00070 }
00071
00072
00073 float Line::getSquaredDistance(const OrientedBox& orientedBox) const{
00074 return LineDistance::squaredDistance(*this, orientedBox);
00075 }
00076
00077
00078 float Line::getDistance(const Plane& plane) const{
00079 return LineDistance::distance(*this, plane);
00080 }
00081
00082
00083 float Line::getSquaredDistance(const Ray& ray) const{
00084 return LineDistance::squaredDistance(*this, ray);
00085 }
00086
00087
00088 float Line::getSquaredDistance(const Segment& segment) const{
00089 return LineDistance::squaredDistance(*this, segment);
00090 }
00091
00092
00093 float Line::getSquaredDistance(const Sphere& sphere) const{
00094 return LineDistance::squaredDistance(*this, sphere);
00095 }
00096
00097
00098 float Line::getSquaredDistance(const Triangle& triangle) const{
00099 return LineDistance::squaredDistance(*this, triangle);
00100 }
00101
00102
00103
00104
00105 bool Line::intersect(const Vector3& point, float range) const{
00106 return LineIntersection::intersect(*this, point, range);
00107 }
00108
00109
00110 bool Line::intersect(const AxisAlignedBox& axisAlignedBox) const{
00111 return AxisAlignedBoxIntersection::intersect(axisAlignedBox, *this);
00112 }
00113
00114
00115 bool Line::intersect(const Capsule& capsule) const{
00116 return CapsuleIntersection::intersect(capsule, *this);
00117 }
00118
00119
00120 bool Line::intersect(const Cone& cone) const{
00121 return ConeIntersection::intersect(cone, *this);
00122 }
00123
00124
00125 bool Line::intersect(const Line& line, float range) const{
00126 return LineIntersection::intersect(*this, line, range);
00127 }
00128
00129
00130 bool Line::intersect(const OrientedBox& orientedBox) const{
00131 return LineIntersection::intersect(*this, orientedBox);
00132 }
00133
00134
00135 bool Line::intersect(const Plane& plane) const{
00136 return LineIntersection::intersect(*this, plane);
00137 }
00138
00139
00140 bool Line::intersect(const Ray& ray, float range) const{
00141 return LineIntersection::intersect(*this, ray, range);
00142 }
00143
00144
00145 bool Line::intersect(const Segment& segment, float range) const{
00146 return LineIntersection::intersect(*this, segment, range);
00147 }
00148
00149
00150 bool Line::intersect(const Sphere& sphere) const{
00151 return LineIntersection::intersect(*this, sphere);
00152 }
00153
00154
00155 bool Line::intersect(const Triangle& triangle) const{
00156 return LineIntersection::intersect(*this, triangle);
00157 }
00158
00159 }
00160
00161