Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-fcl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
hpp-fcl
Commits
177fb1fa
Commit
177fb1fa
authored
9 years ago
by
Steve Tonneau
Browse files
Options
Downloads
Patches
Plain Diff
reordering collision results between shapes and meshes
parent
fdd6d8df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/hpp/fcl/collision_data.h
+4
-0
4 additions, 0 deletions
include/hpp/fcl/collision_data.h
src/collision.cpp
+20
-0
20 additions, 0 deletions
src/collision.cpp
with
24 additions
and
0 deletions
include/hpp/fcl/collision_data.h
+
4
−
0
View file @
177fb1fa
...
...
@@ -309,6 +309,10 @@ public:
contacts
.
clear
();
cost_sources
.
clear
();
}
/// @brief reposition Contact objects when fcl inverts them
/// during their construction.
friend
void
invertResults
(
CollisionResult
&
result
);
};
...
...
This diff is collapsed.
Click to expand it.
src/collision.cpp
+
20
−
0
View file @
177fb1fa
...
...
@@ -62,6 +62,23 @@ std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
nsolver
,
request
,
result
);
}
// reorder collision results in the order the call has been made.
void
invertResults
(
CollisionResult
&
result
)
{
const
CollisionGeometry
*
otmp
;
int
btmp
;
for
(
std
::
vector
<
Contact
>::
iterator
it
=
result
.
contacts
.
begin
();
it
!=
result
.
contacts
.
end
();
++
it
)
{
otmp
=
it
->
o1
;
it
->
o1
=
it
->
o2
;
it
->
o2
=
otmp
;
btmp
=
it
->
b1
;
it
->
b1
=
it
->
b2
;
it
->
b2
=
btmp
;
}
}
template
<
typename
NarrowPhaseSolver
>
std
::
size_t
collide
(
const
CollisionGeometry
*
o1
,
const
Transform3f
&
tf1
,
const
CollisionGeometry
*
o2
,
const
Transform3f
&
tf2
,
...
...
@@ -96,7 +113,10 @@ std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1,
res
=
0
;
}
else
{
res
=
looktable
.
collision_matrix
[
node_type2
][
node_type1
](
o2
,
tf2
,
o1
,
tf1
,
nsolver
,
request
,
result
);
invertResults
(
result
);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment