Interface Shape

All Known Implementing Classes:
BoundingBox

@Experimental public interface Shape
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    intersectBox(@NotNull Point positionRelative, @NotNull BoundingBox boundingBox)
    Checks if two bounding boxes intersect.
    boolean
    intersectBoxSwept(@NotNull Point rayStart, @NotNull Point rayDirection, @NotNull Point shapePos, @NotNull BoundingBox moving, @NotNull net.minestom.server.collision.SweepResult finalResult)
    Checks if a moving bounding box will hit this shape.
    @NotNull Point
    Relative End
    @NotNull Point
    Relative Start
  • Method Details

    • intersectBox

      boolean intersectBox(@NotNull @NotNull Point positionRelative, @NotNull @NotNull BoundingBox boundingBox)
      Checks if two bounding boxes intersect.
      Parameters:
      positionRelative - Relative position of bounding box to check with
      boundingBox - Bounding box to check for intersections with
      Returns:
      is an intersection found
    • intersectBoxSwept

      boolean intersectBoxSwept(@NotNull @NotNull Point rayStart, @NotNull @NotNull Point rayDirection, @NotNull @NotNull Point shapePos, @NotNull @NotNull BoundingBox moving, @NotNull @NotNull net.minestom.server.collision.SweepResult finalResult)
      Checks if a moving bounding box will hit this shape.
      Parameters:
      rayStart - Position of the moving shape
      rayDirection - Movement vector
      shapePos - Position of this shape
      moving - Bounding Box of moving shape
      finalResult - Stores final SweepResult
      Returns:
      is an intersection found
    • relativeStart

      @NotNull @NotNull Point relativeStart()
      Relative Start
      Returns:
      Start of shape
    • relativeEnd

      @NotNull @NotNull Point relativeEnd()
      Relative End
      Returns:
      End of shape