ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ray.h
Revision: 2.8
Committed: Wed Apr 17 14:01:51 1996 UTC (28 years ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.7: +1 -1 lines
Log Message:
changed albedo to 3-color parameter

File Contents

# User Rev Content
1 greg 2.5 /* Copyright (c) 1995 Regents of the University of California */
2 greg 1.1
3     /* SCCSid "$SunId$ LBL" */
4    
5     /*
6     * ray.h - header file for routines using rays.
7     *
8     * 8/7/85
9     */
10    
11     #include "standard.h"
12    
13     #include "object.h"
14    
15     #include "color.h"
16    
17 greg 2.6 #define MAXDIM 32 /* maximum number of dimensions */
18    
19     #define MAXSLIST 32 /* maximum sources to check */
20    
21 greg 1.1 /* ray type flags */
22     #define PRIMARY 01 /* original ray */
23     #define SHADOW 02 /* ray to light source */
24     #define REFLECTED 04 /* reflected ray */
25     #define REFRACTED 010 /* refracted (bent) ray */
26     #define TRANS 020 /* transmitted/transferred ray */
27     #define AMBIENT 040 /* ray scattered for interreflection */
28 greg 2.2 #define SPECULAR 0100 /* ray scattered for specular */
29 greg 1.1
30     /* reflected ray types */
31 greg 2.2 #define RAYREFL (SHADOW|REFLECTED|AMBIENT|SPECULAR)
32 greg 1.1
33     typedef struct ray {
34 greg 2.3 unsigned long rno; /* unique ray number */
35 greg 1.1 int rlvl; /* number of reflections for this ray */
36     float rweight; /* cumulative weight of this ray */
37     short rtype; /* ray type */
38     short crtype; /* cumulative ray type */
39     struct ray *parent; /* ray this originated from */
40     FVECT rorg; /* origin of ray */
41     FVECT rdir; /* normalized direction of ray */
42 greg 2.4 double rmax; /* maximum distance (aft clipping plane) */
43 greg 1.1 int rsrc; /* source we're aiming for */
44     OBJECT *clipset; /* set of objects currently clipped */
45     OBJECT *newcset; /* next clipset, used for transmission */
46 greg 1.6 int (*revf)(); /* evaluation function for this ray */
47 greg 1.1 OBJREC *ro; /* intersected object */
48     double rot; /* distance to object */
49     FVECT rop; /* intersection point */
50     FVECT ron; /* intersection surface normal */
51     double rod; /* -DOT(rdir, ron) */
52 greg 1.4 FULLXF *rox; /* object transformation */
53 greg 1.1 FVECT pert; /* surface normal perturbation */
54     COLOR pcol; /* pattern color */
55     COLOR rcol; /* returned ray value */
56 greg 1.3 double rt; /* returned effective ray length */
57 greg 2.6 COLOR cext; /* medium extinction coefficient */
58 greg 2.8 COLOR albedo; /* medium scattering albedo */
59 greg 2.6 float gecc; /* scattering eccentricity coefficient */
60     int *slights; /* list of lights to test for scattering */
61 greg 1.1 } RAY;
62    
63 greg 1.6 extern int raytrace();
64    
65 greg 1.1 extern double raynormal();
66 greg 2.5
67 greg 2.7 extern double raydist();
68 greg 1.5
69     extern int dimlist[]; /* dimension list for distribution */
70     extern int ndims; /* number of dimensions so far */
71     extern int samplendx; /* index for this sample */
72 greg 1.6
73     #define rayvalue(r) (*(r)->revf)(r)