Package net.minestom.server.collision
Class ShapeImpl
java.lang.Object
net.minestom.server.collision.ShapeImpl
- All Implemented Interfaces:
Shape
-
Method Summary
Modifier and TypeMethodDescriptionblock()booleanintersectBox(@NotNull net.minestom.server.coordinate.Point position, @NotNull BoundingBox boundingBox) Checks if two bounding boxes intersect.booleanintersectBoxSwept(@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.booleanisFaceFull(@NotNull net.minestom.server.instance.block.BlockFace face) Returns true if the given block face is completely covered by this shape, false otherwise.booleanisOccluded(@NotNull Shape shape, @NotNull net.minestom.server.instance.block.BlockFace face) @NotNull net.minestom.server.coordinate.PointRelative End@NotNull net.minestom.server.coordinate.PointRelative StartMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ShapeRelative Start- Specified by:
relativeStartin interfaceShape- Returns:
- Start of shape
-
relativeEnd
@NotNull public @NotNull net.minestom.server.coordinate.Point relativeEnd()Description copied from interface:ShapeRelative End- Specified by:
relativeEndin interfaceShape- Returns:
- End of shape
-
isOccluded
public boolean isOccluded(@NotNull @NotNull Shape shape, @NotNull @NotNull net.minestom.server.instance.block.BlockFace face) - Specified by:
isOccludedin interfaceShape
-
isFaceFull
public boolean isFaceFull(@NotNull @NotNull net.minestom.server.instance.block.BlockFace face) Description copied from interface:ShapeReturns true if the given block face is completely covered by this shape, false otherwise.- Specified by:
isFaceFullin interfaceShape- 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:ShapeChecks if two bounding boxes intersect.- Specified by:
intersectBoxin 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 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:ShapeChecks if a moving bounding box will hit this shape.- Specified by:
intersectBoxSweptin 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
-