1
1
#ifndef PBAT_GEOMETRY_CLOSEST_POINT_QUERIES_H
2
2
#define PBAT_GEOMETRY_CLOSEST_POINT_QUERIES_H
3
3
4
+ #include " pbat/HostDevice.h"
4
5
#include " pbat/math/linalg/mini/Mini.h"
5
6
6
7
#include < algorithm>
@@ -20,7 +21,7 @@ namespace mini = math::linalg::mini;
20
21
* @return
21
22
*/
22
23
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixN>
23
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
24
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
24
25
PointOnPlane (TMatrixX const & X, TMatrixP const & P, TMatrixN const & n);
25
26
26
27
/* *
@@ -31,7 +32,7 @@ PointOnPlane(TMatrixX const& X, TMatrixP const& P, TMatrixN const& n);
31
32
* @return
32
33
*/
33
34
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ>
34
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
35
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
35
36
PointOnLineSegment (TMatrixX const & X, TMatrixP const & P, TMatrixQ const & Q);
36
37
37
38
/* *
@@ -43,7 +44,7 @@ PointOnLineSegment(TMatrixX const& X, TMatrixP const& P, TMatrixQ const& Q);
43
44
* @return
44
45
*/
45
46
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixL, mini::CMatrix TMatrixU>
46
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
47
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
47
48
PointOnAxisAlignedBoundingBox (TMatrixX const & X, TMatrixL const & L, TMatrixU const & U);
48
49
49
50
/* *
@@ -59,7 +60,7 @@ template <
59
60
mini::CMatrix TMatrixA,
60
61
mini::CMatrix TMatrixB,
61
62
mini::CMatrix TMatrixC>
62
- mini::SVector<typename TMatrixP::ScalarType, 3 >
63
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, 3 >
63
64
UvwPointInTriangle (TMatrixP const & P, TMatrixA const & A, TMatrixB const & B, TMatrixC const & C);
64
65
65
66
/* *
@@ -75,7 +76,7 @@ template <
75
76
mini::CMatrix TMatrixA,
76
77
mini::CMatrix TMatrixB,
77
78
mini::CMatrix TMatrixC>
78
- mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows >
79
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows >
79
80
PointInTriangle (TMatrixP const & P, TMatrixA const & A, TMatrixB const & B, TMatrixC const & C);
80
81
81
82
/* *
@@ -95,15 +96,15 @@ template <
95
96
mini::CMatrix TMatrixB,
96
97
mini::CMatrix TMatrixC,
97
98
mini::CMatrix TMatrixD>
98
- mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows > PointInTetrahedron (
99
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows > PointInTetrahedron (
99
100
TMatrixP const & P,
100
101
TMatrixA const & A,
101
102
TMatrixB const & B,
102
103
TMatrixC const & C,
103
104
TMatrixD const & D);
104
105
105
106
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixN>
106
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
107
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
107
108
PointOnPlane (TMatrixX const & X, TMatrixP const & P, TMatrixN const & n)
108
109
{
109
110
using namespace std ;
@@ -121,7 +122,7 @@ PointOnPlane(TMatrixX const& X, TMatrixP const& P, TMatrixN const& n)
121
122
}
122
123
123
124
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ>
124
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
125
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
125
126
PointOnLineSegment (TMatrixX const & X, TMatrixP const & P, TMatrixQ const & Q)
126
127
{
127
128
using ScalarType = typename TMatrixX::ScalarType;
@@ -140,7 +141,7 @@ PointOnLineSegment(TMatrixX const& X, TMatrixP const& P, TMatrixQ const& Q)
140
141
}
141
142
142
143
template <mini::CMatrix TMatrixX, mini::CMatrix TMatrixL, mini::CMatrix TMatrixU>
143
- mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
144
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixX::ScalarType, TMatrixX::kRows >
144
145
PointOnAxisAlignedBoundingBox (TMatrixX const & P, TMatrixL const & L, TMatrixU const & U)
145
146
{
146
147
using namespace std ;
@@ -158,7 +159,7 @@ template <
158
159
mini::CMatrix TMatrixA,
159
160
mini::CMatrix TMatrixB,
160
161
mini::CMatrix TMatrixC>
161
- mini::SVector<typename TMatrixP::ScalarType, 3 >
162
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, 3 >
162
163
UvwPointInTriangle (TMatrixP const & P, TMatrixA const & A, TMatrixB const & B, TMatrixC const & C)
163
164
{
164
165
using ScalarType = typename TMatrixP::ScalarType;
@@ -242,7 +243,7 @@ template <
242
243
mini::CMatrix TMatrixA,
243
244
mini::CMatrix TMatrixB,
244
245
mini::CMatrix TMatrixC>
245
- mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows >
246
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows >
246
247
PointInTriangle (TMatrixP const & P, TMatrixA const & A, TMatrixB const & B, TMatrixC const & C)
247
248
{
248
249
auto uvw = UvwPointInTriangle (P, A, B, C);
@@ -255,7 +256,7 @@ template <
255
256
mini::CMatrix TMatrixB,
256
257
mini::CMatrix TMatrixC,
257
258
mini::CMatrix TMatrixD>
258
- mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows > PointInTetrahedron (
259
+ PBAT_HOST_DEVICE mini::SVector<typename TMatrixP::ScalarType, TMatrixP::kRows > PointInTetrahedron (
259
260
TMatrixP const & P,
260
261
TMatrixA const & A,
261
262
TMatrixB const & B,
0 commit comments