| 5261 | //---------------------------------------------------------------------------- |
| 5262 | |
| 5263 | void Player::_findContact( SceneObject **contactObject, |
| 5264 | VectorF *contactNormal, |
| 5265 | Vector<SceneObject*> *outOverlapObjects ) |
| 5266 | { |
| 5267 | Point3F pos; |
| 5268 | getTransform().getColumn(3,&pos); |
| 5269 | |
| 5270 | Box3F wBox; |
| 5271 | Point3F exp(0,0,sTractionDistance); |
| 5272 | wBox.minExtents = pos + mScaledBox.minExtents - exp; |
| 5273 | wBox.maxExtents.x = pos.x + mScaledBox.maxExtents.x; |
| 5274 | wBox.maxExtents.y = pos.y + mScaledBox.maxExtents.y; |
| 5275 | wBox.maxExtents.z = pos.z + mScaledBox.minExtents.z + sTractionDistance; |
| 5276 | |
| 5277 | static ClippedPolyList polyList; |
| 5278 | polyList.clear(); |
| 5279 | polyList.doConstruct(); |
| 5280 | polyList.mNormal.set(0.0f, 0.0f, 0.0f); |
| 5281 | polyList.setInterestNormal(Point3F(0.0f, 0.0f, -1.0f)); |
| 5282 | |
| 5283 | polyList.mPlaneList.setSize(6); |
| 5284 | polyList.mPlaneList[0].setYZ(wBox.minExtents, -1.0f); |
| 5285 | polyList.mPlaneList[1].setXZ(wBox.maxExtents, 1.0f); |
| 5286 | polyList.mPlaneList[2].setYZ(wBox.maxExtents, 1.0f); |
| 5287 | polyList.mPlaneList[3].setXZ(wBox.minExtents, -1.0f); |
| 5288 | polyList.mPlaneList[4].setXY(wBox.minExtents, -1.0f); |
| 5289 | polyList.mPlaneList[5].setXY(wBox.maxExtents, 1.0f); |
| 5290 | Box3F plistBox = wBox; |
| 5291 | |
| 5292 | // Expand build box as it will be used to collide with items. |
| 5293 | // PickupRadius will be at least the size of the box. |
| 5294 | F32 pd = (F32)mDataBlock->pickupDelta; |
| 5295 | wBox.minExtents.x -= pd; wBox.minExtents.y -= pd; |
| 5296 | wBox.maxExtents.x += pd; wBox.maxExtents.y += pd; |
| 5297 | wBox.maxExtents.z = pos.z + mScaledBox.maxExtents.z; |
| 5298 | |
| 5299 | // Build list from convex states here... |
| 5300 | CollisionWorkingList& rList = mConvex.getWorkingList(); |
| 5301 | CollisionWorkingList* pList = rList.wLink.mNext; |
| 5302 | while (pList != &rList) |
| 5303 | { |
| 5304 | Convex* pConvex = pList->mConvex; |
| 5305 | |
| 5306 | U32 objectMask = pConvex->getObject()->getTypeMask(); |
| 5307 | |
| 5308 | if ( ( objectMask & sCollisionMoveMask ) && |
| 5309 | !( objectMask & PhysicalZoneObjectType ) ) |
| 5310 | { |
| 5311 | Box3F convexBox = pConvex->getBoundingBox(); |
| 5312 | if (plistBox.isOverlapped(convexBox)) |
| 5313 | pConvex->getPolyList(&polyList); |
| 5314 | } |
| 5315 | else |
| 5316 | outOverlapObjects->push_back( pConvex->getObject() ); |
| 5317 | |
| 5318 | pList = pList->wLink.mNext; |
| 5319 | } |
| 5320 |
nothing calls this directly
no test coverage detected