shape_mesh_collision_traversal_node.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011-2014, Willow Garage, Inc.
5  * Copyright (c) 2014-2016, Open Source Robotics Foundation
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Open Source Robotics Foundation nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
38 #ifndef FCL_TRAVERSAL_SHAPEMESHCOLLISIONTRAVERSALNODE_H
39 #define FCL_TRAVERSAL_SHAPEMESHCOLLISIONTRAVERSALNODE_H
40 
43 
44 namespace fcl
45 {
46 
47 namespace detail
48 {
49 
51 template <typename Shape, typename BV, typename NarrowPhaseSolver>
53  : public ShapeBVHCollisionTraversalNode<Shape, BV>
54 {
55 public:
56  using S = typename BV::S;
57 
59 
61  void leafTesting(int b1, int b2) const;
62 
64  bool canStop() const;
65 
68 
70 
71  const NarrowPhaseSolver* nsolver;
72 };
73 
76 template <typename Shape, typename BV, typename NarrowPhaseSolver>
77 FCL_EXPORT
78 bool initialize(
80  const Shape& model1,
81  const Transform3<typename BV::S>& tf1,
82  BVHModel<BV>& model2,
84  const NarrowPhaseSolver* nsolver,
85  const CollisionRequest<typename BV::S>& request,
87  bool use_refit = false, bool refit_bottomup = false);
88 
90 template <typename Shape, typename NarrowPhaseSolver>
93  Shape, OBB<typename Shape::S>, NarrowPhaseSolver>
94 {
95 public:
97 
98  bool BVTesting(int b1, int b2) const;
99 
100  void leafTesting(int b1, int b2) const;
101 };
102 
105 template <typename Shape, typename NarrowPhaseSolver>
106 FCL_EXPORT
107 bool initialize(
109  const Shape& model1,
111  const BVHModel<OBB<typename Shape::S>>& model2,
113  const NarrowPhaseSolver* nsolver,
116 
117 template <typename Shape, typename NarrowPhaseSolver>
119  : public ShapeMeshCollisionTraversalNode<Shape, RSS<typename Shape::S>, NarrowPhaseSolver>
120 {
121 public:
123 
124  bool BVTesting(int b1, int b2) const;
125 
126  void leafTesting(int b1, int b2) const;
127 
128 };
129 
132 template <typename Shape, typename NarrowPhaseSolver>
133 FCL_EXPORT
134 bool initialize(
136  const Shape& model1,
138  const BVHModel<RSS<typename Shape::S>>& model2,
140  const NarrowPhaseSolver* nsolver,
143 
144 template <typename Shape, typename NarrowPhaseSolver>
146  : public ShapeMeshCollisionTraversalNode<Shape, kIOS<typename Shape::S>, NarrowPhaseSolver>
147 {
148 public:
150 
151  bool BVTesting(int b1, int b2) const;
152 
153  void leafTesting(int b1, int b2) const;
154 
155 };
156 
159 template <typename Shape, typename NarrowPhaseSolver>
160 FCL_EXPORT
161 bool initialize(
163  const Shape& model1,
165  const BVHModel<kIOS<typename Shape::S>>& model2,
167  const NarrowPhaseSolver* nsolver,
170 
171 template <typename Shape, typename NarrowPhaseSolver>
173  : public ShapeMeshCollisionTraversalNode<Shape, OBBRSS<typename Shape::S>, NarrowPhaseSolver>
174 {
175 public:
177 
178  bool BVTesting(int b1, int b2) const;
179 
180  void leafTesting(int b1, int b2) const;
181 
182 };
183 
186 template <typename Shape, typename NarrowPhaseSolver>
187 FCL_EXPORT
188 bool initialize(
190  const Shape& model1,
192  const BVHModel<OBBRSS<typename Shape::S>>& model2,
194  const NarrowPhaseSolver* nsolver,
197 
198 } // namespace detail
199 } // namespace fcl
200 
202 
203 #endif
fcl::Transform3
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
Definition: types.h:91
fcl::detail::ShapeMeshCollisionTraversalNodekIOS
Definition: shape_mesh_collision_traversal_node.h:145
fcl::detail::ShapeMeshCollisionTraversalNodeOBB
Traversal node for shape and mesh, when mesh BVH is one of the oriented node (OBB,...
Definition: shape_mesh_collision_traversal_node.h:91
fcl::detail::ShapeMeshCollisionTraversalNode::nsolver
const NarrowPhaseSolver * nsolver
Definition: shape_mesh_collision_traversal_node.h:71
utility.h
fcl::kIOS
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:48
fcl::detail::ShapeMeshCollisionTraversalNodeOBBRSS
Definition: shape_mesh_collision_traversal_node.h:172
shape_bvh_collision_traversal_node.h
fcl::CollisionResult
collision result
Definition: collision_request.h:48
fcl::RSS
A class for rectangle swept sphere bounding volume.
Definition: RSS.h:58
fcl::Triangle
Triangle with 3 indices for points.
Definition: triangle.h:48
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
fcl::detail::ShapeMeshCollisionTraversalNodeRSS
Definition: shape_mesh_collision_traversal_node.h:118
fcl::OBB
Oriented bounding box class.
Definition: OBB.h:51
fcl::detail::ShapeMeshCollisionTraversalNode::vertices
Vector3< S > * vertices
Definition: shape_mesh_collision_traversal_node.h:66
fcl::detail::ShapeMeshCollisionTraversalNode
Traversal node for collision between shape and mesh.
Definition: shape_mesh_collision_traversal_node.h:52
fcl::CollisionRequest
Parameters for performing collision request.
Definition: collision_request.h:52
fcl::detail::initialize
template bool initialize(MeshCollisionTraversalNodeOBB< double > &node, const BVHModel< OBB< double >> &model1, const Transform3< double > &tf1, const BVHModel< OBB< double >> &model2, const Transform3< double > &tf2, const CollisionRequest< double > &request, CollisionResult< double > &result)
fcl::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: OBBRSS.h:50
fcl::detail::ShapeMeshCollisionTraversalNode::tri_indices
Triangle * tri_indices
Definition: shape_mesh_collision_traversal_node.h:67
fcl::BVHModel
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Definition: BVH_model.h:57
shape_mesh_collision_traversal_node-inl.h
fcl::detail::ShapeBVHCollisionTraversalNode
Traversal node for collision between shape and BVH.
Definition: shape_bvh_collision_traversal_node.h:52
fcl::detail::ShapeMeshCollisionTraversalNode::cost_density
S cost_density
Definition: shape_mesh_collision_traversal_node.h:69
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
fcl::detail::ShapeBVHCollisionTraversalNode< Shape, kIOS< Shape::S > >::S
typename kIOS< Shape::S > ::S S
Definition: shape_bvh_collision_traversal_node.h:57


fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:48