| 263 | } |
| 264 | |
| 265 | void GroundPlane::buildConvex( const Box3F& box, Convex* convex ) |
| 266 | { |
| 267 | mConvexList->collectGarbage(); |
| 268 | |
| 269 | Box3F planeBox = getPlaneBox(); |
| 270 | if ( !box.isOverlapped( planeBox ) ) |
| 271 | return; |
| 272 | |
| 273 | // See if we already have a convex in the working set. |
| 274 | BoxConvex *boxConvex = NULL; |
| 275 | CollisionWorkingList &wl = convex->getWorkingList(); |
| 276 | CollisionWorkingList *itr = wl.wLink.mNext; |
| 277 | for ( ; itr != &wl; itr = itr->wLink.mNext ) |
| 278 | { |
| 279 | if ( itr->mConvex->getType() == BoxConvexType && |
| 280 | itr->mConvex->getObject() == this ) |
| 281 | { |
| 282 | boxConvex = (BoxConvex*)itr->mConvex; |
| 283 | break; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | if ( !boxConvex ) |
| 288 | { |
| 289 | boxConvex = new BoxConvex; |
| 290 | mConvexList->registerObject( boxConvex ); |
| 291 | boxConvex->init( this ); |
| 292 | |
| 293 | convex->addToWorkingList( boxConvex ); |
| 294 | } |
| 295 | |
| 296 | // Update our convex to best match the queried box |
| 297 | if ( boxConvex ) |
| 298 | { |
| 299 | Point3F queryCenter = box.getCenter(); |
| 300 | |
| 301 | boxConvex->mCenter = Point3F( queryCenter.x, queryCenter.y, -GROUND_PLANE_BOX_HEIGHT_HALF ); |
| 302 | boxConvex->mSize = Point3F( box.getExtents().x, |
| 303 | box.getExtents().y, |
| 304 | GROUND_PLANE_BOX_HEIGHT_HALF ); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | bool GroundPlane::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& ) |
| 309 | { |
nothing calls this directly
no test coverage detected