Class ShapeImpl

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

public final class ShapeImpl extends Object implements Shape
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    intersectBox(@NotNull net.minestom.server.coordinate.Point position, @NotNull BoundingBox boundingBox)
    Checks if two bounding boxes intersect.
    boolean
    intersectBoxSwept(@NotNull net.minestom.server.coordinate.Point rayStart, @NotNull net.minestom.server.coordinate.Point rayDirection, @NotNull net.minestom.server.coordinate.Point shapePos, @NotNull BoundingBox moving, @NotNull SweepResult finalResult)
    Checks if a moving bounding box will hit this shape.
    boolean
    isFaceFull(@NotNull net.minestom.server.instance.block.BlockFace face)
    Returns true if the given block face is completely covered by this shape, false otherwise.
    boolean
    isOccluded(@NotNull Shape shape, @NotNull net.minestom.server.instance.block.BlockFace face)
     
    @NotNull net.minestom.server.coordinate.Point
    Relative End
    @NotNull net.minestom.server.coordinate.Point
    Relative Start

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minestom.server.collision.Shape

    intersectEntity
  • Method Details

    • relativeStart

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

      @NotNull public @NotNull net.minestom.server.coordinate.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 net.minestom.server.instance.block.BlockFace face)
      Specified by:
      isOccluded in interface Shape
    • isFaceFull

      public boolean isFaceFull(@NotNull @NotNull net.minestom.server.instance.block.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 net.minestom.server.coordinate.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 net.minestom.server.coordinate.Point rayStart, @NotNull @NotNull net.minestom.server.coordinate.Point rayDirection, @NotNull @NotNull net.minestom.server.coordinate.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()