| 178 | } |
| 179 | |
| 180 | U32 OptimizedPolyList::insertPlane(const PlaneF& plane) |
| 181 | { |
| 182 | S32 retIdx = -1; |
| 183 | |
| 184 | // Apply the transform |
| 185 | PlaneF transPlane; |
| 186 | mPlaneTransformer.transform(plane, transPlane); |
| 187 | |
| 188 | for (U32 i = 0; i < mPlaneList.size(); i++) |
| 189 | { |
| 190 | if (mPlaneList[i].equal(transPlane) && |
| 191 | mFabs( mPlaneList[i].d - transPlane.d ) < POINT_EPSILON) |
| 192 | { |
| 193 | retIdx = i; |
| 194 | break; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | if (retIdx == -1) |
| 199 | { |
| 200 | retIdx = mPlaneList.size(); |
| 201 | mPlaneList.push_back(transPlane); |
| 202 | } |
| 203 | |
| 204 | return (U32)retIdx; |
| 205 | } |
| 206 | |
| 207 | U32 OptimizedPolyList::insertMaterial(BaseMatInstance* baseMat) |
| 208 | { |