Slice

class Slice(startPoint: Vec2, direction: Vec2, distance: Double)

Class to allow two polygons to be sliced.

Parameters

startPoint

The origin of the rays projection.

direction

The direction of the ray points in radians.

distance

The distance the ray is projected

Constructors

Link copied to clipboard
fun Slice(startPoint: Vec2, direction: Vec2, distance: Double)

Functions

Link copied to clipboard
fun sliceObjects(world: World)

Slices any polygons in the world supplied that intersect with the ray projection.

Link copied to clipboard
fun updateProjection(bodiesToEvaluate: ArrayList<TranslatableBody>)

Updates the projection in world space and acquires information about the closest intersecting object with the ray projection.

Properties

Link copied to clipboard
var direction: Vec2
Link copied to clipboard
var distance: Double
Link copied to clipboard
val intersectingBodiesInfo: ArrayList<RayInformation>
Link copied to clipboard
val startPoint: Vec2