10
10
// / @parblock
11
11
// /
12
12
// / Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13
- // / Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
13
+ // / Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
14
14
// /
15
15
// / POV-Ray is free software: you can redistribute it and/or modify
16
16
// / it under the terms of the GNU Affero General Public License as
@@ -55,8 +55,6 @@ namespace pov
55
55
* Local preprocessor defines
56
56
******************************************************************************/
57
57
58
- const DBL Cone_Tolerance = 1.0e-9 ;
59
-
60
58
#define close (x, y ) (fabs(x-y) < EPSILON ? 1 : 0 )
61
59
62
60
/* Part of the cone/cylinder hit. [DB 9/94] */
@@ -186,15 +184,17 @@ int Cone::Intersect(const BasicRay& ray, CONE_INT *Intersection, TraceThreadData
186
184
187
185
z = P[Z] + t1 * D[Z];
188
186
189
- if ((t1 > Cone_Tolerance) && (t1 < MAX_DISTANCE) && (z >= 0.0 ) && (z <= 1.0 ))
187
+ if ((t1 > gkMinIsectDepthReturned) && (t1 < MAX_DISTANCE) &&
188
+ (z >= 0.0 ) && (z <= 1.0 ))
190
189
{
191
190
Intersection[i].d = t1 / len;
192
191
Intersection[i++].t = SIDE_HIT;
193
192
}
194
193
195
194
z = P[Z] + t2 * D[Z];
196
195
197
- if ((t2 > Cone_Tolerance) && (t2 < MAX_DISTANCE) && (z >= 0.0 ) && (z <= 1.0 ))
196
+ if ((t2 > gkMinIsectDepthReturned) && (t2 < MAX_DISTANCE) &&
197
+ (z >= 0.0 ) && (z <= 1.0 ))
198
198
{
199
199
Intersection[i].d = t2 / len;
200
200
Intersection[i++].t = SIDE_HIT;
@@ -222,7 +222,8 @@ int Cone::Intersect(const BasicRay& ray, CONE_INT *Intersection, TraceThreadData
222
222
223
223
z = P[Z] + t1 * D[Z];
224
224
225
- if ((t1 > Cone_Tolerance) && (t1 < MAX_DISTANCE) && (z >= dist) && (z <= 1.0 ))
225
+ if ((t1 > gkMinIsectDepthReturned) && (t1 < MAX_DISTANCE) &&
226
+ (z >= dist) && (z <= 1.0 ))
226
227
{
227
228
Intersection[i].d = t1 / len;
228
229
Intersection[i++].t = SIDE_HIT;
@@ -244,15 +245,17 @@ int Cone::Intersect(const BasicRay& ray, CONE_INT *Intersection, TraceThreadData
244
245
245
246
z = P[Z] + t1 * D[Z];
246
247
247
- if ((t1 > Cone_Tolerance) && (t1 < MAX_DISTANCE) && (z >= dist) && (z <= 1.0 ))
248
+ if ((t1 > gkMinIsectDepthReturned) && (t1 < MAX_DISTANCE) &&
249
+ (z >= dist) && (z <= 1.0 ))
248
250
{
249
251
Intersection[i].d = t1 / len;
250
252
Intersection[i++].t = SIDE_HIT;
251
253
}
252
254
253
255
z = P[Z] + t2 * D[Z];
254
256
255
- if ((t2 > Cone_Tolerance) && (t2 < MAX_DISTANCE) && (z >= dist) && (z <= 1.0 ))
257
+ if ((t2 > gkMinIsectDepthReturned) && (t2 < MAX_DISTANCE) &&
258
+ (z >= dist) && (z <= 1.0 ))
256
259
{
257
260
Intersection[i].d = t2 / len;
258
261
Intersection[i++].t = SIDE_HIT;
@@ -269,7 +272,7 @@ int Cone::Intersect(const BasicRay& ray, CONE_INT *Intersection, TraceThreadData
269
272
270
273
b = (P[Y] + d * D[Y]);
271
274
272
- if (((Sqr (a) + Sqr (b)) <= 1.0 ) && (d > Cone_Tolerance ) && (d < MAX_DISTANCE))
275
+ if (((Sqr (a) + Sqr (b)) <= 1.0 ) && (d > gkMinIsectDepthReturned ) && (d < MAX_DISTANCE))
273
276
{
274
277
Intersection[i].d = d / len;
275
278
Intersection[i++].t = CAP_HIT;
@@ -282,7 +285,7 @@ int Cone::Intersect(const BasicRay& ray, CONE_INT *Intersection, TraceThreadData
282
285
b = (P[Y] + d * D[Y]);
283
286
284
287
if ((Sqr (a) + Sqr (b)) <= (Test_Flag (this , CYLINDER_FLAG) ? 1.0 : Sqr (dist))
285
- && (d > Cone_Tolerance ) && (d < MAX_DISTANCE))
288
+ && (d > gkMinIsectDepthReturned ) && (d < MAX_DISTANCE))
286
289
{
287
290
Intersection[i].d = d / len;
288
291
Intersection[i++].t = BASE_HIT;
0 commit comments