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