Class SingleHitCallback
java.lang.Object
com.csse3200.game.physics.raycast.SingleHitCallback
- All Implemented Interfaces:
com.badlogic.gdx.physics.box2d.RayCastCallback
public class SingleHitCallback
extends Object
implements com.badlogic.gdx.physics.box2d.RayCastCallback
Cast a ray against all colliders that match the layermask. The closest hit will be stored, or
none if no hit occurred.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
reportRayFixture
(com.badlogic.gdx.physics.box2d.Fixture fixture, com.badlogic.gdx.math.Vector2 point, com.badlogic.gdx.math.Vector2 normal, float fraction)
-
Field Details
-
layerMask
public short layerMask -
hit
-
didHit
public boolean didHit
-
-
Constructor Details
-
SingleHitCallback
public SingleHitCallback()
-
-
Method Details
-
reportRayFixture
public float reportRayFixture(com.badlogic.gdx.physics.box2d.Fixture fixture, com.badlogic.gdx.math.Vector2 point, com.badlogic.gdx.math.Vector2 normal, float fraction) - Specified by:
reportRayFixture
in interfacecom.badlogic.gdx.physics.box2d.RayCastCallback
-