Skip to content
Snippets Groups Projects
Commit e68ded92 authored by jpan's avatar jpan
Browse files

git-svn-id: https://kforge.ros.org/fcl/fcl_ros@97 253336fb-580f-4252-a368-f3cef5a2a82b
parent dd7929fd
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,7 @@ static inline Vec3Data<T> cross_prod(const Vec3Data<T>& l, const Vec3Data<T>& r)
}
template <typename T>
static inline T dot_prod(const Vec3Data<T>& l, const Vec3Data<T>& r)
static inline T dot_prod3(const Vec3Data<T>& l, const Vec3Data<T>& r)
{
return l.vs[0] * r.vs[0] + l.vs[1] * r.vs[1] + l.vs[2] * r.vs[2];
}
......
This diff is collapsed.
......@@ -80,10 +80,10 @@ public:
inline Vec3fX& operator /= (U t) { data /= t; return *this; }
inline Vec3fX operator - () { return Vec3fX(-data); }
inline Vec3fX cross(const Vec3fX& other) const { return Vec3fX(details::cross_prod(data, other.data)); }
inline U dot(const Vec3fX& other) const { return details::dot_prod(data, other.data); }
inline U dot(const Vec3fX& other) const { return details::dot_prod3(data, other.data); }
inline bool normalize()
{
U sqr_length = details::dot_prod(data, data);
U sqr_length = details::dot_prod3(data, data);
if(sqr_length > 0)
{
*this /= (U)sqrt(sqr_length);
......@@ -95,15 +95,15 @@ public:
inline Vec3fX normalized() const
{
U sqr_length = details::dot_prod(data, data);
U sqr_length = details::dot_prod3(data, data);
if(sqr_length > 0)
return *this / (U)sqrt(sqr_length);
else
return *this;
}
inline U length() const { return sqrt(details::dot_prod(data, data)); }
inline U sqrLength() const { return details::dot_prod(data, data); }
inline U length() const { return sqrt(details::dot_prod3(data, data)); }
inline U sqrLength() const { return details::dot_prod3(data, data); }
inline void setValue(U x, U y, U z) { data.setValue(x, y, z); }
inline void setValue(U x) { data.setValue(x); }
inline bool equal(const Vec3fX& other, U epsilon = std::numeric_limits<U>::epsilon() * 100) const { return details::equal(data, other.data, epsilon); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment