| 1 |
greg |
1.1 |
/* Copyright (c) 1986 Regents of the University of California */ |
| 2 |
|
|
|
| 3 |
|
|
/* SCCSid "$SunId$ LBL" */ |
| 4 |
|
|
|
| 5 |
|
|
/* |
| 6 |
|
|
* source.h - header file for ray tracing sources. |
| 7 |
|
|
* |
| 8 |
|
|
* 8/20/85 |
| 9 |
|
|
*/ |
| 10 |
|
|
|
| 11 |
|
|
#define SDISTANT 01 /* source distant flag */ |
| 12 |
|
|
#define SSKIP 02 /* source skip flag */ |
| 13 |
greg |
1.3 |
#define SPROX 04 /* source proximity flag */ |
| 14 |
|
|
#define SSPOT 010 /* source spotlight flag */ |
| 15 |
greg |
1.1 |
|
| 16 |
|
|
typedef struct { |
| 17 |
greg |
1.3 |
float siz; /* output solid angle */ |
| 18 |
|
|
float flen; /* focal length */ |
| 19 |
|
|
FVECT aim; /* aim direction */ |
| 20 |
|
|
} SPOT; /* spotlight */ |
| 21 |
|
|
|
| 22 |
|
|
typedef struct { |
| 23 |
greg |
1.1 |
short sflags; /* source flags */ |
| 24 |
|
|
FVECT sloc; /* direction or position of source */ |
| 25 |
|
|
float ss; /* tangent or disk radius */ |
| 26 |
|
|
float ss2; /* domega or projected area */ |
| 27 |
greg |
1.3 |
union { |
| 28 |
|
|
float prox; /* proximity */ |
| 29 |
|
|
SPOT *s; /* spot */ |
| 30 |
|
|
} sl; /* localized source information */ |
| 31 |
greg |
1.2 |
long ntests, nhits; /* shadow tests and hits */ |
| 32 |
greg |
1.1 |
OBJREC *so; /* source object */ |
| 33 |
greg |
1.2 |
} SRCREC; /* light source */ |
| 34 |
greg |
1.1 |
|
| 35 |
greg |
1.2 |
typedef struct { |
| 36 |
|
|
FVECT dir; /* source direction */ |
| 37 |
|
|
float dom; /* domega for source */ |
| 38 |
|
|
COLOR val; /* contribution */ |
| 39 |
|
|
} CONTRIB; /* direct contribution */ |
| 40 |
greg |
1.4 |
|
| 41 |
|
|
typedef struct { |
| 42 |
|
|
int sno; /* source number */ |
| 43 |
|
|
float brt; /* brightness (for comparison) */ |
| 44 |
|
|
} CNTPTR; /* contribution pointer */ |
| 45 |
greg |
1.1 |
|
| 46 |
greg |
1.2 |
extern SRCREC *source; /* our source list */ |
| 47 |
greg |
1.1 |
extern int nsources; /* the number of sources */ |
| 48 |
|
|
|
| 49 |
greg |
1.2 |
extern double srcray(); /* ray to source */ |
| 50 |
greg |
1.3 |
|
| 51 |
|
|
extern SPOT *makespot(); /* make spotlight */ |