Class ShapeImpl

java.lang.Object
net.minestom.server.collision.ShapeImpl
All Implemented Interfaces:
Shape

public final class ShapeImpl extends Object implements Shape
  • Method Details

    • relativeStart

      @NotNull public @NotNull Point relativeStart()
      Description copied from interface: Shape
      Relative Start
      Specified by:
      relativeStart in interface Shape
      Returns:
      Start of shape
    • relativeEnd

      @NotNull public @NotNull Point relativeEnd()
      Description copied from interface: Shape
      Relative End
      Specified by:
      relativeEnd in interface Shape
      Returns:
      End of shape
    • isOccluded

      public boolean isOccluded(@NotNull @NotNull Shape shape, @NotNull @NotNull BlockFace face)
      Specified by:
      isOccluded in interface Shape
    • isFaceFull

      public boolean isFaceFull(@NotNull @NotNull BlockFace face)
      Description copied from interface: Shape
      Returns true if the given block face is completely covered by this shape, false otherwise.
      Specified by:
      isFaceFull in interface Shape
      Parameters:
      face - The face to test
    • intersectBox

      public boolean intersectBox(@NotNull @NotNull Point position, @NotNull @NotNull BoundingBox boundingBox)
      Description copied from interface: Shape
      Checks if two bounding boxes intersect.
      Specified by:
      intersectBox in interface Shape
      Parameters:
      position - Relative position of bounding box to check with
      boundingBox - Bounding box to check for intersections with
      Returns:
      is an intersection found
    • intersectBoxSwept

      public boolean intersectBoxSwept(@NotNull @NotNull Point rayStart, @NotNull @NotNull Point rayDirection, @NotNull @NotNull Point shapePos, @NotNull @NotNull BoundingBox moving, @NotNull @NotNull SweepResult finalResult)
      Description copied from interface: Shape
      Checks if a moving bounding box will hit this shape.
      Specified by:
      intersectBoxSwept in interface 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
    • block

      public Block block()