00001 #ifndef CDDETECTORIMP_H
00002 #define CDDETECTORIMP_H
00003 #include "CDQuickHull3D.h"
00004
00005 namespace Spr {;
00006
00007 #define CD_EPSILON HULL_EPSILON
00008 #define CD_INFINITE HULL_INFINITE
00009
00010 class CDFace;
00011 class CDConvex;
00012 class CDConvexPair;
00013 class CDConvexPairWithNormal;
00014 class SGScene;
00015
00016
00017 bool BBoxIntersection(Affinef postureA, Vec3f centerA, Vec3f extentA,
00018 Affinef postureB, Vec3f centerB, Vec3f extentB);
00019
00020
00021 bool FindCommonPoint(const CDConvex& a, const CDConvex& b,
00022 const Affinef& a2w, const Affinef& b2w,
00023 Vec3d& v, Vec3d& pa, Vec3d& pb);
00024
00025
00026 void FindClosestPoints(const CDConvex& a, const CDConvex& b,
00027 const Affinef& a2w, const Affinef& b2w,
00028 Vec3d& pa, Vec3d& pb);
00029
00030
00031 class CDContactAnalysis{
00032 public:
00033
00034
00035
00036 typedef std::vector<CDFace*> Vtxs;
00037 static Vtxs vtxs;
00038 static CDQHPlanes<CDFace> planes;
00039 bool isValid;
00040
00041
00042
00043
00044
00045
00046
00047 CDFace** FindIntersection(CDConvexPair& cp, Affinef* af);
00048
00049
00050
00051 void IntegrateNormal(CDConvexPairWithNormal& cp, Affinef* af);
00052
00053
00054 void CalcNormal(CDConvexPairWithNormal& cp, Affinef* af);
00055
00056 void Draw(CDConvexPair& cp, Affinef afw, SGScene* s);
00057 };
00058
00059 }
00060 #endif