IceLSS.h
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 // Include Guard
00012 #ifndef __ICELSS_H__
00013 #define __ICELSS_H__
00014 
00015         class ICEMATHS_API LSS : public Segment
00016         {
00017                 public:
00019                 inline_                 LSS()                                                                                                                                   {}
00021                 inline_                 LSS(const Segment& seg, float radius) : Segment(seg), mRadius(radius)   {}
00023                 inline_                 ~LSS()                                                                                                                                  {}
00024 
00026 
00030 
00031                                 void    ComputeOBB(OBB& box);
00032 
00034 
00040 
00041                 inline_ bool    Contains(const Point& pt)       const   { return SquareDistance(pt) <= mRadius*mRadius; }
00042 
00044 
00050 
00051                 inline_ bool    Contains(const Sphere& sphere)
00052                                                 {
00053                                                         float d = mRadius - sphere.mRadius;
00054                                                         if(d>=0.0f)     return SquareDistance(sphere.mCenter) <= d*d;
00055                                                         else            return false;
00056                                                 }
00057 
00059 
00065 
00066                 inline_ bool    Contains(const LSS& lss)
00067                                                 {
00068                                                         // We check the LSS contains the two spheres at the start and end of the sweep
00069                                                         return Contains(Sphere(lss.mP0, lss.mRadius)) && Contains(Sphere(lss.mP0, lss.mRadius));
00070                                                 }
00071 
00072                                 float   mRadius;        
00073         };
00074 
00075 #endif // __ICELSS_H__


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:54