box_box.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_NARROWPHASE_DETAIL_BOXBOX_H
39 #define FCL_NARROWPHASE_DETAIL_BOXBOX_H
40 
41 #include "fcl/common/types.h"
43 #include "fcl/geometry/shape/box.h"
44 
45 namespace fcl
46 {
47 
48 namespace detail
49 {
50 
51 template <typename S>
52 FCL_EXPORT
53 void lineClosestApproach(const Vector3<S>& pa, const Vector3<S>& ua,
54  const Vector3<S>& pb, const Vector3<S>& ub,
55  S* alpha, S* beta);
56 
57 // find all the intersection points between the 2D rectangle with vertices
58 // at (+/-h[0],+/-h[1]) and the 2D quadrilateral with vertices (p[0],p[1]),
59 // (p[2],p[3]),(p[4],p[5]),(p[6],p[7]).
60 //
61 // the intersection points are returned as x,y pairs in the 'ret' array.
62 // the number of intersection points is returned by the function (this will
63 // be in the range 0 to 8).
64 template <typename S>
65 FCL_EXPORT
66 int intersectRectQuad2(S h[2], S p[8], S ret[16]);
67 
68 // given n points in the plane (array p, of size 2*n), generate m points that
69 // best represent the whole set. the definition of 'best' here is not
70 // predetermined - the idea is to select points that give good box-box
71 // collision detection behavior. the chosen point indexes are returned in the
72 // array iret (of size m). 'i0' is always the first entry in the array.
73 // n must be in the range [1..8]. m must be in the range [1..n]. i0 must be
74 // in the range [0..n-1].
75 template <typename S>
76 FCL_EXPORT
77 void cullPoints2(int n, S p[], int m, int i0, int iret[]);
78 
79 template <typename S, typename DerivedA, typename DerivedB>
80 FCL_EXPORT
81 int boxBox2(
82  const Vector3<S>& side1,
83  const Eigen::MatrixBase<DerivedA>& R1,
84  const Eigen::MatrixBase<DerivedB>& T1,
85  const Vector3<S>& side2,
86  const Eigen::MatrixBase<DerivedA>& R2,
87  const Eigen::MatrixBase<DerivedB>& T2,
88  Vector3<S>& normal,
89  S* depth,
90  int* return_code,
91  int maxc,
92  std::vector<ContactPoint<S>>& contacts);
93 
94 template <typename S>
95 FCL_EXPORT
96 int boxBox2(
97  const Vector3<S>& side1,
98  const Transform3<S>& tf1,
99  const Vector3<S>& side2,
100  const Transform3<S>& tf2,
101  Vector3<S>& normal,
102  S* depth,
103  int* return_code,
104  int maxc,
105  std::vector<ContactPoint<S>>& contacts);
106 
107 template <typename S>
108 FCL_EXPORT
109 bool boxBoxIntersect(const Box<S>& s1, const Transform3<S>& tf1,
110  const Box<S>& s2, const Transform3<S>& tf2,
111  std::vector<ContactPoint<S>>* contacts_);
112 
113 } // namespace detail
114 } // namespace fcl
115 
117 
118 #endif
box_box-inl.h
types.h
fcl::detail::boxBoxIntersect
template bool boxBoxIntersect(const Box< double > &s1, const Transform3< double > &tf1, const Box< double > &s2, const Transform3< double > &tf2, std::vector< ContactPoint< double >> *contacts_)
fcl::detail::intersectRectQuad2
template int intersectRectQuad2(double h[2], double p[8], double ret[16])
fcl::detail::boxBox2
template int boxBox2(const Vector3< double > &side1, const Transform3< double > &tf1, const Vector3< double > &side2, const Transform3< double > &tf2, Vector3< double > &normal, double *depth, int *return_code, int maxc, std::vector< ContactPoint< double >> &contacts)
box.h
contact_point.h
fcl::detail::cullPoints2
template void cullPoints2(int n, double p[], int m, int i0, int iret[])
fcl::detail::lineClosestApproach
template void lineClosestApproach(const Vector3< double > &pa, const Vector3< double > &ua, const Vector3< double > &pb, const Vector3< double > &ub, double *alpha, double *beta)
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45


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