10 |
|
|
11 |
|
#define SDISTANT 01 /* source distant flag */ |
12 |
|
#define SSKIP 02 /* source skip flag */ |
13 |
+ |
#define SPROX 04 /* source proximity flag */ |
14 |
+ |
#define SSPOT 010 /* source spotlight flag */ |
15 |
|
|
16 |
+ |
#define AIMREQT 100 /* required aim success/failure */ |
17 |
+ |
|
18 |
|
typedef struct { |
19 |
+ |
float siz; /* output solid angle */ |
20 |
+ |
float flen; /* focal length */ |
21 |
+ |
FVECT aim; /* aim direction */ |
22 |
+ |
} SPOT; /* spotlight */ |
23 |
+ |
|
24 |
+ |
typedef struct { |
25 |
|
short sflags; /* source flags */ |
26 |
|
FVECT sloc; /* direction or position of source */ |
27 |
|
float ss; /* tangent or disk radius */ |
28 |
|
float ss2; /* domega or projected area */ |
29 |
+ |
union { |
30 |
+ |
float prox; /* proximity */ |
31 |
+ |
SPOT *s; /* spot */ |
32 |
+ |
} sl; /* localized source information */ |
33 |
+ |
int aimsuccess; /* aim successes - AIMREQT*failures */ |
34 |
|
long ntests, nhits; /* shadow tests and hits */ |
35 |
|
OBJREC *so; /* source object */ |
36 |
|
} SRCREC; /* light source */ |
37 |
|
|
38 |
|
typedef struct { |
24 |
– |
int sno; /* source number */ |
39 |
|
FVECT dir; /* source direction */ |
40 |
|
float dom; /* domega for source */ |
27 |
– |
float brt; /* brightness (for comparison) */ |
41 |
|
COLOR val; /* contribution */ |
42 |
|
} CONTRIB; /* direct contribution */ |
43 |
|
|
44 |
+ |
typedef struct { |
45 |
+ |
int sno; /* source number */ |
46 |
+ |
float brt; /* brightness (for comparison) */ |
47 |
+ |
} CNTPTR; /* contribution pointer */ |
48 |
+ |
|
49 |
|
extern SRCREC *source; /* our source list */ |
50 |
|
extern int nsources; /* the number of sources */ |
51 |
|
|
52 |
|
extern double srcray(); /* ray to source */ |
53 |
+ |
|
54 |
+ |
extern SPOT *makespot(); /* make spotlight */ |