-
- All Implemented Interfaces:
public final class Slice
Class to allow two polygons to be sliced.
-
-
Field Summary
Fields Modifier and Type Field Description private Double
distance
private Vec2
direction
private final ArrayList<RayInformation>
intersectingBodiesInfo
private final Vec2
startPoint
-
Method Summary
Modifier and Type Method Description final Double
getDistance()
final Unit
setDistance(Double distance)
final Vec2
getDirection()
final Unit
setDirection(Vec2 direction)
final ArrayList<RayInformation>
getIntersectingBodiesInfo()
final Vec2
getStartPoint()
final Unit
updateProjection(ArrayList<TranslatableBody> bodiesToEvaluate)
Updates the projection in world space and acquires information about the closest intersecting object with the ray projection. final Unit
sliceObjects(World world)
Slices any polygons in the world supplied that intersect with the ray projection. -
-
Method Detail
-
getDistance
final Double getDistance()
-
setDistance
final Unit setDistance(Double distance)
-
getDirection
final Vec2 getDirection()
-
setDirection
final Unit setDirection(Vec2 direction)
-
getIntersectingBodiesInfo
final ArrayList<RayInformation> getIntersectingBodiesInfo()
-
getStartPoint
final Vec2 getStartPoint()
-
updateProjection
final Unit updateProjection(ArrayList<TranslatableBody> bodiesToEvaluate)
Updates the projection in world space and acquires information about the closest intersecting object with the ray projection.
- Parameters:
bodiesToEvaluate
- Arraylist of bodies to check if they intersect with the ray projection.
-
sliceObjects
final Unit sliceObjects(World world)
Slices any polygons in the world supplied that intersect with the ray projection.
- Parameters:
world
- World object for the slice to effect.
-
-
-
-