Package com.sk89q.worldedit.regions
Class ConvexPolyhedralRegion
java.lang.Object
com.sk89q.worldedit.regions.AbstractRegion
com.sk89q.worldedit.regions.ConvexPolyhedralRegion
- All Implemented Interfaces:
Region
,Cloneable
,Iterable<BlockVector3>
-
Field Summary
Fields inherited from class com.sk89q.worldedit.regions.AbstractRegion
world
-
Constructor Summary
ConstructorDescriptionConstructs an independent copy of the given region.ConvexPolyhedralRegion
(World world) Constructs an empty mesh, containing no vertices or triangles. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addVertex
(BlockVector3 vertex) Add a vertex to the region.void
clear()
Clears the region, removing all vertices and triangles.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.Get the center point of a region.Get the upper point of a region.Get the lower point of a region.boolean
void
shift
(BlockVector3 change) Shift the region.Methods inherited from class com.sk89q.worldedit.regions.AbstractRegion
getChunkCubes, getChunks, getHeight, getLength, getVolume, getWidth, getWorld, getWorldMaxY, getWorldMinY, iterator, polygonize, setWorld
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.sk89q.worldedit.regions.Region
getArea, getBoundingBox
-
Constructor Details
-
ConvexPolyhedralRegion
Constructs an empty mesh, containing no vertices or triangles.- Parameters:
world
- the world
-
ConvexPolyhedralRegion
Constructs an independent copy of the given region.- Parameters:
region
- the region to copy
-
-
Method Details
-
clear
public void clear()Clears the region, removing all vertices and triangles. -
addVertex
Add a vertex to the region.- Parameters:
vertex
- the vertex- Returns:
- true, if something changed.
-
isDefined
public boolean isDefined() -
getMinimumPoint
Description copied from interface:Region
Get the lower point of a region.- Returns:
- min. point
-
getMaximumPoint
Description copied from interface:Region
Get the upper point of a region.- Returns:
- max. point
-
getCenter
Description copied from interface:Region
Get the center point of a region. Note: Coordinates will not be integers if the corresponding lengths are even.- Specified by:
getCenter
in interfaceRegion
- Overrides:
getCenter
in classAbstractRegion
- Returns:
- center point
-
expand
Description copied from interface:Region
Expand the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
contract
Description copied from interface:Region
Contract the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
shift
Description copied from interface:Region
Shift the region.- Specified by:
shift
in interfaceRegion
- Overrides:
shift
in classAbstractRegion
- Parameters:
change
- the change- Throws:
RegionOperationException
- if the operation cannot be performed
-
contains
Description copied from interface:Region
Returns true based on whether the region contains the point.- Parameters:
position
- the position- Returns:
- true if contained
-
getVertices
-
getTriangles
-
clone
Description copied from interface:Region
Make a clone of the region.- Specified by:
clone
in interfaceRegion
- Overrides:
clone
in classAbstractRegion
- Returns:
- a cloned version
-