19 |
|
|
20 |
|
#include "random.h" |
21 |
|
|
22 |
+ |
#define MINSAMPLES 3 /* minimum number of pretest samples */ |
23 |
+ |
#define STESTMAX 30 /* maximum seeks per sample */ |
24 |
|
|
25 |
+ |
|
26 |
|
double getdisk(); |
27 |
|
|
28 |
|
static OBJECT *vobject; /* virtual source objects */ |
275 |
|
n = or2/DOT(offsdir,offsdir)*vspretest + .5; |
276 |
|
infront = DOT(onorm, offsdir) > 0.; |
277 |
|
} |
278 |
< |
if (n < 1) n = 1; |
278 |
> |
if (n < MINSAMPLES) n = MINSAMPLES; |
279 |
|
#ifdef DEBUG |
280 |
|
fprintf(stderr, "pretesting source %d in object %s with %d rays\n", |
281 |
|
sn, o->oname, n); |
282 |
|
#endif |
283 |
|
/* sample */ |
284 |
|
or = sqrt(or2); |
285 |
< |
ssn = 25*n; |
285 |
> |
ssn = STESTMAX*n; |
286 |
|
nhit = nok = 0; |
287 |
|
while (n-- > 0) { |
288 |
|
/* get sample point */ |