Class RayCastResult

java.lang.Object
physics.collision.RayCastResult

public class RayCastResult extends Object
Since:
21.06.2021
Author:
Juyas
  • Constructor Details

    • RayCastResult

      public RayCastResult()
      Create a RayCastResult, where the target was not hit.
    • RayCastResult

      public RayCastResult(org.joml.Vector2f point, org.joml.Vector2f normal, org.joml.Vector2f strike, float strikeLength)
      Create a successful raycast result with details collision information.
      Parameters:
      point - the point, where the raycast hit
      normal - the normal on the face of the object that got hit
      strike - the vector from raycast start to the point
      strikeLength - the distance from the raycast start to the point
  • Method Details

    • getStrikeLength

      public float getStrikeLength()
      See Also:
      • strikeLength
    • getNormal

      public org.joml.Vector2f getNormal()
      See Also:
      • normal
    • getPoint

      public org.joml.Vector2f getPoint()
      See Also:
      • point
    • getStrike

      public org.joml.Vector2f getStrike()
      See Also:
      • strike
    • didHit

      public boolean didHit()
      See Also:
      • hit