171 |
|
|
172 |
|
if (v == NULL) |
173 |
|
return -1; |
174 |
< |
if ((v[2] < 0) | (v[2] > 1.)) |
174 |
> |
if ((v[2] < 0) | (v[2] > 1.00001)) |
175 |
|
return -1; |
176 |
|
pol = 180.0/M_PI*Acos(v[2]); |
177 |
|
azi = 180.0/M_PI*atan2(v[1], v[0]); |
709 |
|
/* separate diffuse components */ |
710 |
|
sd->rf = extract_diffuse(&sd->rLambFront, sd->rf); |
711 |
|
sd->rb = extract_diffuse(&sd->rLambBack, sd->rb); |
712 |
< |
if (sd->tf != NULL) |
713 |
< |
sd->tf = extract_diffuse(&sd->tLamb, sd->tf); |
714 |
< |
if (sd->tb != NULL) |
715 |
< |
sd->tb = extract_diffuse(&sd->tLamb, sd->tb); |
712 |
> |
sd->tf = extract_diffuse(&sd->tLambFront, sd->tf); |
713 |
> |
if (sd->tb != NULL) { |
714 |
> |
sd->tb = extract_diffuse(&sd->tLambBack, sd->tb); |
715 |
> |
if (sd->tf == NULL) |
716 |
> |
sd->tLambFront = sd->tLambBack; |
717 |
> |
} else if (sd->tf != NULL) |
718 |
> |
sd->tLambBack = sd->tLambFront; |
719 |
|
/* return success */ |
720 |
|
return SDEnone; |
721 |
|
} |
722 |
|
|
723 |
|
/* Get Matrix BSDF value */ |
724 |
|
static int |
725 |
< |
SDgetMtxBSDF(float coef[SDmaxCh], const FVECT outVec, |
726 |
< |
const FVECT inVec, SDComponent *sdc) |
725 |
> |
SDgetMtxBSDF(float coef[SDmaxCh], const FVECT inVec, |
726 |
> |
const FVECT outVec, SDComponent *sdc) |
727 |
|
{ |
728 |
|
const SDMat *dp; |
729 |
|
int i_ndx, o_ndx; |