alchemist-interfaces / it.unibo.alchemist.model.interfaces / Environment2DWithObstacles / intersectsObstacle

intersectsObstacle

abstract fun intersectsObstacle(sx: Double, sy: Double, ex: Double, ey: Double): Boolean

Checks whether there is at least an obstacle intersecting the line connecting [sx, sy] and [ex, ey].

Parameters

sx - Double: start x

sy - Double: start y

ex - Double: end x

ey - Double: end y

Return
Boolean: true if the line connecting [sx, sy] and [ex, ey] touches an obstacle

abstract fun intersectsObstacle(p1: P, p2: P): Boolean

Checks whether there is at least an obstacle intersecting the line connecting p1 and p2.

Parameters

p1 - P: start position

p2 - P: end position

Return
Boolean: true if the line connecting p1 and p2 touches an obstacle