Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IceLSS.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICELSS_H__
13 #define __ICELSS_H__
14 
15  class ICEMATHS_API LSS : public Segment
16  {
17  public:
19  inline_ LSS() {}
21  inline_ LSS(const Segment& seg, float radius) : Segment(seg), mRadius(radius) {}
24 
26 
30  void ComputeOBB(OBB& box);
32 
34 
40  inline_ bool Contains(const Point& pt) const { return SquareDistance(pt) <= mRadius*mRadius; }
42 
44 
50  inline_ bool Contains(const Sphere& sphere)
52  {
53  float d = mRadius - sphere.mRadius;
54  if(d>=0.0f) return SquareDistance(sphere.mCenter) <= d*d;
55  else return false;
56  }
57 
59 
65  inline_ bool Contains(const LSS& lss)
67  {
68  // We check the LSS contains the two spheres at the start and end of the sweep
69  return Contains(Sphere(lss.mP0, lss.mRadius)) && Contains(Sphere(lss.mP0, lss.mRadius));
70  }
71 
72  float mRadius;
73  };
74 
75 #endif // __ICELSS_H__