public class ConvexPolyhedralRegion extends AbstractRegion
world
Constructor and Description |
---|
ConvexPolyhedralRegion(ConvexPolyhedralRegion region)
Constructs an independent copy of the given region.
|
ConvexPolyhedralRegion(World world)
Constructs an empty mesh, containing no vertices or triangles.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addVertex(BlockVector3 vertex)
Add a vertex to the region.
|
void |
clear()
Clears the region, removing all vertices and triangles.
|
AbstractRegion |
clone()
Make a clone of the region.
|
boolean |
contains(BlockVector3 position)
Returns true based on whether the region contains the point.
|
void |
contract(BlockVector3... changes)
Contract the region.
|
void |
expand(BlockVector3... changes)
Expand the region.
|
Vector3 |
getCenter()
Get the center point of a region.
|
BlockVector3 |
getMaximumPoint()
Get the upper point of a region.
|
BlockVector3 |
getMinimumPoint()
Get the lower point of a region.
|
java.util.Collection<Triangle> |
getTriangles() |
java.util.Collection<BlockVector3> |
getVertices() |
boolean |
isDefined() |
void |
shift(BlockVector3 change)
Shift the region.
|
getChunkCubes, getChunks, getHeight, getLength, getVolume, getWidth, getWorld, getWorldMaxY, getWorldMinY, iterator, polygonize, setWorld
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArea, getBoundingBox
public ConvexPolyhedralRegion(@Nullable World world)
world
- the worldpublic ConvexPolyhedralRegion(ConvexPolyhedralRegion region)
region
- the region to copypublic void clear()
public boolean addVertex(BlockVector3 vertex)
vertex
- the vertexpublic boolean isDefined()
public BlockVector3 getMinimumPoint()
Region
public BlockVector3 getMaximumPoint()
Region
public Vector3 getCenter()
Region
getCenter
in interface Region
getCenter
in class AbstractRegion
public void expand(BlockVector3... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedpublic void contract(BlockVector3... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedpublic void shift(BlockVector3 change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
- if the operation cannot be performedpublic boolean contains(BlockVector3 position)
Region
position
- the positionpublic java.util.Collection<BlockVector3> getVertices()
public java.util.Collection<Triangle> getTriangles()
public AbstractRegion clone()
Region
clone
in interface Region
clone
in class AbstractRegion