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 1.13 by greg, Thu Jul 18 14:43:06 1991 UTC vs.
Revision 1.14 by greg, Mon Oct 21 12:58:14 1991 UTC

# Line 16 | Line 16
16   #define  SSPOT          010             /* source spotlight flag */
17   #define  SVIRTUAL       020             /* source virtual flag */
18   #define  SFLAT          040             /* source flat flag */
19 < #define  SFOLLOW        0100            /* source follow path flag */
19 > #define  SCYL           0100            /* source cylindrical flag */
20 > #define  SFOLLOW        0200            /* source follow path flag */
21  
22   typedef struct {
23          FVECT  aim;             /* aim direction or center */
# Line 27 | Line 28 | typedef struct {
28   typedef struct {
29          int  sflags;            /* source flags */
30          FVECT  sloc;            /* direction or position of source */
31 <        FVECT  snorm;           /* surface normal of flat source */
32 <        float  ss;              /* tangent or disk radius */
33 <        float  ss2;             /* domega or projected area */
31 >        FVECT  ss[3];           /* source dimension vectors, U, V, and W */
32 >        float  srad;            /* maximum source radius */
33 >        float  ss2;             /* solid angle or projected area */
34          struct {
35                  float  prox;            /* proximity */
36                  SPOT  *s;               /* spot */
# Line 45 | Line 46 | typedef struct {
46          OBJREC  *so;            /* source destination object */
47   }  SRCREC;              /* light source */
48  
49 + #define MAXSPART        32              /* maximum partitions per source */
50 +
51 + #define SU              0               /* U vector or partition */
52 + #define SV              1               /* V vector or partition */
53 + #define SW              2               /* W vector or partition */
54 + #define S0              3               /* leaf partition */
55 +
56 + #define snorm           ss[SW]          /* normal vector for flat source */
57 +
58 + typedef struct {
59 +        int  sn;                                /* source number */
60 +        short  np;                              /* number of partitions */
61 +        short  sp;                              /* this partition number */
62 +        double  dom;                            /* solid angle of partition */
63 +        unsigned char  spt[MAXSPART/2];         /* source partitioning */
64 + }  SRCINDEX;            /* source index structure */
65 +
66 + #define initsrcindex(s) ((s)->sn = (s)->sp = -1, (s)->np = 0)
67 +
68 + #define clrpart(pt)     bzero((char *)(pt), MAXSPART/2)
69 + #define setpart(pt,i,v) ((pt)[(i)>>2] |= (v)<<(((i)&3)<<1))
70 + #define spart(pt,pi)    ((pt)[(pi)>>2] >> (((pi)&3)<<1) & 3)
71 +
72   /*
73   * Special support functions for sources
74   */
# Line 68 | Line 92 | typedef struct {
92  
93   typedef struct {
94          int     (*setsrc)();    /* set light source for object */
95 +        int     (*partit)();    /* partition light source object */
96          double  (*getpleq)();   /* plane equation for surface */
97          double  (*getdisk)();   /* maximum disk for surface */
98   } SOBJECT;              /* source object functions */
# Line 82 | Line 107 | extern SRCFUNC  sfun[];                        /* source dispatch table */
107   extern SRCREC  *source;                 /* our source list */
108   extern int  nsources;                   /* the number of sources */
109  
85 extern double  srcray();                /* ray to source */
110   extern int  srcvalue();                 /* compute source value w/o shadows */
111 + extern double  nextssamp();             /* get next source sample location */
112 + extern double  scylform();              /* cosine to axis of cylinder */
113  
114 + #define  sflatform(sn,dir)      -DOT(source[sn].snorm, dir)
115 +
116   extern double  intercircle();           /* intersect two circles */
117   extern double  spotdisk();              /* intersecting disk for spot */
118   extern double  beamdisk();              /* intersecting disk for beam */
# Line 94 | Line 122 | extern SPOT  *makespot();              /* make spotlight */
122   extern double  dstrsrc;                 /* source distribution amount */
123   extern double  shadthresh;              /* relative shadow threshold */
124   extern double  shadcert;                /* shadow testing certainty */
125 + extern double  srcsizerat;              /* max. ratio of source size/dist. */
126   extern int  directrelay;                /* maximum number of source relays */
127   extern int  vspretest;                  /* virtual source pretest density */
128   extern int  directinvis;                /* sources invisible? */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines