| 77 | } |
| 78 | |
| 79 | static bool testHandles(PxU32 size, const BpHandle* handles, const PxU32 capacity, const Bp::FilterGroup::Enum* groups, const PxBounds3* bounds, BitMap& bitmap) |
| 80 | { |
| 81 | if(!handles && size) |
| 82 | return false; |
| 83 | |
| 84 | /* ValType minVal=0; |
| 85 | ValType maxVal=0xffffffff;*/ |
| 86 | |
| 87 | for(PxU32 i=0;i<size;i++) |
| 88 | { |
| 89 | const BpHandle h = handles[i]; |
| 90 | |
| 91 | if(h>=capacity) |
| 92 | return false; |
| 93 | |
| 94 | // Array in ascending order of id. |
| 95 | if(i>0 && (h < handles[i-1])) |
| 96 | return false; |
| 97 | |
| 98 | if(groups && groups[h]==FilterGroup::eINVALID) |
| 99 | return false; |
| 100 | |
| 101 | bitmap.set(h); |
| 102 | |
| 103 | if(bounds) |
| 104 | { |
| 105 | for(PxU32 j=0;j<3;j++) |
| 106 | { |
| 107 | //Max must be greater than min. |
| 108 | if(bounds[h].minimum[j]>bounds[h].maximum[j]) |
| 109 | return false; |
| 110 | #if 0 |
| 111 | //Bounds have an upper limit. |
| 112 | if(bounds[created[i]].getMax(j)>=maxVal) |
| 113 | return false; |
| 114 | |
| 115 | //Bounds have a lower limit. |
| 116 | if(bounds[created[i]].getMin(j)<=minVal) |
| 117 | return false; |
| 118 | |
| 119 | //Max must be odd. |
| 120 | if(4 != (bounds[created[i]].getMax(j) & 4)) |
| 121 | return false; |
| 122 | |
| 123 | //Min must be even. |
| 124 | if(0 != (bounds[created[i]].getMin(j) & 4)) |
| 125 | return false; |
| 126 | #endif |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | return true; |
| 131 | } |
| 132 | |
| 133 | static bool testBitmap(const BitMap& bitmap, PxU32 size, const BpHandle* handles) |
| 134 | { |