Called for a broad-phase shape that has to be tested for raycast
| 226 | |
| 227 | // Called for a broad-phase shape that has to be tested for raycast |
| 228 | decimal BroadPhaseRaycastCallback::raycastBroadPhaseShape(int32 nodeId, const Ray& ray) { |
| 229 | |
| 230 | decimal hitFraction = decimal(-1.0); |
| 231 | |
| 232 | // Get the collider from the node |
| 233 | Collider* collider = static_cast<Collider*>(mDynamicAABBTree.getNodeDataPointer(nodeId)); |
| 234 | |
| 235 | // Check if the raycast filtering mask allows raycast against this shape and if world query is enabled for this collider |
| 236 | if ((mRaycastWithCategoryMaskBits & collider->getCollisionCategoryBits()) != 0 && collider->getIsWorldQueryCollider()) { |
| 237 | |
| 238 | // Ask the collision detection to perform a ray cast test against |
| 239 | // the collider of this node because the ray is overlapping |
| 240 | // with the shape in the broad-phase |
| 241 | hitFraction = mRaycastTest.raycastAgainstShape(collider, ray); |
| 242 | } |
| 243 | |
| 244 | return hitFraction; |
| 245 | } |
nothing calls this directly
no test coverage detected