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(Vector 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(Vector position)
Returns true based on whether the region contains the point.
|
void |
contract(Vector... changes)
Contract the region.
|
void |
expand(Vector... changes)
Expand the region.
|
Vector |
getCenter()
Get the center point of a region.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
java.util.Collection<Triangle> |
getTriangles() |
java.util.Collection<Vector> |
getVertices() |
boolean |
isDefined() |
void |
shift(Vector change)
Shift the region.
|
getArea, getChunkCubes, getChunks, getHeight, getLength, getWidth, getWorld, iterator, polygonize, setWorld
public ConvexPolyhedralRegion(@Nullable World world)
world
- the worldpublic ConvexPolyhedralRegion(ConvexPolyhedralRegion region)
region
- the region to copypublic void clear()
public boolean addVertex(Vector vertex)
vertex
- the vertexpublic boolean isDefined()
public Vector getMinimumPoint()
Region
public Vector getMaximumPoint()
Region
public Vector getCenter()
Region
getCenter
in interface Region
getCenter
in class AbstractRegion
public void expand(Vector... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
public void contract(Vector... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
public void shift(Vector change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
public boolean contains(Vector position)
Region
position
- the positionpublic java.util.Collection<Vector> getVertices()
public java.util.Collection<Triangle> getTriangles()
public AbstractRegion clone()
Region
clone
in interface Region
clone
in class AbstractRegion