726 |
|
if (thisray.ro == NULL) |
727 |
|
(*dev->comout)("ray hit nothing"); |
728 |
|
else { |
729 |
< |
OBJREC *mat = findmaterial(thisray.ro); |
730 |
< |
sprintf(buf, "ray hit %s%s %s \"%s\"", |
731 |
< |
thisray.rod < 0.0 ? "back of " : "", |
732 |
< |
mat==NULL ? VOIDID : mat->oname, |
729 |
> |
OBJREC *mat = NULL; |
730 |
> |
OBJREC *mod = NULL;; |
731 |
> |
char matspec[256]; |
732 |
> |
matspec[0] = '\0'; |
733 |
> |
if (thisray.ro->omod != OVOID) { |
734 |
> |
mod = objptr(thisray.ro->omod); |
735 |
> |
mat = findmaterial(mod); |
736 |
> |
} |
737 |
> |
if (thisray.rod < 0.0) |
738 |
> |
strcpy(matspec, "back of "); |
739 |
> |
if (mod != NULL) { |
740 |
> |
strcat(matspec, mod->oname); |
741 |
> |
if (mat != mod) |
742 |
> |
sprintf(matspec+strlen(matspec), " (%s)", |
743 |
> |
mat!=NULL ? mat->oname : VOIDID); |
744 |
> |
} else |
745 |
> |
strcat(matspec, VOIDID); |
746 |
> |
sprintf(buf, "ray hit %s %s \"%s\"", matspec, |
747 |
|
ofun[thisray.ro->otype].funame, |
748 |
|
thisray.ro->oname); |
749 |
|
if ((ino = objptr(thisray.robj)) != thisray.ro) |