Package org.empirewar.orbis.area
Interface Area
- All Superinterfaces:
Iterable<org.joml.Vector3ic>
- All Known Implementing Classes:
CuboidArea,EncompassingArea,PolygonArea,PolyhedralArea,SphericalArea
Represents some area that forms a shape through a set of points.
Areas are non-locational; they do not contain any world-specific data.
Instead, a world contains a set of Areas.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPoint(org.joml.Vector3ic point) Attempts to add a point to this area.voidRemoves all points from this area.booleancontains(double x, double y, double z) Gets whether the specified point is within this area.booleancontains(org.joml.Vector3dc point) Set<org.joml.Vector3ic> Returns a set of points representing the boundary of this area.org.joml.Vector3icgetMax()Gets the maximum point of this area.org.joml.Vector3icgetMin()Gets the minimum point of this area.AreaType<?> getType()Set<org.joml.Vector3ic> points()Gets the set of points that make up this area.booleanremovePoint(org.joml.Vector3ic point) Attempts to remove a point from this area.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
CODEC
-
-
Method Details
-
clearPoints
void clearPoints()Removes all points from this area. -
addPoint
boolean addPoint(org.joml.Vector3ic point) Attempts to add a point to this area.This method will return false if the area does not support the addition of another point, e.g. a cuboid exceeding 4 points.
- Parameters:
point- the point to add- Returns:
- true if the point is able to fit into this area
-
removePoint
boolean removePoint(org.joml.Vector3ic point) Attempts to remove a point from this area.This method will return as specified by
Set.remove(Object).- Parameters:
point- the point to remove- Returns:
- specified by
Set.remove(Object)
-
contains
boolean contains(org.joml.Vector3dc point) - See Also:
-
contains
boolean contains(double x, double y, double z) Gets whether the specified point is within this area.This method will always return false if the area is incomplete.
- Parameters:
x- the x point to checky- the y point to checkz- the z point to check- Returns:
- true if the point is within the area specified by
points()
-
getMin
org.joml.Vector3ic getMin()Gets the minimum point of this area.This method does not guarantee returning a
Vector3ifrompoints(); it is the minimum bounds point.- Returns:
- the minimum point
-
getMax
org.joml.Vector3ic getMax()Gets the maximum point of this area.This method does not guarantee returning a
Vector3ifrompoints(); it is the maximum bounds point.- Returns:
- the maximum point
-
points
Set<org.joml.Vector3ic> points()Gets the set of points that make up this area.The returned set cannot be modified.
- Returns:
- set of points of this area
-
getBoundaryPoints
Set<org.joml.Vector3ic> getBoundaryPoints()Returns a set of points representing the boundary of this area. -
getType
AreaType<?> getType()
-