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 */ |
41 |
|
int rsrc; /* source we're aiming for */ |
42 |
|
OBJECT *clipset; /* set of objects currently clipped */ |
43 |
|
OBJECT *newcset; /* next clipset, used for transmission */ |
44 |
< |
void (*revf)(); /* evaluation function for this ray */ |
44 |
< |
void (*hitf)(); /* custom hit test for this traversal */ |
44 |
> |
void (*hitf)(OBJECT *, struct ray *); /* custom hit test */ |
45 |
|
OBJECT robj; /* intersected object number */ |
46 |
|
OBJREC *ro; /* intersected object (one with material) */ |
47 |
|
double rot; /* distance to object */ |
49 |
|
FVECT ron; /* intersection surface normal */ |
50 |
|
double rod; /* -DOT(rdir, ron) */ |
51 |
|
FULLXF *rox; /* object transformation */ |
52 |
+ |
RREAL uv[2]; /* local coordinates */ |
53 |
|
FVECT pert; /* surface normal perturbation */ |
54 |
|
COLOR pcol; /* pattern color */ |
55 |
< |
COLOR rcol; /* returned ray value */ |
55 |
> |
COLOR rcol; /* returned radiance value */ |
56 |
|
double rt; /* returned effective ray length */ |
57 |
|
COLOR cext; /* medium extinction coefficient */ |
58 |
|
COLOR albedo; /* medium scattering albedo */ |
60 |
|
int *slights; /* list of lights to test for scattering */ |
61 |
|
} RAY; |
62 |
|
|
62 |
– |
#define rayvalue(r) (*(r)->revf)(r) |
63 |
– |
|
63 |
|
extern char VersionID[]; /* Radiance version ID string */ |
64 |
|
|
65 |
|
extern CUBE thescene; /* our scene */ |
116 |
|
extern int ray_pnprocs; /* number of child processes */ |
117 |
|
extern int ray_pnidle; /* number of idle processes */ |
118 |
|
|
119 |
< |
#define AMBLLEN 128 /* max. ambient list length */ |
120 |
< |
#define AMBWORD 8 /* average word length */ |
119 |
> |
#ifndef AMBLLEN |
120 |
> |
#define AMBLLEN 512 /* max. ambient list length */ |
121 |
> |
#endif |
122 |
> |
#define AMBWORD 12 /* average word length */ |
123 |
|
|
124 |
|
typedef struct { /* rendering parameter holder */ |
125 |
|
int do_irrad; |
155 |
|
#define rpambmod(p,i) ( (i)>=AMBLLEN||(p)->amblndx[i]<0 ? \ |
156 |
|
(char *)NULL : (p)->amblval+(p)->amblndx[i] ) |
157 |
|
|
157 |
– |
#ifdef NOPROTO |
158 |
– |
|
159 |
– |
extern void headclean(); |
160 |
– |
extern void openheader(); |
161 |
– |
extern void dupheader(); |
162 |
– |
extern void pfdetach(); |
163 |
– |
extern void pfclean(); |
164 |
– |
extern void pflock(); |
165 |
– |
extern void pfhold(); |
166 |
– |
extern void io_process(); |
167 |
– |
extern int free_objs(); |
168 |
– |
extern void free_objmem(); |
169 |
– |
extern int load_os(); |
170 |
– |
extern void preload_objs(); |
171 |
– |
extern void ray_init(); |
172 |
– |
extern void ray_trace(); |
173 |
– |
extern void ray_done(); |
174 |
– |
extern void ray_save(); |
175 |
– |
extern void ray_restore(); |
176 |
– |
extern void ray_defaults(); |
177 |
– |
extern void ray_pinit(); |
178 |
– |
extern void ray_psend(); |
179 |
– |
extern int ray_pqueue(); |
180 |
– |
extern int ray_presult(); |
181 |
– |
extern void ray_pdone(); |
182 |
– |
extern void ray_popen(); |
183 |
– |
extern void ray_pclose(); |
184 |
– |
extern int rayorigin(); |
185 |
– |
extern void rayclear(); |
186 |
– |
extern void raytrace(); |
187 |
– |
extern void rayhit(); |
188 |
– |
extern void raycont(); |
189 |
– |
extern void raytrans(); |
190 |
– |
extern int rayshade(); |
191 |
– |
extern void rayparticipate(); |
192 |
– |
extern int raymixture(); |
193 |
– |
extern double raydist(); |
194 |
– |
extern double raynormal(); |
195 |
– |
extern void newrayxf(); |
196 |
– |
extern void flipsurface(); |
197 |
– |
extern int localhit(); |
198 |
– |
extern int getrenderopt(); |
199 |
– |
extern void print_rdefaults(); |
200 |
– |
extern void drawsources(); |
201 |
– |
extern void rtrace(); |
202 |
– |
extern void rview(); |
203 |
– |
extern void rpict(); |
204 |
– |
|
205 |
– |
#else |
158 |
|
/* defined in duphead.c */ |
159 |
|
extern void headclean(void); |
160 |
|
extern void openheader(void); |
161 |
|
extern void dupheader(void); |
162 |
+ |
/* defined in persist.c */ |
163 |
+ |
extern void persistfile(char *pfn); |
164 |
|
extern void pfdetach(void); |
165 |
|
extern void pfclean(void); |
166 |
|
extern void pflock(int lf); |
190 |
|
/* defined in raytrace.c */ |
191 |
|
extern int rayorigin(RAY *r, RAY *ro, int rt, double rw); |
192 |
|
extern void rayclear(RAY *r); |
193 |
< |
extern void raytrace(RAY *r); |
193 |
> |
extern void rayvalue(RAY *r); |
194 |
|
extern void rayhit(OBJECT *oset, RAY *r); |
195 |
|
extern void raycont(RAY *r); |
196 |
|
extern void raytrans(RAY *r); |
197 |
|
extern int rayshade(RAY *r, int mod); |
198 |
|
extern void rayparticipate(RAY *r); |
199 |
+ |
extern void raytexture(RAY *r, OBJECT mod); |
200 |
|
extern int raymixture(RAY *r, OBJECT fore, OBJECT back, double coef); |
201 |
|
extern double raydist(RAY *r, int flags); |
202 |
|
extern double raynormal(FVECT norm, RAY *r); |
209 |
|
/* defined in srcdraw.c */ |
210 |
|
extern void drawsources(COLOR *pic[], float *zbf[], |
211 |
|
int x0, int xsiz, int y0, int ysiz); |
212 |
+ |
extern void init_drawsources(int rad); |
213 |
+ |
/* defined in rt/initotypes.c */ |
214 |
+ |
extern void initotypes(void); |
215 |
|
/* module main procedures */ |
216 |
|
extern void rtrace(char *fname); |
217 |
+ |
extern char * formstr(int f); |
218 |
|
extern void rview(void); |
219 |
|
extern void rpict(int seq, char *pout, char *zout, char *prvr); |
220 |
|
|
221 |
+ |
|
222 |
+ |
#ifdef __cplusplus |
223 |
+ |
} |
224 |
|
#endif |
225 |
+ |
#endif /* _RAD_RAY_H_ */ |
226 |
+ |
|