Skip to content

Commit 5b8bbec

Browse files
authored
Merge pull request NVIDIA#24 from ingowald/infinity-warning
Merge of PR NVIDIA#24, with some minor compile fix and cleanup. Looking good, CI looking good - thx!
2 parents 101f42e + eb401bd commit 5b8bbec

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

cuBQL/queries/pointData/findClosest.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace cuBQL {
4646
/*! square of the maximum query distance in which
4747
this query is to look for candidates. note
4848
this is the SQUARE distance */
49-
float squareOfMaxQueryDistance=INFINITY);
49+
float squareOfMaxQueryDistance=PosInfTy());
5050

5151
/*! given a (W-wide) bvh build over a set of float<N> points,
5252
perform a closest-point query that returns the index of the
@@ -77,7 +77,7 @@ namespace cuBQL {
7777
/*! square of the maximum query distance in which
7878
this query is to look for candidates. note
7979
this is the SQUARE distance */
80-
float squareOfMaxQueryDistance=INFINITY);
80+
float squareOfMaxQueryDistance=PosInfTy());
8181

8282

8383
template<typename T, int D>
@@ -95,7 +95,7 @@ namespace cuBQL {
9595
/*! square of the maximum query distance in which
9696
this query is to look for candidates. note
9797
this is the SQUARE distance */
98-
float squareOfMaxQueryDistance=INFINITY);
98+
float squareOfMaxQueryDistance=PosInfTy());
9999

100100
template<typename T, int D>
101101
/*! same as regular points::closestPoint, but excluding all data
@@ -112,7 +112,7 @@ namespace cuBQL {
112112
/*! square of the maximum query distance in which
113113
this query is to look for candidates. note
114114
this is the SQUARE distance */
115-
float squareOfMaxQueryDistance=INFINITY);
115+
float squareOfMaxQueryDistance=PosInfTy());
116116

117117
#ifdef __CUDACC__
118118
// ******************************************************************
@@ -128,7 +128,7 @@ namespace cuBQL {
128128
/*! square of the maximum query distance in which
129129
this query is to look for candidates. note
130130
this is the SQUARE distance */
131-
float squareOfMaxQueryDistance=INFINITY);
131+
float squareOfMaxQueryDistance=PosInfTy());
132132

133133
// ******************************************************************
134134
/*! variant of cuBQL::point::findClosest() that's specialized for
@@ -143,7 +143,7 @@ namespace cuBQL {
143143
/*! square of the maximum query distance in which
144144
this query is to look for candidates. note
145145
this is the SQUARE distance */
146-
float squareOfMaxQueryDistance=INFINITY);
146+
float squareOfMaxQueryDistance=PosInfTy());
147147

148148
// ******************************************************************
149149
/*! variant of cuBQL::point::findClosest() that's specialized for
@@ -158,7 +158,7 @@ namespace cuBQL {
158158
/*! square of the maximum query distance in which
159159
this query is to look for candidates. note
160160
this is the SQUARE distance */
161-
float squareOfMaxQueryDistance=INFINITY);
161+
float squareOfMaxQueryDistance=PosInfTy());
162162
#endif
163163

164164
// ******************************************************************
@@ -179,7 +179,7 @@ namespace cuBQL {
179179
/*! square of the maximum query distance in which
180180
this query is to look for candidates. note
181181
this is the SQUARE distance */
182-
float squareOfMaxQueryDistance=INFINITY)
182+
float squareOfMaxQueryDistance=PosInfTy())
183183
{
184184
int closestID = -1;
185185
float closestSqrDist = squareOfMaxQueryDistance;
@@ -227,7 +227,7 @@ namespace cuBQL {
227227
/*! square of the maximum query distance in which
228228
this query is to look for candidates. note
229229
this is the SQUARE distance */
230-
float squareOfMaxQueryDistance=INFINITY)
230+
float squareOfMaxQueryDistance=PosInfTy())
231231
{
232232
int closestID = -1;
233233
float closestSqrDist = squareOfMaxQueryDistance;

cuBQL/queries/pointData/knn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace cuBQL {
5252
/*! square of the maximum query distance in which
5353
this query is to look for candidates. note
5454
this is the SQUARE distance */
55-
float squareOfMaxQueryDistance=INFINITY);
55+
float squareOfMaxQueryDistance=PosInfTy());
5656

5757

5858
// ******************************************************************

cuBQL/queries/triangleData/math/boxTriangleIntersections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace cuBQL {
8585
entirely within that slab (iff lower_k <= a_k <= upper_k),
8686
or entirely outside */
8787
if (a_k > upper_k || a_k < lower_k) {
88-
t0 = INFINITY; t1 = -INFINITY;
88+
t0 = PosInfTy(); t1 = NegInfTy();
8989
}
9090
} else {
9191
/* line segment is not parallel to the slab planes, so we can

cuBQL/queries/triangleData/math/pointToTriangleDistance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace cuBQL {
1515

1616
struct PointToTriangleTestResult {
1717
/*! (square!) distance between query point and closest point on triangle.*/
18-
float sqrDist = INFINITY;
18+
float sqrDist = PosInfTy();
1919
/*! the actual 3D point that's closest on the triangle */
2020
vec3f P;
2121
};

0 commit comments

Comments
 (0)