Package net.minestom.server.collision
Class ShapeImpl
java.lang.Object
net.minestom.server.collision.ShapeImpl
- All Implemented Interfaces:
Shape
-
Method Summary
Modifier and TypeMethodDescriptionblock()
boolean
intersectBox
(@NotNull Point position, @NotNull BoundingBox boundingBox) Checks if two bounding boxes intersect.boolean
intersectBoxSwept
(@NotNull Point rayStart, @NotNull Point rayDirection, @NotNull Point shapePos, @NotNull BoundingBox moving, @NotNull SweepResult finalResult) Checks if a moving bounding box will hit this shape.boolean
isFaceFull
(@NotNull BlockFace face) Returns true if the given block face is completely covered by this shape, false otherwise.boolean
isOccluded
(@NotNull Shape shape, @NotNull BlockFace face) @NotNull Point
Relative End@NotNull Point
Relative StartMethods 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
Description copied from interface:Shape
Relative Start- Specified by:
relativeStart
in interfaceShape
- Returns:
- Start of shape
-
relativeEnd
Description copied from interface:Shape
Relative End- Specified by:
relativeEnd
in interfaceShape
- Returns:
- End of shape
-
isOccluded
- Specified by:
isOccluded
in interfaceShape
-
isFaceFull
Description copied from interface:Shape
Returns true if the given block face is completely covered by this shape, false otherwise.- Specified by:
isFaceFull
in interfaceShape
- 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 interfaceShape
- Parameters:
position
- Relative position of bounding box to check withboundingBox
- 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 interfaceShape
- 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
-
block
-