11 |
|
supported by the Swiss National Science Foundation (SNSF, #147053) |
12 |
|
================================================================== |
13 |
|
|
14 |
– |
$Id$ |
14 |
|
*/ |
15 |
|
|
16 |
|
|
978 |
|
|
979 |
|
/* Straight replacement? */ |
980 |
|
if (!mat -> oargs.nsargs) { |
981 |
< |
mat = objptr(mat -> omod); |
982 |
< |
photonScatter [mat -> otype] (mat, rayIn); |
981 |
> |
/* Skip void modifier! */ |
982 |
> |
if (mat -> omod != OVOID) { |
983 |
> |
mat = objptr(mat -> omod); |
984 |
> |
photonScatter [mat -> otype] (mat, rayIn); |
985 |
> |
} |
986 |
|
|
987 |
|
return 0; |
988 |
|
} |
1253 |
|
if (errno) |
1254 |
|
objerror(mat, WARNING, "compute error"); |
1255 |
|
else { |
1256 |
< |
mat = objptr(mod [pmapRandom(rouletteState) < coef ? 0 : 1]); |
1257 |
< |
photonScatter [mat -> otype] (mat, rayIn); |
1256 |
> |
OBJECT mxMod = mod [pmapRandom(rouletteState) < coef ? 0 : 1]; |
1257 |
> |
|
1258 |
> |
if (mxMod != OVOID) { |
1259 |
> |
mat = objptr(mxMod); |
1260 |
> |
photonScatter [mat -> otype] (mat, rayIn); |
1261 |
> |
} |
1262 |
> |
else { |
1263 |
> |
/* Transfer ray if no modifier */ |
1264 |
> |
RAY rayOut; |
1265 |
> |
|
1266 |
> |
photonRay(rayIn, &rayOut, PMAP_XFER, NULL); |
1267 |
> |
tracePhoton(&rayOut); |
1268 |
> |
} |
1269 |
|
} |
1270 |
|
|
1271 |
|
return 0; |
1317 |
|
if (errno) |
1318 |
|
objerror(mat, WARNING, "compute error"); |
1319 |
|
else { |
1320 |
< |
mat = objptr(mod [pmapRandom(rouletteState) < coef ? 0 : 1]); |
1321 |
< |
photonScatter [mat -> otype] (mat, rayIn); |
1320 |
> |
OBJECT mxMod = mod [pmapRandom(rouletteState) < coef ? 0 : 1]; |
1321 |
> |
|
1322 |
> |
if (mxMod != OVOID) { |
1323 |
> |
mat = objptr(mxMod); |
1324 |
> |
photonScatter [mat -> otype] (mat, rayIn); |
1325 |
> |
} |
1326 |
> |
else { |
1327 |
> |
/* Transfer ray if no modifier */ |
1328 |
> |
RAY rayOut; |
1329 |
> |
|
1330 |
> |
photonRay(rayIn, &rayOut, PMAP_XFER, NULL); |
1331 |
> |
tracePhoton(&rayOut); |
1332 |
> |
} |
1333 |
|
} |
1334 |
|
|
1335 |
|
return 0; |
1368 |
|
if (errno) |
1369 |
|
objerror(mat, WARNING, "compute error"); |
1370 |
|
else { |
1371 |
< |
mat = objptr(mod [pmapRandom(rouletteState) < coef ? 0 : 1]); |
1372 |
< |
photonScatter [mat -> otype] (mat, rayIn); |
1371 |
> |
OBJECT mxMod = mod [pmapRandom(rouletteState) < coef ? 0 : 1]; |
1372 |
> |
|
1373 |
> |
if (mxMod != OVOID) { |
1374 |
> |
mat = objptr(mxMod); |
1375 |
> |
photonScatter [mat -> otype] (mat, rayIn); |
1376 |
> |
} |
1377 |
> |
else { |
1378 |
> |
/* Transfer ray if no modifier */ |
1379 |
> |
RAY rayOut; |
1380 |
> |
|
1381 |
> |
photonRay(rayIn, &rayOut, PMAP_XFER, NULL); |
1382 |
> |
tracePhoton(&rayOut); |
1383 |
> |
} |
1384 |
|
} |
1385 |
|
|
1386 |
|
return 0; |