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

Comparing ray/src/rt/ray.h (file contents):
Revision 2.13 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.25 by greg, Tue Apr 19 01:15:06 2005 UTC

# Line 2 | Line 2
2   /*
3   *  ray.h - header file for routines using rays.
4   */
5 + #ifndef _RAD_RAY_H_
6 + #define _RAD_RAY_H_
7  
6 #include "copyright.h"
7
8   #include  "standard.h"
9
9   #include  "octree.h"
11
10   #include  "object.h"
13
11   #include  "color.h"
12  
13 + #ifdef __cplusplus
14 + extern "C" {
15 + #endif
16 +
17   #define  MAXDIM         32      /* maximum number of dimensions */
18  
19                                  /* ray type flags */
# Line 30 | Line 31
31   typedef struct ray {
32          unsigned long  rno;     /* unique ray number */
33          int     rlvl;           /* number of reflections for this ray */
34 <        float   rweight;        /* cumulative weight of this ray */
34 >        float   rweight;        /* cumulative weight (for termination) */
35 >        COLOR   rcoef;          /* contribution coefficient w.r.t. parent */
36          short   rtype;          /* ray type */
37          short   crtype;         /* cumulative ray type */
38 <        struct ray  *parent;    /* ray this originated from */
38 >        const struct ray  *parent;      /* ray this originated from */
39          FVECT   rorg;           /* origin of ray */
40          FVECT   rdir;           /* normalized direction of ray */
41          double  rmax;           /* maximum distance (aft clipping plane) */
42          int     rsrc;           /* source we're aiming for */
43          OBJECT  *clipset;       /* set of objects currently clipped */
44          OBJECT  *newcset;       /* next clipset, used for transmission */
45 <        void    (*revf)();      /* evaluation function for this ray */
45 >        void    (*hitf)(OBJECT *, struct ray *);        /* custom hit test */
46          OBJECT  robj;           /* intersected object number */
47          OBJREC  *ro;            /* intersected object (one with material) */
48          double  rot;            /* distance to object */
# Line 48 | Line 50 | typedef struct ray {
50          FVECT   ron;            /* intersection surface normal */
51          double  rod;            /* -DOT(rdir, ron) */
52          FULLXF  *rox;           /* object transformation */
53 +        RREAL   uv[2];          /* local coordinates */
54          FVECT   pert;           /* surface normal perturbation */
55          COLOR   pcol;           /* pattern color */
56 <        COLOR   rcol;           /* returned ray value */
56 >        COLOR   rcol;           /* returned radiance value */
57          double  rt;             /* returned effective ray length */
58          COLOR   cext;           /* medium extinction coefficient */
59          COLOR   albedo;         /* medium scattering albedo */
# Line 58 | Line 61 | typedef struct ray {
61          int     *slights;       /* list of lights to test for scattering */
62   }  RAY;
63  
61 #define  rayvalue(r)    (*(r)->revf)(r)
62
64   extern char  VersionID[];       /* Radiance version ID string */
65  
66   extern CUBE     thescene;       /* our scene */
# Line 116 | Line 117 | extern int     ambincl;        /* include == 1, exclude == 0 */
117   extern int      ray_pnprocs;    /* number of child processes */
118   extern int      ray_pnidle;     /* number of idle processes */
119  
120 < #define AMBLLEN         128     /* max. ambient list length */
121 < #define AMBWORD         8       /* average word length */
120 > #ifndef AMBLLEN
121 > #define AMBLLEN         512     /* max. ambient list length */
122 > #endif
123 > #define AMBWORD         12      /* average word length */
124  
125   typedef struct {                /* rendering parameter holder */
126          int     do_irrad;
# Line 153 | Line 156 | typedef struct {               /* rendering parameter holder */
156   #define rpambmod(p,i)   ( (i)>=AMBLLEN||(p)->amblndx[i]<0 ? \
157                            (char *)NULL : (p)->amblval+(p)->amblndx[i] )
158  
156 #ifdef NOPROTO
157
158 extern void     headclean();
159 extern void     openheader();
160 extern void     dupheader();
161 extern void     pfdetach();
162 extern void     pfclean();
163 extern void     pflock();
164 extern void     pfhold();
165 extern void     io_process();
166 extern int      free_objs();
167 extern void     free_objmem();
168 extern int      load_os();
169 extern void     preload_objs();
170 extern void     ray_init();
171 extern void     ray_trace();
172 extern void     ray_done();
173 extern void     ray_save();
174 extern void     ray_restore();
175 extern void     ray_defaults();
176 extern void     ray_pinit();
177 extern void     ray_psend();
178 extern int      ray_pqueue();
179 extern int      ray_presult();
180 extern void     ray_pdone();
181 extern void     ray_popen();
182 extern void     ray_pclose();
183 extern int      rayorigin();
184 extern void     rayclear();
185 extern void     raytrace();
186 extern void     raycont();
187 extern void     raytrans();
188 extern int      rayshade();
189 extern void     rayparticipate();
190 extern int      raymixture();
191 extern double   raydist();
192 extern double   raynormal();
193 extern void     newrayxf();
194 extern void     flipsurface();
195 extern int      localhit();
196 extern int      getrenderopt();
197 extern void     print_rdefaults();
198 extern void     drawsources();
199 extern void     rtrace();
200 extern void     rview();
201 extern void     rpict();
202
203 #else
159                                          /* defined in duphead.c */
160   extern void     headclean(void);
161   extern void     openheader(void);
162   extern void     dupheader(void);
163 +                                        /* defined in persist.c */
164 + extern void persistfile(char *pfn);
165   extern void     pfdetach(void);
166   extern void     pfclean(void);
167   extern void     pflock(int lf);
# Line 232 | Line 189 | extern void    ray_pdone(int freall);
189   extern void     ray_popen(int nadd);
190   extern void     ray_pclose(int nsub);
191                                          /* defined in raytrace.c */
192 < extern int      rayorigin(RAY *r, RAY *ro, int rt, double rw);
192 > extern int      rayorigin(RAY *r, int rt, const RAY *ro, const COLOR rc);
193   extern void     rayclear(RAY *r);
194 < extern void     raytrace(RAY *r);
194 > extern void     rayvalue(RAY *r);
195 > extern void     rayhit(OBJECT *oset, RAY *r);
196   extern void     raycont(RAY *r);
197   extern void     raytrans(RAY *r);
198   extern int      rayshade(RAY *r, int mod);
199   extern void     rayparticipate(RAY *r);
200 + extern void     raytexture(RAY *r, OBJECT mod);
201   extern int      raymixture(RAY *r, OBJECT fore, OBJECT back, double coef);
202 < extern double   raydist(RAY *r, int flags);
202 > extern void     raycontrib(COLOR rc, const RAY *r, int flags);
203 > extern double   raydist(const RAY *r, int flags);
204   extern double   raynormal(FVECT norm, RAY *r);
205   extern void     newrayxf(RAY *r);
206   extern void     flipsurface(RAY *r);
# Line 251 | Line 211 | extern void    print_rdefaults(void);
211                                          /* defined in srcdraw.c */
212   extern void     drawsources(COLOR *pic[], float *zbf[],
213                          int x0, int xsiz, int y0, int ysiz);
214 + extern void init_drawsources(int rad);
215 +                                        /* defined in rt/initotypes.c */
216 + extern void initotypes(void);
217                                          /* module main procedures */
218   extern void     rtrace(char *fname);
219 + extern char * formstr(int  f);
220   extern void     rview(void);
221   extern void     rpict(int seq, char *pout, char *zout, char *prvr);
222  
223 +
224 + #ifdef __cplusplus
225 + }
226   #endif
227 + #endif /* _RAD_RAY_H_ */
228 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines