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

Method raycast

src/systems/BroadPhaseSystem.cpp:70–81  ·  view source on GitHub ↗

Ray casting method

Source from the content-addressed store, hash-verified

68
69// Ray casting method
70void BroadPhaseSystem::raycast(const Ray& ray, RaycastTest& raycastTest, unsigned short raycastWithCategoryMaskBits) const {
71
72 RP3D_PROFILE("BroadPhaseSystem::raycast()", mProfiler);
73
74 BroadPhaseRaycastCallback broadPhaseRaycastCallback(mDynamicAABBTree, raycastWithCategoryMaskBits, raycastTest);
75
76 // Compute the inverse ray direction
77 const Vector3 rayDirection = ray.point2 - ray.point1;
78 const Vector3 rayDirectionInverse(decimal(1.0) / rayDirection.x, decimal(1.0) / rayDirection.y, decimal(1.0) / rayDirection.z);
79
80 mDynamicAABBTree.raycast(ray, broadPhaseRaycastCallback);
81}
82
83// Add a collider into the broad-phase collision detection
84void BroadPhaseSystem::addCollider(Collider* collider, const AABB& aabb) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected