mesh_shape_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_MESHSHAPECOLLISIONTRAVERSALNODE_H
39 #define FCL_TRAVERSAL_MESHSHAPECOLLISIONTRAVERSALNODE_H
40 
43 
44 namespace fcl
45 {
46 
47 namespace detail
48 {
49 
51 template <typename BV, typename Shape, typename NarrowPhaseSolver>
53  : public BVHShapeCollisionTraversalNode<BV, Shape>
54 {
55 public:
56 
57  using S = typename BV::S;
58 
60 
62  void leafTesting(int b1, int b2) const;
63 
65  bool canStop() const;
66 
69 
71 
72  const NarrowPhaseSolver* nsolver;
73 };
74 
77 template <typename BV, typename Shape, typename NarrowPhaseSolver>
78 FCL_EXPORT
79 bool initialize(
81  BVHModel<BV>& model1,
83  const Shape& model2,
84  const Transform3<typename BV::S>& tf2,
85  const NarrowPhaseSolver* nsolver,
86  const CollisionRequest<typename BV::S>& request,
88  bool use_refit = false, bool refit_bottomup = false);
89 
90 template <typename BV, typename Shape, typename NarrowPhaseSolver>
91 FCL_EXPORT
93  int b1,
94  int b2,
95  const BVHModel<BV>* model1,
96  const Shape& model2,
97  Vector3<typename BV::S>* vertices,
98  Triangle* tri_indices,
99  const Transform3<typename BV::S>& tf1,
100  const Transform3<typename BV::S>& tf2,
101  const NarrowPhaseSolver* nsolver,
102  bool enable_statistics,
103  typename BV::S cost_density,
104  int& num_leaf_tests,
105  const CollisionRequest<typename BV::S>& request,
107 
109 template <typename Shape, typename NarrowPhaseSolver>
112  OBB<typename Shape::S>, Shape, NarrowPhaseSolver>
113 {
114 public:
116 
117  bool BVTesting(int b1, int b2) const;
118 
119  void leafTesting(int b1, int b2) const;
120 
121 };
122 
125 template <typename Shape, typename NarrowPhaseSolver>
126 FCL_EXPORT
127 bool initialize(
129  const BVHModel<OBB<typename Shape::S>>& model1,
131  const Shape& model2,
133  const NarrowPhaseSolver* nsolver,
136 
137 template <typename Shape, typename NarrowPhaseSolver>
140  RSS<typename Shape::S>, Shape, NarrowPhaseSolver>
141 {
142 public:
144 
145  bool BVTesting(int b1, int b2) const;
146 
147  void leafTesting(int b1, int b2) const;
148 
149 };
150 
153 template <typename Shape, typename NarrowPhaseSolver>
154 FCL_EXPORT
155 bool initialize(
157  const BVHModel<RSS<typename Shape::S>>& model1,
159  const Shape& model2,
161  const NarrowPhaseSolver* nsolver,
164 
165 template <typename Shape, typename NarrowPhaseSolver>
168  kIOS<typename Shape::S>, Shape, NarrowPhaseSolver>
169 {
170 public:
172 
173  bool BVTesting(int b1, int b2) const;
174 
175  void leafTesting(int b1, int b2) const;
176 
177 };
178 
181 template <typename Shape, typename NarrowPhaseSolver>
182 FCL_EXPORT
183 bool initialize(
185  const BVHModel<kIOS<typename Shape::S>>& model1,
187  const Shape& model2,
189  const NarrowPhaseSolver* nsolver,
192 
193 template <typename Shape, typename NarrowPhaseSolver>
196  OBBRSS<typename Shape::S>, Shape, NarrowPhaseSolver>
197 {
198 public:
200 
201  bool BVTesting(int b1, int b2) const;
202 
203  void leafTesting(int b1, int b2) const;
204 
205 };
206 
209 template <typename Shape, typename NarrowPhaseSolver>
210 FCL_EXPORT
211 bool initialize(
213  const BVHModel<OBBRSS<typename Shape::S>>& model1,
215  const Shape& model2,
217  const NarrowPhaseSolver* nsolver,
220 
221 } // namespace detail
222 } // namespace fcl
223 
225 
226 #endif
fcl::detail::MeshShapeCollisionTraversalNodeOBBRSS
Definition: mesh_shape_collision_traversal_node.h:194
fcl::Transform3
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
Definition: types.h:91
utility.h
fcl::kIOS
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:48
fcl::detail::MeshShapeCollisionTraversalNode::cost_density
S cost_density
Definition: mesh_shape_collision_traversal_node.h:70
bvh_shape_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::MeshShapeCollisionTraversalNodeOBB
Traversal node for mesh and shape, when mesh BVH is one of the oriented node (OBB,...
Definition: mesh_shape_collision_traversal_node.h:110
fcl::detail::MeshShapeCollisionTraversalNode::vertices
Vector3< S > * vertices
Definition: mesh_shape_collision_traversal_node.h:67
fcl::OBB
Oriented bounding box class.
Definition: OBB.h:51
fcl::detail::MeshShapeCollisionTraversalNode::nsolver
const NarrowPhaseSolver * nsolver
Definition: mesh_shape_collision_traversal_node.h:72
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::detail::MeshShapeCollisionTraversalNodekIOS
Definition: mesh_shape_collision_traversal_node.h:166
fcl::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: OBBRSS.h:50
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
fcl::detail::meshShapeCollisionOrientedNodeLeafTesting
void meshShapeCollisionOrientedNodeLeafTesting(int b1, int b2, const BVHModel< BV > *model1, const Shape &model2, Vector3< typename BV::S > *vertices, Triangle *tri_indices, const Transform3< typename BV::S > &tf1, const Transform3< typename BV::S > &tf2, const NarrowPhaseSolver *nsolver, bool enable_statistics, typename BV::S cost_density, int &num_leaf_tests, const CollisionRequest< typename BV::S > &request, CollisionResult< typename BV::S > &result)
Definition: mesh_shape_collision_traversal_node-inl.h:192
fcl::detail::BVHShapeCollisionTraversalNode< kIOS< Shape::S >, Shape >::S
typename kIOS< Shape::S > ::S S
Definition: bvh_shape_collision_traversal_node.h:57
fcl::detail::BVHShapeCollisionTraversalNode
Traversal node for collision between BVH and shape.
Definition: bvh_shape_collision_traversal_node.h:52
fcl::detail::MeshShapeCollisionTraversalNodeRSS
Definition: mesh_shape_collision_traversal_node.h:138
fcl::detail::MeshShapeCollisionTraversalNode
Traversal node for collision between mesh and shape.
Definition: mesh_shape_collision_traversal_node.h:52
fcl::detail::MeshShapeCollisionTraversalNode::tri_indices
Triangle * tri_indices
Definition: mesh_shape_collision_traversal_node.h:68
mesh_shape_collision_traversal_node-inl.h
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45


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