| 367 |
|
hdworld(org, hp, cgp); |
| 368 |
|
/* compute direction to voxel center */ |
| 369 |
|
for (i = 3; i--; ) |
| 370 |
< |
vgp[i] = voxel[cap->vi].i[i] + 0.5; |
| 370 |
> |
vgp[i] = voxel[cap->vi].i[i] + .5; |
| 371 |
|
hdworld(vc, hp, vgp); |
| 372 |
|
for (i = 3; i--; ) |
| 373 |
|
vc[i] -= org[i]; |
| 375 |
|
axmax = -1; avmax = 0; |
| 376 |
|
for (i = 3; i--; ) { |
| 377 |
|
d = vgp[i] - cgp[i]; |
| 378 |
< |
if (d < 0) d = -d; |
| 378 |
> |
if (d < 0.) d = -d; |
| 379 |
|
if (d > avmax) { |
| 380 |
|
avmax = d; |
| 381 |
|
axmax = i; |
| 382 |
|
} |
| 383 |
|
} |
| 384 |
|
#ifdef DEBUG |
| 385 |
< |
if (axmax < 0) |
| 385 |
> |
if (axmax < 0.) |
| 386 |
|
error(CONSISTENCY, "botched axis computation in docell"); |
| 387 |
|
#endif |
| 388 |
|
/* compute offset vectors */ |
| 390 |
|
for (i = 3; i--; ) |
| 391 |
|
v1[i] = hp->xv[j][i] * d; |
| 392 |
|
d = 0.5/hp->grid[j=(axmax+2)%3]; |
| 393 |
< |
if (DOT(hp->wn[axmax], vc) < 0) |
| 393 |
> |
if (DOT(hp->wn[axmax], vc) < 0.) |
| 394 |
|
d = -d; /* reverse vertex ordering */ |
| 395 |
|
for (i = 3; i--; ) |
| 396 |
|
v2[i] = hp->xv[j][i] * d; |
| 440 |
|
ngcp = ngcl = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew); |
| 441 |
|
/* set up actions */ |
| 442 |
|
oca.vi = nca.vi = voxi; |
| 443 |
– |
oca.rev = nca.rev = 0; |
| 443 |
|
oca.add = 0; nca.add = 1; |
| 444 |
|
if ((oca.rev = ocnt < 0)) |
| 445 |
|
ocnt = -ocnt; |
| 469 |
|
} |
| 470 |
|
|
| 471 |
|
|
| 472 |
+ |
int |
| 473 |
|
beam_sync() /* synchronize beams on server */ |
| 474 |
|
{ |
| 475 |
|
cbeamop(DR_NEWSET, cbeam, ncbeams, &odev.v, odev.hres, odev.vres); |
| 476 |
+ |
return(ncbeams); |
| 477 |
|
} |
| 478 |
|
|
| 479 |
|
|