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__
inline_ LSS(const Segment &seg, float radius)
Constructor.
Definition: IceLSS.h:21
#define inline_
Definition: IcePoint.h:25
#define ICEMATHS_API
Definition: OPC_IceHook.h:51
inline_ LSS()
Constructor.
Definition: IceLSS.h:19
Definition: IceOBB.h:18
float mRadius
Sphere radius.
Point mCenter
Sphere center.
inline_ ~LSS()
Destructor.
Definition: IceLSS.h:23
float mRadius
Sphere radius.
Definition: IceLSS.h:72
float SquareDistance(const Point &point, float *t=null) const
Definition: IceSegment.cpp:29
Point mP0
Start of segment.
Definition: IceSegment.h:51
Definition: jquant2.c:258
Definition: IceLSS.h:15


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:22