423 |
|
|
424 |
|
if(QT_FLAG_IS_DONE(f)) |
425 |
|
return(TRUE); |
426 |
< |
/* |
426 |
> |
/* |
427 |
|
d = DOT(orig,dir)/sqrt(DOT(orig,orig)); |
428 |
|
VSUM(v,orig,dir,-d); |
429 |
|
*/ |
449 |
|
} |
450 |
|
|
451 |
|
|
452 |
< |
stVisit_poly(st,verts,l,root,func) |
452 |
> |
stVisit_poly(st,verts,l,root,func,n) |
453 |
|
STREE *st; |
454 |
|
FVECT *verts; |
455 |
|
LIST *l; |
456 |
|
unsigned int root; |
457 |
|
FUNC func; |
458 |
+ |
int n; |
459 |
|
{ |
460 |
|
int id0,id1,id2; |
461 |
|
FVECT tri[3]; |
468 |
|
VCOPY(tri[0],verts[id0]); |
469 |
|
VCOPY(tri[1],verts[id1]); |
470 |
|
VCOPY(tri[2],verts[id2]); |
471 |
< |
stRoot_visit_tri(st,root,tri,func); |
471 |
> |
stRoot_visit_tri(st,root,tri,func,n); |
472 |
|
id1 = id2; |
473 |
|
} |
474 |
|
} |
475 |
|
|
476 |
< |
stVisit_clip(st,i,verts,vcnt,l,cell,func) |
476 |
> |
stVisit_clip(st,i,verts,vcnt,l,cell,func,n) |
477 |
|
STREE *st; |
478 |
|
int i; |
479 |
|
FVECT *verts; |
481 |
|
LIST *l; |
482 |
|
unsigned int cell; |
483 |
|
FUNC func; |
484 |
+ |
int n; |
485 |
|
{ |
486 |
|
|
487 |
|
LIST *labove,*lbelow,*endb,*enda; |
573 |
|
if(LIST_NEXT(lbelow) && LIST_NEXT(LIST_NEXT(lbelow))) |
574 |
|
{ |
575 |
|
cellb = cell | (1 << i); |
576 |
< |
stVisit_poly(st,verts,lbelow,cellb,func); |
576 |
> |
stVisit_poly(st,verts,lbelow,cellb,func,n); |
577 |
|
} |
578 |
|
else |
579 |
|
free_list(lbelow); |
581 |
|
if(labove) |
582 |
|
{ |
583 |
|
if(LIST_NEXT(labove) && LIST_NEXT(LIST_NEXT(labove))) |
584 |
< |
stVisit_poly(st,verts,labove,cell,func); |
584 |
> |
stVisit_poly(st,verts,labove,cell,func,n); |
585 |
|
else |
586 |
|
free_list(labove); |
587 |
|
} |
593 |
|
if(LIST_NEXT(lbelow) && LIST_NEXT(LIST_NEXT(lbelow))) |
594 |
|
{ |
595 |
|
cellb = cell | (1 << i); |
596 |
< |
stVisit_clip(st,i+1,verts,vcnt,lbelow,cellb,func); |
596 |
> |
stVisit_clip(st,i+1,verts,vcnt,lbelow,cellb,func,n); |
597 |
|
} |
598 |
|
else |
599 |
|
free_list(lbelow); |
601 |
|
if(labove) |
602 |
|
{ |
603 |
|
if(LIST_NEXT(labove) && LIST_NEXT(LIST_NEXT(labove))) |
604 |
< |
stVisit_clip(st,i+1,verts,vcnt,labove,cell,func); |
604 |
> |
stVisit_clip(st,i+1,verts,vcnt,labove,cell,func,n); |
605 |
|
else |
606 |
|
free_list(labove); |
607 |
|
} |
609 |
|
|
610 |
|
} |
611 |
|
|
612 |
< |
stVisit(st,tri,func) |
612 |
> |
stVisit(st,tri,func,n) |
613 |
|
STREE *st; |
614 |
|
FVECT tri[3]; |
615 |
|
FUNC func; |
616 |
+ |
int n; |
617 |
|
{ |
618 |
|
int r0,r1,r2; |
619 |
|
LIST *l; |
622 |
|
r1 = stLocate_root(tri[1]); |
623 |
|
r2 = stLocate_root(tri[2]); |
624 |
|
if(r0 == r1 && r1==r2) |
625 |
< |
stRoot_visit_tri(st,r0,tri,func); |
625 |
> |
stRoot_visit_tri(st,r0,tri,func,n); |
626 |
|
else |
627 |
|
{ |
628 |
|
FVECT verts[ST_CLIP_VERTS]; |
636 |
|
l = add_data(l,1,NULL); |
637 |
|
l = add_data(l,2,NULL); |
638 |
|
cnt = 3; |
639 |
< |
stVisit_clip(st,0,verts,&cnt,l,0,func); |
639 |
> |
stVisit_clip(st,0,verts,&cnt,l,0,func,n); |
640 |
|
} |
641 |
|
} |
642 |
|
|
692 |
|
return(qt); |
693 |
|
} |
694 |
|
|
695 |
< |
stRoot_visit_tri(st,root,tri,f) |
695 |
> |
stRoot_visit_tri(st,root,tri,f,n) |
696 |
|
STREE *st; |
697 |
|
int root; |
698 |
|
FVECT tri[3]; |
699 |
|
FUNC f; |
700 |
+ |
int n; |
701 |
|
{ |
702 |
|
BCOORD b0[3],b1[3],b2[3]; |
703 |
|
BCOORD db10[3],db21[3],db02[3]; |
715 |
|
QT_SET_FLAG(ST_QT(st,root)); |
716 |
|
/* Visit cells that triangle intersects */ |
717 |
|
qtVisit_tri(root,qt,qtRoot[0],qtRoot[1],qtRoot[2], |
718 |
< |
b0,b1,b2,db10,db21,db02,MAXBCOORD2 >> 1,s0,s1,s2, sq0,sq1,sq2,f); |
718 |
> |
b0,b1,b2,db10,db21,db02,MAXBCOORD2 >> 1,s0,s1,s2, sq0,sq1,sq2,f,n); |
719 |
|
|
720 |
|
} |
721 |
|
|