| 384 | |
| 385 | |
| 386 | float World::getProximity(const fvec3& p, float radius) const { |
| 387 | const float r = (radius * 1.2f); |
| 388 | |
| 389 | // get maximum over all teleporters |
| 390 | float bestProximity = 0.0; |
| 391 | |
| 392 | const Extents exts(fvec3(p.x - r, p.y - r, p.z - r), |
| 393 | fvec3(p.x + r, p.y + r, p.z + r)); |
| 394 | const ObsList* oList = COLLISIONMGR.axisBoxTest(exts); |
| 395 | const int count = oList->count; |
| 396 | |
| 397 | for (int i = 0; i < count; i++) { |
| 398 | const Obstacle* obs = oList->list[i]; |
| 399 | if (obs->getTypeID() == faceType) { |
| 400 | const MeshFace* face = (const MeshFace*)obs; |
| 401 | if (face->isLinkSrc() && !face->linkSrcNoGlow() && |
| 402 | (face->isDriveThrough() || face->linkSrcTouch())) { |
| 403 | const float proximity = face->getProximity(p, r); |
| 404 | if (proximity > bestProximity) { |
| 405 | bestProximity = proximity; |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | return bestProximity; |
| 412 | } |
| 413 | |
| 414 | |
| 415 | void World::freeFlags() { |
no test coverage detected