MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / raycastBroadPhaseShape

Method raycastBroadPhaseShape

src/systems/BroadPhaseSystem.cpp:228–245  ·  view source on GitHub ↗

Called for a broad-phase shape that has to be tested for raycast

Source from the content-addressed store, hash-verified

226
227// Called for a broad-phase shape that has to be tested for raycast
228decimal 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}

Callers

nothing calls this directly

Calls 4

getNodeDataPointerMethod · 0.80
raycastAgainstShapeMethod · 0.80

Tested by

no test coverage detected