Appearance
Type Alias: WorldRayCastCallback()
WorldRayCastCallback = (
fixture,point,normal,fraction) =>number
Callback function for ray casts, see World.rayCast.
Called for each fixture found in the query. The returned value replaces the ray-cast input maxFraction. You control how the ray cast proceeds by returning a numeric/float value.
0to terminate the ray castfractionto clip the ray cast at current point1don't clip the ray and continue-1(or anything else) to continue
Parameters
fixture
The fixture hit by the ray
point
The point of initial intersection
normal
The normal vector at the point of intersection
fraction
number
The fraction along the ray at the point of intersection
Returns
number
A number to update the maxFraction