1 |
– |
/* Copyright (c) 1994 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Routines for light-redirecting materials and |
6 |
|
* their associated virtual light sources |
7 |
|
*/ |
8 |
|
|
9 |
+ |
#include "copyright.h" |
10 |
+ |
|
11 |
|
#include "ray.h" |
12 |
|
|
13 |
|
#include "otypes.h" |
31 |
|
*/ |
32 |
|
|
33 |
|
|
34 |
< |
int dir_proj(); |
34 |
> |
static int dir_proj(); |
35 |
> |
|
36 |
|
VSMATERIAL direct1_vs = {dir_proj, 1}; |
37 |
|
VSMATERIAL direct2_vs = {dir_proj, 2}; |
38 |
|
|
41 |
|
getfunc(m, 8, 0xff, 1) ) |
42 |
|
|
43 |
|
|
44 |
+ |
int |
45 |
|
m_direct(m, r) /* shade redirected ray */ |
46 |
|
register OBJREC *m; |
47 |
|
register RAY *r; |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
+ |
int |
65 |
|
redirect(m, r, n) /* compute n'th ray redirection */ |
66 |
|
OBJREC *m; |
67 |
|
RAY *r; |
122 |
|
rayvalue(&nr); |
123 |
|
scalecolor(nr.rcol, coef); |
124 |
|
addcolor(r->rcol, nr.rcol); |
125 |
+ |
if (r->ro != NULL && isflat(r->ro->otype)) |
126 |
+ |
r->rt = r->rot + nr.rt; |
127 |
|
return(1); |
128 |
|
computerr: |
129 |
|
objerror(m, WARNING, "compute error"); |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
+ |
static int |
135 |
|
dir_proj(pm, o, s, n) /* compute a director's projection */ |
136 |
|
MAT4 pm; |
137 |
|
OBJREC *o; |