Wm4Intersector.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef WM4INTERSECTOR_H
00018 #define WM4INTERSECTOR_H
00019
00020 #include "Wm4FoundationLIB.h"
00021 #include "Wm4LinComp.h"
00022 #include "Wm4Vector2.h"
00023 #include "Wm4Vector3.h"
00024
00025 namespace Wm4
00026 {
00027
00028 template <class Real, class TVector>
00029 class WM4_FOUNDATION_ITEM Intersector
00030 {
00031 public:
00032
00033 virtual ~Intersector ();
00034
00035
00036
00037
00038
00039 virtual bool Test ();
00040 virtual bool Find ();
00041
00042
00043
00044
00045
00046 virtual bool Test (Real fTMax, const TVector& rkVelocity0,
00047 const TVector& rkVelocity1);
00048 virtual bool Find (Real fTMax, const TVector& rkVelocity0,
00049 const TVector& rkVelocity1);
00050
00051
00052
00053 Real GetContactTime () const;
00054
00055
00056 enum
00057 {
00058 IT_EMPTY = LinComp<Real>::CT_EMPTY,
00059 IT_POINT = LinComp<Real>::CT_POINT,
00060 IT_SEGMENT = LinComp<Real>::CT_SEGMENT,
00061 IT_RAY = LinComp<Real>::CT_RAY,
00062 IT_LINE = LinComp<Real>::CT_LINE,
00063 IT_POLYGON,
00064 IT_PLANE,
00065 IT_POLYHEDRON,
00066 IT_OTHER
00067 };
00068 int GetIntersectionType () const;
00069
00070 protected:
00071 Intersector ();
00072
00073 Real m_fContactTime;
00074 int m_iIntersectionType;
00075 };
00076
00077 typedef Intersector<float, Vector2<float> > Intersector2f;
00078 typedef Intersector<float, Vector3<float> > Intersector3f;
00079 typedef Intersector<double, Vector2<double> > Intersector2d;
00080 typedef Intersector<double, Vector3<double> > Intersector3d;
00081
00082 }
00083
00084 #endif