| 648 | } |
| 649 | |
| 650 | bool WaterBlock::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& ) |
| 651 | { |
| 652 | if(context == PLC_Navigation && box.isOverlapped(mWorldBox)) |
| 653 | { |
| 654 | polyList->setObject( this ); |
| 655 | MatrixF mat(true); |
| 656 | Point3F pos = getPosition(); |
| 657 | pos.x = pos.y = 0; |
| 658 | mat.setPosition(pos); |
| 659 | polyList->setTransform( &mat, Point3F(1, 1, 1) ); |
| 660 | |
| 661 | Box3F ov = box.getOverlap(mWorldBox); |
| 662 | Point3F |
| 663 | p0(ov.minExtents.x, ov.maxExtents.y, 0), |
| 664 | p1(ov.maxExtents.x, ov.maxExtents.y, 0), |
| 665 | p2(ov.maxExtents.x, ov.minExtents.y, 0), |
| 666 | p3(ov.minExtents.x, ov.minExtents.y, 0); |
| 667 | |
| 668 | // Add vertices to poly list. |
| 669 | U32 v0 = polyList->addPoint(p0); |
| 670 | polyList->addPoint(p1); |
| 671 | polyList->addPoint(p2); |
| 672 | polyList->addPoint(p3); |
| 673 | |
| 674 | // Add plane between first three vertices. |
| 675 | polyList->begin(0, 0); |
| 676 | polyList->vertex(v0); |
| 677 | polyList->vertex(v0+1); |
| 678 | polyList->vertex(v0+2); |
| 679 | polyList->plane(v0, v0+1, v0+2); |
| 680 | polyList->end(); |
| 681 | |
| 682 | // Add plane between last three vertices. |
| 683 | polyList->begin(0, 1); |
| 684 | polyList->vertex(v0+2); |
| 685 | polyList->vertex(v0+3); |
| 686 | polyList->vertex(v0); |
| 687 | polyList->plane(v0+2, v0+3, v0); |
| 688 | polyList->end(); |
| 689 | |
| 690 | return true; |
| 691 | } |
| 692 | |
| 693 | return false; |
| 694 | } |
| 695 | |
| 696 | F32 WaterBlock::getWaterCoverage( const Box3F &testBox ) const |
| 697 | { |
nothing calls this directly
no test coverage detected