94 |
|
RAY *rp; /* ray pointer */ |
95 |
|
OBJREC *mtp; /* material pointer */ |
96 |
|
MFUNC *mf; /* pointer to expression list */ |
97 |
+ |
OBJECT mto; /* material object index (or -2) */ |
98 |
|
int specfl; /* specularity flags, defined above */ |
99 |
|
FVECT ulocal; /* u-vector in local coordinates */ |
100 |
|
DCOMP rd, td; /* diffuse component params */ |
102 |
|
FVECT prdir; /* vector in transmitted direction */ |
103 |
|
} WGMDDAT; /* WGMD material data */ |
104 |
|
|
105 |
< |
#define clr_comps(wp) ((wp)->specfl = 0, \ |
105 |
> |
#define clr_comps(wp) ((wp)->specfl = 0, (wp)->mto = OVOID-1, \ |
106 |
|
(wp)->rd.mo.nam = (wp)->td.mo.nam = \ |
107 |
|
(wp)->rs.mo.nam = (wp)->ts.mo.nam = "") |
108 |
|
|
134 |
|
|
135 |
|
/* fill modifier values, using previous setting if found */ |
136 |
|
static int |
137 |
< |
fill_modval(MODVAL *mp, const WGMDDAT *wp) |
137 |
> |
fill_modval(MODVAL *mp, WGMDDAT *wp) |
138 |
|
{ |
139 |
|
if (mp == &wp->rd.mo) { /* special case (should be first) */ |
140 |
|
set_modval(mp, wp->mtp->omod, wp->rp); |
155 |
|
if (mp != &wp->ts.mo && !strcmp(mp->nam, wp->ts.mo.nam)) { |
156 |
|
*mp = wp->ts.mo; |
157 |
|
return(1); |
158 |
< |
} /* new modifier */ |
159 |
< |
return(set_modval(mp, lastmod(objndx(wp->mtp), mp->nam), wp->rp)); |
158 |
> |
} |
159 |
> |
if (wp->mto < OVOID) |
160 |
> |
wp->mto = objndx(wp->mtp); |
161 |
> |
/* new modifier */ |
162 |
> |
return(set_modval(mp, lastmod(wp->mto, mp->nam), wp->rp)); |
163 |
|
} |
164 |
|
|
165 |
|
/* set calculation context for given component of MAT_WGMDF */ |