| 13 |
|
#include "rhdriver.h" |
| 14 |
|
|
| 15 |
|
#ifndef MAXDIST |
| 16 |
< |
#define MAXDIST 13 /* maximum distance outside section */ |
| 16 |
> |
#define MAXDIST 42 /* maximum distance outside section */ |
| 17 |
|
#endif |
| 18 |
|
|
| 19 |
|
extern GCOORD *getviewcells(); |
| 94 |
|
|
| 95 |
|
if (!cb1->wants) /* put orphans at the end, unsorted */ |
| 96 |
|
return(cb2->wants); |
| 97 |
+ |
if (!cb2->wants) |
| 98 |
+ |
return(-1); |
| 99 |
|
if ((c = cb1->bi - cb2->bi)) /* sort on beam index first */ |
| 100 |
|
return(c); |
| 101 |
|
return(cb1->hd - cb2->hd); /* use hd to resolve matches */ |
| 369 |
|
hdworld(org, hp, cgp); |
| 370 |
|
/* compute direction to voxel center */ |
| 371 |
|
for (i = 3; i--; ) |
| 372 |
< |
vgp[i] = voxel[cap->vi].i[i] + 0.5; |
| 372 |
> |
vgp[i] = voxel[cap->vi].i[i] + .5; |
| 373 |
|
hdworld(vc, hp, vgp); |
| 374 |
|
for (i = 3; i--; ) |
| 375 |
|
vc[i] -= org[i]; |
| 377 |
|
axmax = -1; avmax = 0; |
| 378 |
|
for (i = 3; i--; ) { |
| 379 |
|
d = vgp[i] - cgp[i]; |
| 380 |
< |
if (d < 0) d = -d; |
| 380 |
> |
if (d < 0.) d = -d; |
| 381 |
|
if (d > avmax) { |
| 382 |
|
avmax = d; |
| 383 |
|
axmax = i; |
| 384 |
|
} |
| 385 |
|
} |
| 386 |
|
#ifdef DEBUG |
| 387 |
< |
if (axmax < 0) |
| 387 |
> |
if (axmax < 0.) |
| 388 |
|
error(CONSISTENCY, "botched axis computation in docell"); |
| 389 |
|
#endif |
| 390 |
|
/* compute offset vectors */ |
| 392 |
|
for (i = 3; i--; ) |
| 393 |
|
v1[i] = hp->xv[j][i] * d; |
| 394 |
|
d = 0.5/hp->grid[j=(axmax+2)%3]; |
| 395 |
< |
if (DOT(hp->wn[axmax], vc) < 0) |
| 395 |
> |
if (DOT(hp->wn[axmax], vc) < 0.) |
| 396 |
|
d = -d; /* reverse vertex ordering */ |
| 397 |
|
for (i = 3; i--; ) |
| 398 |
|
v2[i] = hp->xv[j][i] * d; |
| 442 |
|
ngcp = ngcl = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew); |
| 443 |
|
/* set up actions */ |
| 444 |
|
oca.vi = nca.vi = voxi; |
| 443 |
– |
oca.rev = nca.rev = 0; |
| 445 |
|
oca.add = 0; nca.add = 1; |
| 446 |
|
if ((oca.rev = ocnt < 0)) |
| 447 |
|
ocnt = -ocnt; |
| 471 |
|
} |
| 472 |
|
|
| 473 |
|
|
| 474 |
+ |
int |
| 475 |
|
beam_sync() /* synchronize beams on server */ |
| 476 |
|
{ |
| 477 |
|
cbeamop(DR_NEWSET, cbeam, ncbeams, &odev.v, odev.hres, odev.vres); |
| 478 |
+ |
return(ncbeams); |
| 479 |
|
} |
| 480 |
|
|
| 481 |
|
|
| 486 |
|
VOXL vlnew[8]; |
| 487 |
|
int n, comn; |
| 488 |
|
|
| 489 |
< |
if (!vn->type) { /* clear our beam list */ |
| 489 |
> |
if (vn == NULL || !vn->type) { /* clear our beam list */ |
| 490 |
|
set_voxels(vlnew, 0); |
| 491 |
|
cbeamop(DR_DELSET, cbeam, ncbeams, NULL, 0, 0); |
| 492 |
|
ncbeams = 0; |
| 493 |
< |
copystruct(&dvw, vn); |
| 493 |
> |
dvw.type = 0; |
| 494 |
|
return(1); |
| 495 |
|
} |
| 496 |
|
/* find our new voxels */ |