Package org.empirewar.orbis.area
Class PolyhedralArea
java.lang.Object
org.empirewar.orbis.area.EncompassingArea
org.empirewar.orbis.area.PolygonArea
org.empirewar.orbis.area.PolyhedralArea
A 3D implementation of a
PolygonArea.
Generated by AI, as I can't find any examples of polyhedral point testing, only 2D point in polygon stuff.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final record -
Field Summary
FieldsFields inherited from class org.empirewar.orbis.area.EncompassingArea
boundaryPoints, max, min, points -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculates the minimum and maximum points of this area.booleancontains(double x, double y, double z) Gets whether the specified point is within this area.Set<org.joml.Vector3ic> Returns a set of points representing the boundary of this area.intGets the minimum number of points for this area.AreaType<?> getType()Methods inherited from class org.empirewar.orbis.area.PolygonArea
contains, generateBoundaryPoints, getMaximumPointsMethods inherited from class org.empirewar.orbis.area.EncompassingArea
addPoint, addUpdateListener, clearPoints, getMax, getMin, iterator, points, removePoint, removeUpdateListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
CODEC
-
-
Constructor Details
-
PolyhedralArea
public PolyhedralArea()
-
-
Method Details
-
calculateEncompassingArea
protected void calculateEncompassingArea()Description copied from class:EncompassingAreaCalculates the minimum and maximum points of this area.- Overrides:
calculateEncompassingAreain classEncompassingArea
-
contains
public boolean contains(double x, double y, double z) Description copied from interface:AreaGets whether the specified point is within this area.This method will always return false if the area is incomplete.
- Specified by:
containsin interfaceArea- Overrides:
containsin classPolygonArea- 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
Area.points()
-
getBoundaryPoints
Description copied from interface:AreaReturns a set of points representing the boundary of this area.- Specified by:
getBoundaryPointsin interfaceArea- Overrides:
getBoundaryPointsin classEncompassingArea
-
getMinimumPoints
public int getMinimumPoints()Description copied from class:EncompassingAreaGets the minimum number of points for this area.- Overrides:
getMinimumPointsin classPolygonArea- Returns:
- the minimum number of points required to build this area
-
getType
- Specified by:
getTypein interfaceArea- Overrides:
getTypein classPolygonArea
-