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}, |
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}, |
68 |
|
{90., 0} } |
69 |
|
}, { |
70 |
|
"LBNL/Klems Quarter", 41, |
71 |
< |
{ {-9., 1}, |
71 |
> |
{ {0., 1}, |
72 |
|
{9., 8}, |
73 |
|
{27., 12}, |
74 |
|
{46., 12}, |
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 |
|
} |
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)) { |
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 |
|
} |
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; |
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)) |
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 */ |