| 311 | } |
| 312 | |
| 313 | static bool PxcTestAxis(const PxVec3& axis, const Segment& segment, PxReal radius, const Box& box, PxReal& depth) |
| 314 | { |
| 315 | // Project capsule |
| 316 | PxReal min0 = segment.p0.dot(axis); |
| 317 | PxReal max0 = segment.p1.dot(axis); |
| 318 | if(min0>max0) Ps::swap(min0, max0); |
| 319 | min0 -= radius; |
| 320 | max0 += radius; |
| 321 | |
| 322 | // Project box |
| 323 | PxReal Min1, Max1; |
| 324 | projectBox(Min1, Max1, axis, box); |
| 325 | |
| 326 | // Test projections |
| 327 | if(max0<Min1 || Max1<min0) |
| 328 | return false; |
| 329 | |
| 330 | const PxReal d0 = max0 - Min1; |
| 331 | PX_ASSERT(d0>=0.0f); |
| 332 | const PxReal d1 = Max1 - min0; |
| 333 | PX_ASSERT(d1>=0.0f); |
| 334 | depth = physx::intrinsics::selectMin(d0, d1); |
| 335 | return true; |
| 336 | } |
| 337 | |
| 338 | static bool PxcCapsuleOBBOverlap3(const Segment& segment, PxReal radius, const Box& box, PxReal* t=NULL, PxVec3* pp=NULL) |
| 339 | { |
no test coverage detected