GeoIntersect.h

00001 //simple geometry intersection functions.  This is not yet officially part of MPMA, due to the fact that what's here is just random scattered stuff I found useful.
00002 //Luke Lenhart (2005-2008)
00003 //See /docs/License.txt for details on how this code may be used.
00004 
00005 #pragma once
00006 
00007 #include "GeoObjects.h"
00008 
00009 namespace GEO
00010 {
00011     namespace INTERSECT
00012     {
00013         //line and plane intersection
00014         bool LinePlane(const Line &inLine, const Plane &inPlane, Vector3 &outPoint);
00015         bool LinePlane(const Line &inLine, const Plane &inPlane);
00016 
00017         //line and sphere
00018         bool LineSphere(const Line &inLine, const Sphere &inSphere, Vector3 &outPoint1, Vector3 &outPoint2);
00019         bool LineSphere(const Line &inLine, const Sphere &inSphere);
00020 
00021         bool RaySphere(const Line &inLine, const Sphere &inSphere);
00022 
00023         //line and axis-aligned ellipsoid
00024         bool LineYAlignedEllipsoid(const Line &inLine, const YAlignedEllipsoid &inEllipse, Vector3 &outPoint1, Vector3 &outPoint2);
00025 
00026         bool RayYAlignedEllipsoid(const Line &inLine, const YAlignedEllipsoid &inEllipse);
00027 
00028         //line and axis aligned 3d rectangle
00029         bool LineAARectoid(const Line &inLine, const AARectoid &rect, Vector3 &outPoint1, Vector3 &outNormal1, Vector3 &outPoint2, Vector3 &outNormal2);
00030 
00031         //line and axis aligned unbounded cylinder
00032         bool LineXAlignedUnboundedCylinder(const Line &inLine, const XAlignedUnboundedCylinder &inCyl, Vector3 &outPoint1, Vector3 &outPoint2);
00033         Vector3 NormalFromIntersection(const Vector3 &isect, const XAlignedUnboundedCylinder &inCyl);
00034 
00035         bool RayXAlignedUnboundedCylinder(const Line &inLine, const XAlignedUnboundedCylinder &inCyl);
00036     }
00037 
00038 }; // namespace GEO

Generated on Sat Aug 9 15:05:05 2008 for MPMA Framework by  doxygen 1.5.6