ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/source.h
(Generate patch)

Comparing ray/src/rt/source.h (file contents):
Revision 2.11 by schorsch, Mon Jul 14 22:24:00 2003 UTC vs.
Revision 2.18 by greg, Sat Dec 6 01:08:53 2008 UTC

# Line 13 | Line 13
13   extern "C" {
14   #endif
15  
16 + #ifndef  AIMREQT
17   #define  AIMREQT        100             /* required aim success/failure */
18 + #endif
19 + #ifndef  SHADCACHE
20 + #define  SHADCACHE      20              /* shadow cache resolution */
21 + #endif
22  
23   #define  SDISTANT       01              /* source distant flag */
24   #define  SSKIP          02              /* source skip flag */
# Line 21 | Line 26 | extern "C" {
26   #define  SSPOT          010             /* source spotlight flag */
27   #define  SVIRTUAL       020             /* source virtual flag */
28   #define  SFLAT          040             /* source flat flag */
29 < #define  SCYL           0100            /* source cylindrical flag */
30 < #define  SFOLLOW        0200            /* source follow path flag */
29 > #define  SCIR           0100            /* source circular flag */
30 > #define  SCYL           0200            /* source cylindrical flag */
31 > #define  SFOLLOW        0400            /* source follow path flag */
32  
33   typedef struct {
34          FVECT  aim;             /* aim direction or center */
# Line 31 | Line 37 | typedef struct {
37   } SPOT;                 /* spotlight */
38  
39   typedef struct {
40 <        int  sflags;            /* source flags */
40 >        union {
41 >                struct {
42 >                        FVECT   u, v;           /* unit vectors */
43 >                }  f;                   /* flat source indexing */
44 >                struct {
45 >                        FVECT   o;              /* origin position */
46 >                        RREAL   e1, e2;         /* 1/extent */
47 >                        int     ax;             /* major direction */
48 >                }  d;                   /* distant source indexing */
49 >        }  p;                   /* indexing parameters */
50 >        OBJECT  obs[1];         /* cache obstructors (extends struct) */
51 > }  OBSCACHE;            /* obstructor cache */
52 >
53 > typedef struct {
54          FVECT  sloc;            /* direction or position of source */
55          FVECT  ss[3];           /* source dimension vectors, U, V, and W */
56          float  srad;            /* maximum source radius */
57          float  ss2;             /* solid angle or projected area */
58 +        OBJREC  *so;            /* source destination object */
59          struct {
60                  float  prox;            /* proximity */
61                  SPOT  *s;               /* spot */
# Line 49 | Line 69 | typedef struct {
69          } sa;                   /* source aiming information */
70          unsigned long
71                  ntests, nhits;  /* shadow tests and hits */
72 <        OBJREC  *so;            /* source destination object */
72 > #ifdef  SHADCACHE
73 >        OBSCACHE  *obscache;    /* obstructor cache */
74 > #endif
75 >        int  sflags;            /* source flags */
76   }  SRCREC;              /* light source */
77  
78   #define MAXSPART        64              /* maximum partitions per source */
# Line 62 | Line 85 | typedef struct {
85   #define snorm           ss[SW]          /* normal vector for flat source */
86  
87   typedef struct {
88 +        double  dom;                            /* solid angle of partition */
89          int  sn;                                /* source number */
90          short  np;                              /* number of partitions */
91          short  sp;                              /* this partition number */
68        double  dom;                            /* solid angle of partition */
92          unsigned char  spt[MAXSPART/2];         /* source partitioning */
93   }  SRCINDEX;            /* source index structure */
94  
# Line 120 | Line 143 | extern int  nsources;                  /* the number of sources */
143   #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)
144  
145                                          /* defined in source.c */
146 + extern OBJREC   *findmaterial(OBJREC *o);
147   extern void     marksources(void);
148   extern void     freesources(void);
149   extern int      srcray(RAY *sr, RAY *r, SRCINDEX *si);
150   extern void     srcvalue(RAY *r);
151   extern int      sourcehit(RAY *r);
152 < extern void     direct(RAY *r, void (*f)(), char *p);
152 > typedef void srcdirf_t(COLOR cv, void *np, FVECT ldir, double omega);
153 > extern void     direct(RAY *r, srcdirf_t *f, void *p);
154   extern void     srcscatter(RAY *r);
155   extern int      m_light(OBJREC *m, RAY *r);
156 +                                        /* defined in srcobstr.c */
157 + extern void     initobscache(int sn);
158 + extern int      srcblocker(RAY *r);
159 + extern int      srcblocked(RAY *r);
160 + extern void     freeobscache(SRCREC *s);
161 + extern void     markclip(OBJREC *m);
162                                          /* defined in srcsamp.c */
163   extern double   nextssamp(RAY *r, SRCINDEX *si);
164   extern int      skipparts(int ct[3], int sz[3], int pp[2], unsigned char *pt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines