1 |
|
#ifndef lint |
2 |
< |
static const char RCSid[] = "$Id$"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
|
* Shading functions for anisotropic materials. |
265 |
|
/* diffuse reflection */ |
266 |
|
nd.rdiff = 1.0 - nd.trans - nd.rspec; |
267 |
|
|
268 |
< |
if (r->ro != NULL && isflat(r->ro->otype)) |
268 |
> |
if (r->ro != NULL && isflat(r->ro->otype) && |
269 |
> |
DOT(r->pert,r->pert) <= FTINY*FTINY) |
270 |
|
nd.specfl |= SP_FLAT; |
271 |
|
|
272 |
|
getacoords(r, &nd); /* set up coordinates */ |
319 |
|
errno = 0; |
320 |
|
for (i = 0; i < 3; i++) |
321 |
|
np->u[i] = evalue(mf->ep[i]); |
322 |
< |
if (errno) { |
322 |
> |
if (errno == EDOM || errno == ERANGE) { |
323 |
|
objerror(np->mp, WARNING, "compute error"); |
324 |
|
np->specfl |= SP_BADU; |
325 |
|
return; |