MPMA Framework 0.4
|
00001 00002 //Luke Lenhart (2005-2011) 00003 //See /docs/License.txt for details on how this code may be used. 00004 00005 #pragma once 00006 00007 #include "../base/Setup.h" 00008 00009 #ifdef MPMA_COMPILE_GEO 00010 00011 #include "GeoObjects.h" 00012 00013 namespace GEO 00014 { 00016 namespace INTERSECT 00017 { 00018 // -- 3D 00019 00021 bool LinePlane(const Line &inLine, const Plane &inPlane, Vector3 &outPoint); 00023 bool LinePlane(const Line &inLine, const Plane &inPlane); 00024 00026 bool LineSphere(const Line &inLine, const Sphere &inSphere, Vector3 &outPoint1, Vector3 &outPoint2); 00028 bool LineSphere(const Line &inLine, const Sphere &inSphere); 00029 00031 bool RaySphere(const Line &inLine, const Sphere &inSphere); 00032 00034 bool LineYAlignedEllipsoid(const Line &inLine, const YAlignedEllipsoid &inEllipse, Vector3 &outPoint1, Vector3 &outPoint2); 00035 00037 bool RayYAlignedEllipsoid(const Line &inLine, const YAlignedEllipsoid &inEllipse); 00038 00040 bool LineAARectoid(const Line &inLine, const AARectoid &rect, Vector3 &outPoint1, Vector3 &outNormal1, Vector3 &outPoint2, Vector3 &outNormal2); 00041 00043 bool LineXAlignedUnboundedCylinder(const Line &inLine, const XAlignedUnboundedCylinder &inCyl, Vector3 &outPoint1, Vector3 &outPoint2); 00045 Vector3 NormalFromIntersection(const Vector3 &isect, const XAlignedUnboundedCylinder &inCyl); 00046 00048 bool RayXAlignedUnboundedCylinder(const Line &inLine, const XAlignedUnboundedCylinder &inCyl); 00049 00050 // -- 2D 00051 00053 bool CircleCircle(const Circle &inCircle1, const Circle &inCircle2); 00054 00056 bool Line2DSegmentCircle(const Line2D &inLine, const Circle &inCircle, GEO::Vector2 &outPos); 00057 } 00058 00060 namespace RESOLVE 00061 { 00062 // -- 2D 00063 00065 bool CircleEqualMass(const GEO::Vector2 &pos1, const GEO::Vector2 &vel1, const GEO::Vector2 &pos2, const GEO::Vector2 &vel2, GEO::Vector2 &outVel1, GEO::Vector2 &outVel2); 00066 00068 bool CircleDifferentMass(const GEO::Vector2 &pos1, const GEO::Vector2 &vel1, float mass1, const GEO::Vector2 &pos2, const GEO::Vector2 &vel2, float mass2, GEO::Vector2 &outVel1, GEO::Vector2 &outVel2); 00069 } 00070 00071 }; // namespace GEO 00072 00073 #endif //#ifdef MPMA_COMPILE_GEO