ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ray.h
Revision: 2.2
Committed: Sat Jan 4 19:53:55 1992 UTC (32 years, 4 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.1: +4 -3 lines
Log Message:
added specular sampling

File Contents

# User Rev Content
1 greg 2.2 /* Copyright (c) 1992 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     /* ray type flags */
18     #define PRIMARY 01 /* original ray */
19     #define SHADOW 02 /* ray to light source */
20     #define REFLECTED 04 /* reflected ray */
21     #define REFRACTED 010 /* refracted (bent) ray */
22     #define TRANS 020 /* transmitted/transferred ray */
23     #define AMBIENT 040 /* ray scattered for interreflection */
24 greg 2.2 #define SPECULAR 0100 /* ray scattered for specular */
25 greg 1.1
26     /* reflected ray types */
27 greg 2.2 #define RAYREFL (SHADOW|REFLECTED|AMBIENT|SPECULAR)
28 greg 1.1
29     typedef struct ray {
30     long rno; /* unique ray number */
31     int rlvl; /* number of reflections for this ray */
32     float rweight; /* cumulative weight of this ray */
33     short rtype; /* ray type */
34     short crtype; /* cumulative ray type */
35     struct ray *parent; /* ray this originated from */
36     FVECT rorg; /* origin of ray */
37     FVECT rdir; /* normalized direction of ray */
38     int rsrc; /* source we're aiming for */
39     OBJECT *clipset; /* set of objects currently clipped */
40     OBJECT *newcset; /* next clipset, used for transmission */
41 greg 1.6 int (*revf)(); /* evaluation function for this ray */
42 greg 1.1 OBJREC *ro; /* intersected object */
43     double rot; /* distance to object */
44     FVECT rop; /* intersection point */
45     FVECT ron; /* intersection surface normal */
46     double rod; /* -DOT(rdir, ron) */
47 greg 1.4 FULLXF *rox; /* object transformation */
48 greg 1.1 FVECT pert; /* surface normal perturbation */
49     COLOR pcol; /* pattern color */
50     COLOR rcol; /* returned ray value */
51 greg 1.3 double rt; /* returned effective ray length */
52 greg 1.1 } RAY;
53    
54 greg 1.6 extern int raytrace();
55    
56 greg 1.1 extern double raynormal();
57 greg 1.5
58     extern int dimlist[]; /* dimension list for distribution */
59     extern int ndims; /* number of dimensions so far */
60     extern int samplendx; /* index for this sample */
61    
62 greg 2.2 #define MAXDIM 32 /* maximum number of dimensions */
63 greg 1.6
64     #define rayvalue(r) (*(r)->revf)(r)