137 |
|
|
138 |
|
|
139 |
|
static void setPhotonPortNormal (EmissionMap* emap) |
140 |
< |
/* Set normal for current photon port partition based on its orientation */ |
140 |
> |
/* Set normal for current photon port partition (if defined) based on its |
141 |
> |
* orientation */ |
142 |
|
{ |
142 |
– |
/* Extract photon port orientation flags, set surface normal as follows: |
143 |
– |
-- Port oriented forwards --> flip surface normal to point |
144 |
– |
outwards, since normal points inwards per mkillum convention) |
145 |
– |
-- Port oriented backwards --> surface normal is NOT flipped, |
146 |
– |
since it already points inwards. |
147 |
– |
-- Port is bidirectionally/bilaterally oriented --> flip normal based |
148 |
– |
on the parity of the current partition emap -> partitionCnt. |
149 |
– |
In this case, photon emission alternates between port front/back |
150 |
– |
faces for consecutive partitions. |
151 |
– |
*/ |
152 |
– |
int i, portFlags = PMAP_GETPORTFLAGS(emap -> port -> sflags); |
143 |
|
|
144 |
< |
if ( |
145 |
< |
portFlags == PMAP_PORTFWD || |
146 |
< |
portFlags == PMAP_PORTBI && !(emap -> partitionCnt & 1) |
147 |
< |
) |
148 |
< |
for (i = 0; i < 3; i++) |
149 |
< |
emap -> ws [i] = -emap -> ws [i]; |
144 |
> |
int i, portFlags; |
145 |
> |
|
146 |
> |
if (emap -> port) { |
147 |
> |
/* Extract photon port orientation flags, set surface normal as follows: |
148 |
> |
-- Port oriented forwards --> flip surface normal to point outwards, |
149 |
> |
since normal points inwards per mkillum convention) |
150 |
> |
-- Port oriented backwards --> surface normal is NOT flipped, since |
151 |
> |
it already points inwards. |
152 |
> |
-- Port is bidirectionally/bilaterally oriented --> flip normal based |
153 |
> |
on the parity of the current partition emap -> partitionCnt. In |
154 |
> |
this case, photon emission alternates between port front/back |
155 |
> |
faces for consecutive partitions. |
156 |
> |
*/ |
157 |
> |
portFlags = PMAP_GETPORTFLAGS(emap -> port -> sflags); |
158 |
> |
|
159 |
> |
if ( |
160 |
> |
portFlags == PMAP_PORTFWD || |
161 |
> |
portFlags == PMAP_PORTBI && !(emap -> partitionCnt & 1) |
162 |
> |
) |
163 |
> |
for (i = 0; i < 3; i++) |
164 |
> |
emap -> ws [i] = -emap -> ws [i]; |
165 |
> |
} |
166 |
|
} |
167 |
|
|
168 |
|
|