ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/mx_func.c
Revision: 1.2
Committed: Thu Aug 8 11:29:54 1991 UTC (32 years, 8 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.1: +1 -2 lines
Log Message:
added contexts to function files

File Contents

# Content
1 /* Copyright (c) 1988 Regents of the University of California */
2
3 #ifndef lint
4 static char SCCSid[] = "$SunId$ LBL";
5 #endif
6
7 /*
8 * mx_func.c - routine for mixture functions.
9 *
10 * 11/2/88
11 */
12
13 #include "ray.h"
14
15 /*
16 * A mixture function is specified:
17 *
18 * modifier mixfunc name
19 * 4+ foremod backmod varname vfname xf
20 * 0
21 * n A1 A2 ..
22 *
23 * Vfname is the name of the file where the variable definition
24 * can be found. The list of real arguments can be accessed by
25 * definitions in the file. The xf is a transformation
26 * to get from the original coordinates to the current coordinates.
27 */
28
29
30 mx_func(m, r) /* compute mixture function */
31 register OBJREC *m;
32 RAY *r;
33 {
34 extern double varvalue();
35 extern int errno;
36 register int i;
37 double coef;
38 OBJECT mod[2];
39 register char **sa;
40
41 setfunc(m, r);
42
43 sa = m->oargs.sarg;
44
45 if (m->oargs.nsargs < 4)
46 objerror(m, USER, "bad # arguments");
47 for (i = 0; i < 2; i++)
48 if (!strcmp(sa[i], VOIDID))
49 mod[i] = OVOID;
50 else if ((mod[i] = modifier(sa[i])) == OVOID) {
51 sprintf(errmsg, "undefined modifier \"%s\"", sa[i]);
52 objerror(m, USER, errmsg);
53 }
54 funcfile(sa[3]);
55 errno = 0;
56 coef = varvalue(sa[2]);
57 if (errno) {
58 objerror(m, WARNING, "compute error");
59 return;
60 }
61 raymixture(r, mod[0], mod[1], coef);
62 }