| 743 | } |
| 744 | |
| 745 | void ConvexShape::buildConvex( const Box3F &box, Convex *convex ) |
| 746 | { |
| 747 | if ( mGeometry.faces.empty() ) |
| 748 | return; |
| 749 | |
| 750 | mConvexList->collectGarbage(); |
| 751 | |
| 752 | Box3F realBox = box; |
| 753 | mWorldToObj.mul( realBox ); |
| 754 | realBox.minExtents.convolveInverse( mObjScale ); |
| 755 | realBox.maxExtents.convolveInverse( mObjScale ); |
| 756 | |
| 757 | if ( realBox.isOverlapped( getObjBox() ) == false ) |
| 758 | return; |
| 759 | |
| 760 | // See if this convex exists in the working set already... |
| 761 | Convex *cc = 0; |
| 762 | CollisionWorkingList &wl = convex->getWorkingList(); |
| 763 | for ( CollisionWorkingList* itr = wl.wLink.mNext; itr != &wl; itr = itr->wLink.mNext ) |
| 764 | { |
| 765 | if ( itr->mConvex->getType() == ConvexShapeCollisionConvexType ) |
| 766 | { |
| 767 | ConvexShapeCollisionConvex *pConvex = static_cast<ConvexShapeCollisionConvex*>(itr->mConvex); |
| 768 | |
| 769 | if ( pConvex->pShape == this ) |
| 770 | { |
| 771 | cc = itr->mConvex; |
| 772 | return; |
| 773 | } |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | // Set up the convex... |
| 778 | |
| 779 | ConvexShapeCollisionConvex *cp = new ConvexShapeCollisionConvex(); |
| 780 | |
| 781 | mConvexList->registerObject( cp ); |
| 782 | convex->addToWorkingList( cp ); |
| 783 | |
| 784 | cp->mObject = this; |
| 785 | cp->pShape = this; |
| 786 | } |
| 787 | |
| 788 | bool ConvexShape::buildPolyList( PolyListContext context, AbstractPolyList *plist, const Box3F &box, const SphereF &sphere ) |
| 789 | { |
nothing calls this directly
no test coverage detected