Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
c3aee6fb
Commit
c3aee6fb
authored
Feb 15, 2016
by
Valenza Florian
Browse files
Provide operator == in CollisionResult, CostSource and Contact
parent
6101e6cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/collision_data.h
View file @
c3aee6fb
...
...
@@ -119,6 +119,17 @@ struct Contact
return
b2
<
other
.
b2
;
return
b1
<
other
.
b1
;
}
bool
operator
==
(
const
Contact
&
other
)
const
{
return
o1
==
other
.
o1
&&
o2
==
other
.
o2
&&
b1
==
other
.
b1
&&
b2
==
other
.
b2
&&
normal
==
other
.
normal
&&
pos
==
other
.
pos
&&
penetration_depth
==
other
.
penetration_depth
;
}
};
/// @brief Cost source describes an area with a cost. The area is described by an AABB region.
...
...
@@ -169,6 +180,14 @@ struct CostSource
return
false
;
}
bool
operator
==
(
const
CostSource
&
other
)
const
{
return
aabb_min
==
other
.
aabb_min
&&
aabb_max
==
other
.
aabb_max
&&
cost_density
==
other
.
cost_density
&&
total_cost
==
other
.
total_cost
;
}
};
struct
CollisionResult
;
...
...
@@ -262,6 +281,14 @@ public:
cost_sources
.
erase
(
--
cost_sources
.
end
());
}
/// @brief whether two CollisionResult are the same or not
inline
bool
operator
==
(
const
CollisionResult
&
other
)
const
{
return
contacts
==
other
.
contacts
&&
cost_sources
==
other
.
cost_sources
&&
distance_lower_bound
==
other
.
distance_lower_bound
;
}
/// @brief return binary collision result
bool
isCollision
()
const
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment