Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
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
Coal
coal
Commits
c76bc1e9
Commit
c76bc1e9
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Clean traversal node setup.
parent
4552c512
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/traversal/traversal_node_setup.h
+23
-21
23 additions, 21 deletions
include/hpp/fcl/traversal/traversal_node_setup.h
src/traversal/traversal_node_setup.cpp
+0
-68
0 additions, 68 deletions
src/traversal/traversal_node_setup.cpp
with
23 additions
and
89 deletions
include/hpp/fcl/traversal/traversal_node_setup.h
+
23
−
21
View file @
c76bc1e9
...
...
@@ -548,7 +548,7 @@ bool initialize(ShapeMeshCollisionTraversalNodeOBBRSS<S, NarrowPhaseSolver>& nod
/// @brief Initialize traversal node for collision between two meshes, given the current transforms
template
<
typename
BV
>
bool
initialize
(
MeshCollisionTraversalNode
<
BV
>&
node
,
bool
initialize
(
MeshCollisionTraversalNode
<
BV
,
RelativeTransformationIsIdentity
>&
node
,
BVHModel
<
BV
>&
model1
,
Transform3f
&
tf1
,
BVHModel
<
BV
>&
model2
,
Transform3f
&
tf2
,
CollisionResult
&
result
,
...
...
@@ -607,31 +607,33 @@ bool initialize(MeshCollisionTraversalNode<BV>& node,
return
true
;
}
template
<
typename
BV
>
bool
initialize
(
MeshCollisionTraversalNode
<
BV
,
0
>&
node
,
const
BVHModel
<
BV
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
BV
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
if
(
model1
.
getModelType
()
!=
BVH_MODEL_TRIANGLES
||
model2
.
getModelType
()
!=
BVH_MODEL_TRIANGLES
)
return
false
;
/// @brief Initialize traversal node for collision between two meshes, specialized for OBB type
bool
initialize
(
MeshCollisionTraversalNodeOBB
&
node
,
const
BVHModel
<
OBB
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
OBB
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
);
node
.
vertices1
=
model1
.
vertices
;
node
.
vertices2
=
model2
.
vertices
;
/// @brief Initialize traversal node for collision between two meshes, specialized for RSS type
bool
initialize
(
MeshCollisionTraversalNodeRSS
&
node
,
const
BVHModel
<
RSS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
RSS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
);
node
.
tri_indices1
=
model1
.
tri_indices
;
node
.
tri_indices2
=
model2
.
tri_indices
;
/// @brief Initialize traversal node for collision between two meshes, specialized for OBBRSS type
bool
initialize
(
MeshCollisionTraversalNodeOBBRSS
&
node
,
const
BVHModel
<
OBBRSS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
OBBRSS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
);
node
.
model1
=
&
model1
;
node
.
tf1
=
tf1
;
node
.
model2
=
&
model2
;
node
.
tf2
=
tf2
;
/// @brief Initialize traversal node for collision between two meshes, specialized for kIOS type
bool
initialize
(
MeshCollisionTraversalNodekIOS
&
node
,
const
BVHModel
<
kIOS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
kIOS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
);
node
.
result
=
&
result
;
node
.
RT
.
R
=
tf1
.
getRotation
().
transpose
()
*
tf2
.
getRotation
();
node
.
RT
.
T
=
tf1
.
getRotation
().
transpose
()
*
(
tf2
.
getTranslation
()
-
tf1
.
getTranslation
());
return
true
;
}
/// @brief Initialize traversal node for distance between two geometric shapes
template
<
typename
S1
,
typename
S2
,
typename
NarrowPhaseSolver
>
...
...
This diff is collapsed.
Click to expand it.
src/traversal/traversal_node_setup.cpp
+
0
−
68
View file @
c76bc1e9
...
...
@@ -43,74 +43,6 @@ namespace hpp
namespace
fcl
{
namespace
details
{
template
<
typename
BV
,
typename
OrientedNode
>
static
inline
bool
setupMeshCollisionOrientedNode
(
OrientedNode
&
node
,
const
BVHModel
<
BV
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
BV
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
if
(
model1
.
getModelType
()
!=
BVH_MODEL_TRIANGLES
||
model2
.
getModelType
()
!=
BVH_MODEL_TRIANGLES
)
return
false
;
node
.
vertices1
=
model1
.
vertices
;
node
.
vertices2
=
model2
.
vertices
;
node
.
tri_indices1
=
model1
.
tri_indices
;
node
.
tri_indices2
=
model2
.
tri_indices
;
node
.
model1
=
&
model1
;
node
.
tf1
=
tf1
;
node
.
model2
=
&
model2
;
node
.
tf2
=
tf2
;
node
.
result
=
&
result
;
relativeTransform
(
tf1
.
getRotation
(),
tf1
.
getTranslation
(),
tf2
.
getRotation
(),
tf2
.
getTranslation
(),
node
.
RT
.
R
,
node
.
RT
.
T
);
return
true
;
}
}
bool
initialize
(
MeshCollisionTraversalNodeOBB
&
node
,
const
BVHModel
<
OBB
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
OBB
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
return
details
::
setupMeshCollisionOrientedNode
(
node
,
model1
,
tf1
,
model2
,
tf2
,
result
);
}
bool
initialize
(
MeshCollisionTraversalNodeRSS
&
node
,
const
BVHModel
<
RSS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
RSS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
return
details
::
setupMeshCollisionOrientedNode
(
node
,
model1
,
tf1
,
model2
,
tf2
,
result
);
}
bool
initialize
(
MeshCollisionTraversalNodekIOS
&
node
,
const
BVHModel
<
kIOS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
kIOS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
return
details
::
setupMeshCollisionOrientedNode
(
node
,
model1
,
tf1
,
model2
,
tf2
,
result
);
}
bool
initialize
(
MeshCollisionTraversalNodeOBBRSS
&
node
,
const
BVHModel
<
OBBRSS
>&
model1
,
const
Transform3f
&
tf1
,
const
BVHModel
<
OBBRSS
>&
model2
,
const
Transform3f
&
tf2
,
CollisionResult
&
result
)
{
return
details
::
setupMeshCollisionOrientedNode
(
node
,
model1
,
tf1
,
model2
,
tf2
,
result
);
}
namespace
details
{
template
<
typename
BV
,
typename
OrientedNode
>
...
...
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