7 |
|
|
8 |
|
#include <string.h> |
9 |
|
|
10 |
< |
#include "standard.h" |
10 |
> |
#include "rtio.h" |
11 |
> |
#include "rtmath.h" |
12 |
> |
#include "rterror.h" |
13 |
|
#include "octree.h" |
14 |
|
#include "object.h" |
15 |
|
#include "otypes.h" |
308 |
|
(vp->v[i] - mp->mcube.cuorg[i]) / |
309 |
|
mp->mcube.cusize); |
310 |
|
} |
311 |
< |
if (vp->fl & MT_N) |
311 |
> |
if (vp->fl & MT_N) /* assumes normalized! */ |
312 |
|
cv.norm = encodedir(vp->n); |
313 |
|
if (vp->fl & MT_UV) |
314 |
|
for (i = 0; i < 2; i++) { |
412 |
|
pn[i] = vid[i] >> 8; |
413 |
|
} |
414 |
|
/* normalize material index */ |
415 |
< |
if (mo != OVOID) |
415 |
> |
if (mo != OVOID) { |
416 |
|
if ((mo -= mp->mat0) >= mp->nmats) |
417 |
|
mp->nmats = mo+1; |
418 |
|
else if (mo < 0) |
419 |
|
error(INTERNAL, "modifier range error in addmeshtri"); |
420 |
+ |
} |
421 |
|
/* assign triangle */ |
422 |
|
if (pn[0] == pn[1] && pn[1] == pn[2]) { /* local case */ |
423 |
|
pp = &mp->patch[pn[0]]; |