Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00037 #ifndef FCL_RSS_H
00038 #define FCL_RSS_H
00039
00040
00041 #include "fcl/math/vec_3f.h"
00042 #include "fcl/math/matrix_3f.h"
00043 #include <boost/math/constants/constants.hpp>
00044
00045 namespace fcl
00046 {
00047
00049 class RSS
00050 {
00051 public:
00054 Vec3f axis[3];
00055
00057 Vec3f Tr;
00058
00060 FCL_REAL l[2];
00061
00063 FCL_REAL r;
00064
00066 bool overlap(const RSS& other) const;
00067
00070 bool overlap(const RSS& other, RSS& overlap_part) const
00071 {
00072 return overlap(other);
00073 }
00074
00076 inline bool contain(const Vec3f& p) const;
00077
00080 RSS& operator += (const Vec3f& p);
00081
00083 inline RSS& operator += (const RSS& other)
00084 {
00085 *this = *this + other;
00086 return *this;
00087 }
00088
00090 RSS operator + (const RSS& other) const;
00091
00093 inline FCL_REAL width() const
00094 {
00095 return l[0] + 2 * r;
00096 }
00097
00099 inline FCL_REAL height() const
00100 {
00101 return l[1] + 2 * r;
00102 }
00103
00105 inline FCL_REAL depth() const
00106 {
00107 return 2 * r;
00108 }
00109
00111 inline FCL_REAL volume() const
00112 {
00113 return (l[0] * l[1] * 2 * r + 4 * boost::math::constants::pi<FCL_REAL>() * r * r * r);
00114 }
00115
00117 inline FCL_REAL size() const
00118 {
00119 return (std::sqrt(l[0] * l[0] + l[1] * l[1]) + 2 * r);
00120 }
00121
00123 inline const Vec3f& center() const
00124 {
00125 return Tr;
00126 }
00127
00129 FCL_REAL distance(const RSS& other, Vec3f* P = NULL, Vec3f* Q = NULL) const;
00130
00131 };
00132
00133
00135 RSS translate(const RSS& bv, const Vec3f& t);
00136
00140 FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2, Vec3f* P = NULL, Vec3f* Q = NULL);
00141
00142
00144 bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2);
00145
00146
00147 }
00148
00149
00150 #endif