--- ray/src/rt/m_mirror.c 1995/09/15 15:47:29 2.6 +++ ray/src/rt/m_mirror.c 2003/02/25 02:47:22 2.9 @@ -1,13 +1,12 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: m_mirror.c,v 2.9 2003/02/25 02:47:22 greg Exp $"; #endif - /* * Routines for mirror material supporting virtual light sources */ +#include "copyright.h" + #include "ray.h" #include "otypes.h" @@ -26,10 +25,12 @@ static char SCCSid[] = "$SunId$ LBL"; */ -int mir_proj(); +static int mir_proj(), mirrorproj(); + VSMATERIAL mirror_vs = {mir_proj, 1}; +int m_mirror(m, r) /* shade mirrored ray */ register OBJREC *m; register RAY *r; @@ -48,7 +49,7 @@ register RAY *r; raytrans(r); return(1); } - return(rayshade(r, modifier(m->oargs.sarg[0]))); + return(rayshade(r, lastmod(objndx(m), m->oargs.sarg[0]))); } /* check for bad source ray */ if (r->rsrc >= 0 && source[r->rsrc].so != r->ro) @@ -97,6 +98,7 @@ register RAY *r; } +static int mir_proj(pm, o, s, n) /* compute a mirror's projection */ MAT4 pm; register OBJREC *o; @@ -125,6 +127,7 @@ int n; } +static int mirrorproj(m, nv, offs) /* get mirror projection for surface */ register MAT4 m; FVECT nv;