Package org.jbox2d.callbacks
Interface RayCastCallback
public interface RayCastCallback
Callback class for ray casts. See
World.raycast(RayCastCallback, Vec2, Vec2)- Author:
- Daniel Murphy
-
Method Summary
Modifier and TypeMethodDescriptionfloatreportFixture(Fixture fixture, Vec2 point, Vec2 normal, float fraction) Called for each fixture found in the query.
-
Method Details
-
reportFixture
Called for each fixture found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue- Parameters:
fixture- The fixture hit by the raypoint- The point of initial intersectionnormal- The normal vector at the point of intersectionfraction-- Returns:
- -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue
-