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.7 by greg, Thu Jun 20 09:03:21 1991 UTC vs.
Revision 1.11 by greg, Tue Jun 25 12:32:49 1991 UTC

# Line 42 | Line 42 | typedef struct {
42          OBJREC  *so;            /* source destination object */
43   }  SRCREC;              /* light source */
44  
45 + /*
46 + * Special support functions for sources
47 + */
48 +
49 + /*
50 + * Virtual source materials must define the following.
51 + *
52 + *      vproj(pm, op, sp, i)    Compute i'th virtual projection
53 + *                              of source sp in object op and assign
54 + *                              the 4x4 transformation matrix pm.
55 + *                              Return 1 on success, 0 if no i'th projection.
56 + *
57 + *      nproj                   The number of projections.  The value of
58 + *                              i passed to vproj runs from 0 to nproj-1.
59 + */
60 +
61   typedef struct {
62 <        FVECT  dir;             /* source direction */
63 <        COLOR  coef;            /* material coefficient */
64 <        COLOR  val;             /* contribution */
49 < }  CONTRIB;             /* direct contribution */
62 >        int  (*vproj)();        /* project virtual sources */
63 >        int  nproj;             /* number of possible projections */
64 > } VSMATERIAL;           /* virtual source material functions */
65  
66   typedef struct {
67 <        int  sno;               /* source number */
68 <        float  brt;             /* brightness (for comparison) */
69 < }  CNTPTR;              /* contribution pointer */
67 >        int     (*setsrc)();    /* set light source for object */
68 >        double  (*getpleq)();   /* plane equation for surface */
69 >        double  (*getdisk)();   /* maximum disk for surface */
70 > } SOBJECT;              /* source object functions */
71  
72 + typedef union {
73 +        VSMATERIAL  *mf;        /* material functions */
74 +        SOBJECT  *of;           /* object functions */
75 + } SRCFUNC;              /* source functions */
76 +
77 + extern SRCFUNC  sfun[];                 /* source dispatch table */
78 +
79   extern SRCREC  *source;                 /* our source list */
80   extern int  nsources;                   /* the number of sources */
81  
82   extern double  srcray();                /* ray to source */
83 + extern int  srcvalue();                 /* compute source value w/o shadows */
84  
85 + extern double  intercircle();           /* intersect two circles */
86 + extern double  spotdisk();              /* intersecting disk for spot */
87 + extern double  beamdisk();              /* intersecting disk for beam */
88 +
89   extern SPOT  *makespot();               /* make spotlight */
90  
91 < extern SRCREC  *newsource();            /* allocate new source */
91 > extern double  dstrsrc;                 /* source distribution amount */
92 > extern double  shadthresh;              /* relative shadow threshold */
93 > extern double  shadcert;                /* shadow testing certainty */
94 > extern int  directrelay;                /* maximum number of source relays */
95 > extern int  vspretest;                  /* virtual source pretest density */
96 >
97 > #define  getplaneq(c,o)         (*sfun[(o)->otype].of->getpleq)(c,o)
98 > #define  getmaxdisk(c,o)        (*sfun[(o)->otype].of->getdisk)(c,o)
99 > #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines