--- ray/src/rt/raytrace.c 1995/01/26 15:34:55 2.19 +++ ray/src/rt/raytrace.c 1995/11/02 17:38:02 2.21 @@ -195,8 +195,11 @@ int mod; error(USER, errmsg); } ******/ - if ((*ofun[m->otype].funp)(m, r)) - objerror(r->ro, USER, "conflicting materials"); + if ((*ofun[m->otype].funp)(m, r)) { + sprintf(errmsg, "conflicting material \"%s\"", + m->oname); + objerror(r->ro, USER, errmsg); + } } depth--; /* end here */ } @@ -253,6 +256,21 @@ double coef; } /* return value tells if material */ return(foremat); +} + + +double +raydist(r, flags) /* compute (cumulative) ray distance */ +register RAY *r; +register int flags; +{ + double sum = 0.0; + + while (r != NULL && r->crtype&flags) { + sum += r->rot; + r = r->parent; + } + return(sum); }