Directory: | ./ |
---|---|
File: | test/frontlist.cpp |
Date: | 2025-04-01 09:23:31 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 192 | 194 | 99.0% |
Branches: | 358 | 702 | 51.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Software License Agreement (BSD License) | ||
3 | * | ||
4 | * Copyright (c) 2011-2014, Willow Garage, Inc. | ||
5 | * Copyright (c) 2014-2015, 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 | |||
36 | /** \author Jia Pan */ | ||
37 | |||
38 | #define BOOST_TEST_MODULE COAL_FRONT_LIST | ||
39 | #include <boost/test/included/unit_test.hpp> | ||
40 | |||
41 | #include "coal/internal/traversal_node_bvhs.h" | ||
42 | #include "coal/internal/traversal_node_setup.h" | ||
43 | #include <../src/collision_node.h> | ||
44 | #include "coal/internal/BV_splitter.h" | ||
45 | #include "utility.h" | ||
46 | |||
47 | #include "fcl_resources/config.h" | ||
48 | #include <boost/filesystem.hpp> | ||
49 | |||
50 | using namespace coal; | ||
51 | namespace utf = boost::unit_test::framework; | ||
52 | |||
53 | template <typename BV> | ||
54 | bool collide_front_list_Test(const Transform3s& tf1, const Transform3s& tf2, | ||
55 | const std::vector<Vec3s>& vertices1, | ||
56 | const std::vector<Triangle>& triangles1, | ||
57 | const std::vector<Vec3s>& vertices2, | ||
58 | const std::vector<Triangle>& triangles2, | ||
59 | SplitMethodType split_method, bool refit_bottomup, | ||
60 | bool verbose); | ||
61 | |||
62 | template <typename BV, typename TraversalNode> | ||
63 | bool collide_front_list_Test_Oriented(const Transform3s& tf1, | ||
64 | const Transform3s& tf2, | ||
65 | const std::vector<Vec3s>& vertices1, | ||
66 | const std::vector<Triangle>& triangles1, | ||
67 | const std::vector<Vec3s>& vertices2, | ||
68 | const std::vector<Triangle>& triangles2, | ||
69 | SplitMethodType split_method, | ||
70 | bool verbose); | ||
71 | |||
72 | template <typename BV> | ||
73 | bool collide_Test(const Transform3s& tf, const std::vector<Vec3s>& vertices1, | ||
74 | const std::vector<Triangle>& triangles1, | ||
75 | const std::vector<Vec3s>& vertices2, | ||
76 | const std::vector<Triangle>& triangles2, | ||
77 | SplitMethodType split_method, bool verbose); | ||
78 | |||
79 | // TODO: randomly still have some runtime error | ||
80 |
33/66✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 41 taken 1 times.
✗ Branch 42 not taken.
✓ Branch 45 taken 1 times.
✗ Branch 46 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 66 taken 1 times.
✗ Branch 67 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 77 taken 1 times.
✗ Branch 78 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 91 taken 1 times.
✗ Branch 92 not taken.
✓ Branch 95 taken 1 times.
✗ Branch 96 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 102 taken 1 times.
✗ Branch 103 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
|
4 | BOOST_AUTO_TEST_CASE(front_list) { |
81 | 2 | std::vector<Vec3s> p1, p2; | |
82 | 2 | std::vector<Triangle> t1, t2; | |
83 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | boost::filesystem::path path(TEST_RESOURCES_DIR); |
84 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
|
2 | loadOBJFile((path / "env.obj").string().c_str(), p1, t1); |
85 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
|
2 | loadOBJFile((path / "rob.obj").string().c_str(), p2, t2); |
86 | |||
87 | 2 | std::vector<Transform3s> transforms; // t0 | |
88 | 2 | std::vector<Transform3s> transforms2; // t1 | |
89 | 2 | Scalar extents[] = {-3000, -3000, 0, 3000, 3000, 3000}; | |
90 | 2 | Scalar delta_trans[] = {1, 1, 1}; | |
91 | #ifndef NDEBUG // if debug mode | ||
92 | 2 | std::size_t n = 2; | |
93 | #else | ||
94 | std::size_t n = 20; | ||
95 | #endif | ||
96 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | n = getNbRun(utf::master_test_suite().argc, utf::master_test_suite().argv, n); |
97 | 2 | bool verbose = false; | |
98 | |||
99 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | generateRandomTransforms(extents, delta_trans, Scalar(0.005 * 2 * 3.1415), |
100 | transforms, transforms2, n); | ||
101 | |||
102 | bool res, res2; | ||
103 | |||
104 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
105 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<AABB>(transforms2[i], p1, t1, p2, t2, |
106 | SPLIT_METHOD_MEDIAN, verbose); | ||
107 | res2 = | ||
108 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | collide_front_list_Test<AABB>(transforms[i], transforms2[i], p1, t1, p2, |
109 | t2, SPLIT_METHOD_MEDIAN, false, verbose); | ||
110 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
111 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<AABB>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, |
112 | verbose); | ||
113 | res2 = | ||
114 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | collide_front_list_Test<AABB>(transforms[i], transforms2[i], p1, t1, p2, |
115 | t2, SPLIT_METHOD_MEAN, false, verbose); | ||
116 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
117 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<AABB>(transforms2[i], p1, t1, p2, t2, |
118 | SPLIT_METHOD_BV_CENTER, verbose); | ||
119 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<AABB>(transforms[i], transforms2[i], p1, t1, |
120 | p2, t2, SPLIT_METHOD_BV_CENTER, false, | ||
121 | verbose); | ||
122 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
123 | } | ||
124 | |||
125 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
126 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, |
127 | verbose); | ||
128 | res2 = | ||
129 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | collide_front_list_Test<OBB>(transforms[i], transforms2[i], p1, t1, p2, |
130 | t2, SPLIT_METHOD_MEDIAN, false, verbose); | ||
131 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
132 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, |
133 | verbose); | ||
134 | res2 = | ||
135 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | collide_front_list_Test<OBB>(transforms[i], transforms2[i], p1, t1, p2, |
136 | t2, SPLIT_METHOD_MEAN, false, verbose); | ||
137 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
138 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, |
139 | SPLIT_METHOD_BV_CENTER, verbose); | ||
140 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<OBB>(transforms[i], transforms2[i], p1, t1, |
141 | p2, t2, SPLIT_METHOD_BV_CENTER, false, | ||
142 | verbose); | ||
143 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
144 | } | ||
145 | |||
146 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
147 | // Disabled broken test lines. Please see #25. | ||
148 | // res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, | ||
149 | // SPLIT_METHOD_MEDIAN, verbose); res2 = | ||
150 | // collide_front_list_Test<RSS>(transforms[i], transforms2[i], p1, t1, p2, | ||
151 | // t2, SPLIT_METHOD_MEDIAN, false, verbose); BOOST_CHECK(res == res2); | ||
152 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, |
153 | verbose); | ||
154 | res2 = | ||
155 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | collide_front_list_Test<RSS>(transforms[i], transforms2[i], p1, t1, p2, |
156 | t2, SPLIT_METHOD_MEAN, false, verbose); | ||
157 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
158 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, |
159 | SPLIT_METHOD_BV_CENTER, verbose); | ||
160 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<RSS>(transforms[i], transforms2[i], p1, t1, |
161 | p2, t2, SPLIT_METHOD_BV_CENTER, false, | ||
162 | verbose); | ||
163 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
164 | } | ||
165 | |||
166 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
167 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<16> >(transforms2[i], p1, t1, p2, t2, |
168 | SPLIT_METHOD_MEDIAN, verbose); | ||
169 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<16> >(transforms[i], transforms2[i], p1, |
170 | t1, p2, t2, SPLIT_METHOD_MEDIAN, | ||
171 | false, verbose); | ||
172 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
173 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<16> >(transforms2[i], p1, t1, p2, t2, |
174 | SPLIT_METHOD_MEAN, verbose); | ||
175 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<16> >(transforms[i], transforms2[i], p1, |
176 | t1, p2, t2, SPLIT_METHOD_MEAN, | ||
177 | false, verbose); | ||
178 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
179 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<16> >(transforms2[i], p1, t1, p2, t2, |
180 | SPLIT_METHOD_BV_CENTER, verbose); | ||
181 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<16> >( |
182 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, | |
183 | false, verbose); | ||
184 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
185 | } | ||
186 | |||
187 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
188 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<18> >(transforms2[i], p1, t1, p2, t2, |
189 | SPLIT_METHOD_MEDIAN, verbose); | ||
190 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<18> >(transforms[i], transforms2[i], p1, |
191 | t1, p2, t2, SPLIT_METHOD_MEDIAN, | ||
192 | false, verbose); | ||
193 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
194 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<18> >(transforms2[i], p1, t1, p2, t2, |
195 | SPLIT_METHOD_MEAN, verbose); | ||
196 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<18> >(transforms[i], transforms2[i], p1, |
197 | t1, p2, t2, SPLIT_METHOD_MEAN, | ||
198 | false, verbose); | ||
199 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
200 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<18> >(transforms2[i], p1, t1, p2, t2, |
201 | SPLIT_METHOD_BV_CENTER, verbose); | ||
202 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<18> >( |
203 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, | |
204 | false, verbose); | ||
205 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
206 | } | ||
207 | |||
208 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
209 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<24> >(transforms2[i], p1, t1, p2, t2, |
210 | SPLIT_METHOD_MEDIAN, verbose); | ||
211 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<24> >(transforms[i], transforms2[i], p1, |
212 | t1, p2, t2, SPLIT_METHOD_MEDIAN, | ||
213 | false, verbose); | ||
214 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
215 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<24> >(transforms2[i], p1, t1, p2, t2, |
216 | SPLIT_METHOD_MEAN, verbose); | ||
217 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<24> >(transforms[i], transforms2[i], p1, |
218 | t1, p2, t2, SPLIT_METHOD_MEAN, | ||
219 | false, verbose); | ||
220 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
221 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<KDOP<24> >(transforms2[i], p1, t1, p2, t2, |
222 | SPLIT_METHOD_BV_CENTER, verbose); | ||
223 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test<KDOP<24> >( |
224 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, | |
225 | false, verbose); | ||
226 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
227 | } | ||
228 | |||
229 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
230 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, |
231 | verbose); | ||
232 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<RSS, MeshCollisionTraversalNodeRSS>( |
233 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, | |
234 | verbose); | ||
235 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
236 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, |
237 | verbose); | ||
238 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<RSS, MeshCollisionTraversalNodeRSS>( |
239 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, | |
240 | verbose); | ||
241 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
242 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<RSS>(transforms2[i], p1, t1, p2, t2, |
243 | SPLIT_METHOD_BV_CENTER, verbose); | ||
244 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<RSS, MeshCollisionTraversalNodeRSS>( |
245 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, | |
246 | verbose); | ||
247 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
248 | } | ||
249 | |||
250 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
|
6 | for (std::size_t i = 0; i < transforms.size(); ++i) { |
251 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, |
252 | verbose); | ||
253 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<OBB, MeshCollisionTraversalNodeOBB>( |
254 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEDIAN, | |
255 | verbose); | ||
256 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
257 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, |
258 | verbose); | ||
259 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<OBB, MeshCollisionTraversalNodeOBB>( |
260 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_MEAN, | |
261 | verbose); | ||
262 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
263 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | res = collide_Test<OBB>(transforms2[i], p1, t1, p2, t2, |
264 | SPLIT_METHOD_BV_CENTER, verbose); | ||
265 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | res2 = collide_front_list_Test_Oriented<OBB, MeshCollisionTraversalNodeOBB>( |
266 | 4 | transforms[i], transforms2[i], p1, t1, p2, t2, SPLIT_METHOD_BV_CENTER, | |
267 | verbose); | ||
268 |
6/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 2 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
4 | BOOST_CHECK(res == res2); |
269 | } | ||
270 | 2 | } | |
271 | |||
272 | template <typename BV> | ||
273 | 68 | bool collide_front_list_Test(const Transform3s& tf1, const Transform3s& tf2, | |
274 | const std::vector<Vec3s>& vertices1, | ||
275 | const std::vector<Triangle>& triangles1, | ||
276 | const std::vector<Vec3s>& vertices2, | ||
277 | const std::vector<Triangle>& triangles2, | ||
278 | SplitMethodType split_method, bool refit_bottomup, | ||
279 | bool verbose) { | ||
280 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | BVHModel<BV> m1; |
281 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | BVHModel<BV> m2; |
282 |
3/6✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 34 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 34 times.
✗ Branch 8 not taken.
|
68 | m1.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
283 |
3/6✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 34 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 34 times.
✗ Branch 8 not taken.
|
68 | m2.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
284 | |||
285 | 68 | BVHFrontList front_list; | |
286 | |||
287 |
1/2✓ Branch 3 taken 34 times.
✗ Branch 4 not taken.
|
68 | std::vector<Vec3s> vertices1_new(vertices1.size()); |
288 |
2/2✓ Branch 1 taken 222360 times.
✓ Branch 2 taken 34 times.
|
444788 | for (std::size_t i = 0; i < vertices1_new.size(); ++i) { |
289 |
1/2✓ Branch 2 taken 222360 times.
✗ Branch 3 not taken.
|
444720 | vertices1_new[i] = tf1.transform(vertices1[i]); |
290 | } | ||
291 | |||
292 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.beginModel(); |
293 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.addSubModel(vertices1_new, triangles1); |
294 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.endModel(); |
295 | |||
296 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.beginModel(); |
297 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.addSubModel(vertices2, triangles2); |
298 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.endModel(); |
299 | |||
300 |
2/4✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 34 times.
✗ Branch 5 not taken.
|
68 | Transform3s pose1, pose2; |
301 | |||
302 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | CollisionResult local_result; |
303 |
1/2✓ Branch 2 taken 34 times.
✗ Branch 3 not taken.
|
68 | CollisionRequest request(NO_REQUEST, (std::numeric_limits<int>::max)()); |
304 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | MeshCollisionTraversalNode<BV> node(request); |
305 | |||
306 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | bool success = initialize<BV>(node, m1, pose1, m2, pose2, local_result); |
307 |
6/12✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 34 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 34 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 34 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 34 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 34 times.
|
68 | BOOST_REQUIRE(success); |
308 | |||
309 | 68 | node.enable_statistics = verbose; | |
310 | |||
311 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | collide(&node, request, local_result, &front_list); |
312 | |||
313 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 34 times.
|
68 | if (verbose) |
314 | ✗ | std::cout << "front list size " << front_list.size() << std::endl; | |
315 | |||
316 | // update the mesh | ||
317 |
2/2✓ Branch 1 taken 222360 times.
✓ Branch 2 taken 34 times.
|
444788 | for (std::size_t i = 0; i < vertices1.size(); ++i) { |
318 |
1/2✓ Branch 2 taken 222360 times.
✗ Branch 3 not taken.
|
444720 | vertices1_new[i] = tf2.transform(vertices1[i]); |
319 | } | ||
320 | |||
321 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.beginReplaceModel(); |
322 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.replaceSubModel(vertices1_new); |
323 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m1.endReplaceModel(true, refit_bottomup); |
324 | |||
325 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.beginReplaceModel(); |
326 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.replaceSubModel(vertices2); |
327 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | m2.endReplaceModel(true, refit_bottomup); |
328 | |||
329 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | local_result.clear(); |
330 |
1/2✓ Branch 1 taken 34 times.
✗ Branch 2 not taken.
|
68 | collide(&node, request, local_result, &front_list); |
331 | |||
332 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 2 taken 17 times.
|
68 | if (local_result.numContacts() > 0) |
333 | 34 | return true; | |
334 | else | ||
335 | 34 | return false; | |
336 | 68 | } | |
337 | |||
338 | template <typename BV, typename TraversalNode> | ||
339 | 24 | bool collide_front_list_Test_Oriented(const Transform3s& tf1, | |
340 | const Transform3s& tf2, | ||
341 | const std::vector<Vec3s>& vertices1, | ||
342 | const std::vector<Triangle>& triangles1, | ||
343 | const std::vector<Vec3s>& vertices2, | ||
344 | const std::vector<Triangle>& triangles2, | ||
345 | SplitMethodType split_method, | ||
346 | bool verbose) { | ||
347 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | BVHModel<BV> m1; |
348 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | BVHModel<BV> m2; |
349 |
3/6✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✗ Branch 8 not taken.
|
24 | m1.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
350 |
3/6✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✗ Branch 8 not taken.
|
24 | m2.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
351 | |||
352 | 24 | BVHFrontList front_list; | |
353 | |||
354 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m1.beginModel(); |
355 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m1.addSubModel(vertices1, triangles1); |
356 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m1.endModel(); |
357 | |||
358 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m2.beginModel(); |
359 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m2.addSubModel(vertices2, triangles2); |
360 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | m2.endModel(); |
361 | |||
362 |
2/4✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
|
24 | Transform3s pose1(tf1), pose2; |
363 | |||
364 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | CollisionResult local_result; |
365 |
1/2✓ Branch 2 taken 12 times.
✗ Branch 3 not taken.
|
24 | CollisionRequest request(NO_REQUEST, (std::numeric_limits<int>::max)()); |
366 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | TraversalNode node(request); |
367 | |||
368 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | bool success = initialize(node, (const BVHModel<BV>&)m1, pose1, |
369 | (const BVHModel<BV>&)m2, pose2, local_result); | ||
370 |
6/12✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 12 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 12 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 12 times.
|
24 | BOOST_REQUIRE(success); |
371 | |||
372 | 24 | node.enable_statistics = verbose; | |
373 | |||
374 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | collide(&node, request, local_result, &front_list); |
375 | |||
376 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (verbose) |
377 | ✗ | std::cout << "front list size " << front_list.size() << std::endl; | |
378 | |||
379 | // update the mesh | ||
380 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | pose1 = tf2; |
381 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | success = initialize(node, (const BVHModel<BV>&)m1, pose1, |
382 | (const BVHModel<BV>&)m2, pose2, local_result); | ||
383 |
6/12✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 12 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 12 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 12 times.
|
24 | BOOST_REQUIRE(success); |
384 | |||
385 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | local_result.clear(); |
386 |
1/2✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
|
24 | collide(&node, request, local_result, &front_list); |
387 | |||
388 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 2 taken 6 times.
|
24 | if (local_result.numContacts() > 0) |
389 | 12 | return true; | |
390 | else | ||
391 | 12 | return false; | |
392 | 24 | } | |
393 | |||
394 | template <typename BV> | ||
395 | 92 | bool collide_Test(const Transform3s& tf, const std::vector<Vec3s>& vertices1, | |
396 | const std::vector<Triangle>& triangles1, | ||
397 | const std::vector<Vec3s>& vertices2, | ||
398 | const std::vector<Triangle>& triangles2, | ||
399 | SplitMethodType split_method, bool verbose) { | ||
400 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | BVHModel<BV> m1; |
401 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | BVHModel<BV> m2; |
402 |
3/6✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 46 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 46 times.
✗ Branch 8 not taken.
|
92 | m1.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
403 |
3/6✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 46 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 46 times.
✗ Branch 8 not taken.
|
92 | m2.bv_splitter.reset(new BVSplitter<BV>(split_method)); |
404 | |||
405 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m1.beginModel(); |
406 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m1.addSubModel(vertices1, triangles1); |
407 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m1.endModel(); |
408 | |||
409 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m2.beginModel(); |
410 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m2.addSubModel(vertices2, triangles2); |
411 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | m2.endModel(); |
412 | |||
413 |
2/4✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 46 times.
✗ Branch 5 not taken.
|
92 | Transform3s pose1(tf), pose2; |
414 | |||
415 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | CollisionResult local_result; |
416 |
1/2✓ Branch 2 taken 46 times.
✗ Branch 3 not taken.
|
92 | CollisionRequest request(NO_REQUEST, (std::numeric_limits<int>::max)()); |
417 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | MeshCollisionTraversalNode<BV> node(request); |
418 | |||
419 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | bool success = initialize<BV>(node, m1, pose1, m2, pose2, local_result); |
420 |
6/12✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 46 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 46 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 46 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 46 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 46 times.
|
92 | BOOST_REQUIRE(success); |
421 | |||
422 | 92 | node.enable_statistics = verbose; | |
423 | |||
424 |
1/2✓ Branch 1 taken 46 times.
✗ Branch 2 not taken.
|
92 | collide(&node, request, local_result); |
425 | |||
426 |
2/2✓ Branch 1 taken 23 times.
✓ Branch 2 taken 23 times.
|
92 | if (local_result.numContacts() > 0) |
427 | 46 | return true; | |
428 | else | ||
429 | 46 | return false; | |
430 | 92 | } | |
431 |