9 |
|
|
10 |
|
#include "ray.h" |
11 |
|
#include "otypes.h" |
12 |
+ |
#include "otspecial.h" |
13 |
|
#include "rtotypes.h" |
14 |
|
#include "source.h" |
15 |
|
#include "random.h" |
43 |
|
static int cntcmp(const void *p1, const void *p2); |
44 |
|
|
45 |
|
|
45 |
– |
OBJREC * /* find an object's actual material */ |
46 |
– |
findmaterial(OBJREC *o) |
47 |
– |
{ |
48 |
– |
while (!ismaterial(o->otype)) { |
49 |
– |
if (o->otype == MOD_ALIAS && o->oargs.nsargs) { |
50 |
– |
OBJECT aobj; |
51 |
– |
OBJREC *ao; |
52 |
– |
aobj = lastmod(objndx(o), o->oargs.sarg[0]); |
53 |
– |
if (aobj < 0) |
54 |
– |
objerror(o, USER, "bad reference"); |
55 |
– |
/* recursive check on alias branch */ |
56 |
– |
if ((ao = findmaterial(objptr(aobj))) != NULL) |
57 |
– |
return(ao); |
58 |
– |
} |
59 |
– |
if (o->omod == OVOID) |
60 |
– |
return(NULL); |
61 |
– |
o = objptr(o->omod); |
62 |
– |
} |
63 |
– |
return(o); /* mixtures will return NULL */ |
64 |
– |
} |
65 |
– |
|
66 |
– |
|
46 |
|
void |
47 |
|
marksources(void) /* find and mark source objects */ |
48 |
|
{ |
521 |
|
COLOR cvext; |
522 |
|
int i, j; |
523 |
|
|
524 |
< |
if (r->rot >= FHUGE || r->gecc >= 1.-FTINY) |
524 |
> |
if (r->rot >= FHUGE*.99 || r->gecc >= 1.-FTINY) |
525 |
|
return; /* this can never work */ |
526 |
|
/* PMAP: do unconditional inscattering for volume photons */ |
527 |
|
if (!volumePhotonMapping && (r->slights == NULL || r->slights[0] == 0)) |