Package net.minestom.server.collision
Interface Shape
- All Known Implementing Classes:
BoundingBox
@Experimental
public interface Shape
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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 withboundingBox
- 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 shaperayDirection
- Movement vectorshapePos
- Position of this shapemoving
- Bounding Box of moving shapefinalResult
- Stores final SweepResult- Returns:
- is an intersection found
-
relativeStart
Relative Start- Returns:
- Start of shape
-
relativeEnd
Relative End- Returns:
- End of shape
-