ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bsdf_m.c
(Generate patch)

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.18 by greg, Thu Jul 7 15:25:09 2011 UTC vs.
Revision 3.22 by greg, Mon May 7 23:17:59 2012 UTC

# Line 46 | Line 46 | typedef struct {
46   static ANGLE_BASIS      abase_list[MAXABASES] = {
47          {
48                  "LBNL/Klems Full", 145,
49 <                { {-5., 1},
49 >                { {0., 1},
50                  {5., 8},
51                  {15., 16},
52                  {25., 20},
# Line 58 | Line 58 | static ANGLE_BASIS     abase_list[MAXABASES] = {
58                  {90., 0} }
59          }, {
60                  "LBNL/Klems Half", 73,
61 <                { {-6.5, 1},
61 >                { {0., 1},
62                  {6.5, 8},
63                  {19.5, 12},
64                  {32.5, 16},
# Line 68 | Line 68 | static ANGLE_BASIS     abase_list[MAXABASES] = {
68                  {90., 0} }
69          }, {
70                  "LBNL/Klems Quarter", 41,
71 <                { {-9., 1},
71 >                { {0., 1},
72                  {9., 8},
73                  {27., 12},
74                  {46., 12},
# Line 218 | Line 218 | io_getohm(int ndx, void *p)
218          if (li == last_li)                      /* cached latitude? */
219                  return last_ohm;
220          last_li = li;
221        theta1 = M_PI/180. * ab->lat[li+1].tmin;
222        if (ab->lat[li].nphis == 1)             /* special case */
223                return last_ohm = M_PI*(1. - sq(cos(theta1)));
221          theta = M_PI/180. * ab->lat[li].tmin;
222 +        theta1 = M_PI/180. * ab->lat[li+1].tmin;
223          return last_ohm = M_PI*(sq(cos(theta)) - sq(cos(theta1))) /
224                                  (double)ab->lat[li].nphis;
225   }
# Line 335 | Line 333 | load_angle_basis(ezxml_t wab)
333                                  ezxml_child(ezxml_child(wbb,
334                                          "ThetaBounds"), "UpperTheta")));
335                  if (!i)
336 <                        abase_list[nabases].lat[i].tmin =
339 <                                        -abase_list[nabases].lat[i+1].tmin;
336 >                        abase_list[nabases].lat[0].tmin = 0;
337                  else if (!fequal(atof(ezxml_txt(ezxml_child(ezxml_child(wbb,
338                                          "ThetaBounds"), "LowerTheta"))),
339                                  abase_list[nabases].lat[i].tmin)) {
# Line 639 | Line 636 | SDgetMtxBSDF(float coef[SDmaxCh], const FVECT outVec,
636          i_ndx = mBSDF_incndx(dp, inVec);
637          o_ndx = mBSDF_outndx(dp, outVec);
638                                          /* try reciprocity if necessary */
639 <        if ((i_ndx < 0) & (o_ndx < 0) && dp->ninc == dp->nout) {
639 >        if ((i_ndx < 0) & (o_ndx < 0)) {
640                  i_ndx = mBSDF_incndx(dp, outVec);
641                  o_ndx = mBSDF_outndx(dp, inVec);
642          }
# Line 748 | Line 745 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
745                  myCD.ob_vec = dp->ob_vec;
746                  myCD.calen = dp->nout;
747                  reverse = 0;
748 <        } else if (dp->ninc == dp->nout) {      /* try reciprocity */
748 >        } else {                        /* try reciprocity */
749                  myCD.indx = mBSDF_outndx(dp, inVec);
750                  if (myCD.indx < 0)
751                          return NULL;
# Line 759 | Line 756 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
756          }
757          cdlast = NULL;                  /* check for it in cache list */
758          for (cd = (SDMatCDst *)sdc->cdList; cd != NULL;
759 <                                cdlast = cd, cd = (SDMatCDst *)cd->next)
759 >                                        cdlast = cd, cd = cd->next)
760                  if (cd->indx == myCD.indx && (cd->calen == myCD.calen) &
761                                          (cd->ob_priv == myCD.ob_priv) &
762                                          (cd->ob_vec == myCD.ob_vec))
# Line 778 | Line 775 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
775          }
776          if (cdlast != NULL) {           /* move entry to head of cache list */
777                  cdlast->next = cd->next;
778 <                cd->next = sdc->cdList;
778 >                cd->next = (SDMatCDst *)sdc->cdList;
779                  sdc->cdList = (SDCDst *)cd;
780          }
781          return (SDCDst *)cd;            /* ready to go */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines