RectObstacle2D

This class implements a rectangular obstacle, whose sides are parallel to the cartesian axis.

Parameters

[Vector2D] type

Constructors

Link copied to clipboard
constructor(x: Double, y: Double, w: Double, h: Double)

Properties

Link copied to clipboard
Link copied to clipboard
open override val id: Int

The id for this obstacle.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun contains(x: Double, y: Double): Boolean
open operator override fun contains(p0: Point2D): Boolean
open operator override fun contains(p0: Rectangle2D): Boolean
open override fun contains(p0: Double, p1: Double, p2: Double, p3: Double): Boolean
Link copied to clipboard
open override fun getBounds(): Rectangle
Link copied to clipboard
open override fun getBounds2D(): Rectangle2D
Link copied to clipboard
Link copied to clipboard
open override fun intersects(p0: Rectangle2D): Boolean
open override fun intersects(p0: Double, p1: Double, p2: Double, p3: Double): Boolean
Link copied to clipboard
open override fun nearestIntersection(start: V, end: V): V

Given a vector (represented as a starting point and an end point), computes the intersection point between the vector and the obstacle nearest to the vector's starting point.

Link copied to clipboard
open override fun next(start: V, end: V): V

Given a vector (starting point and end point) representing a requested move, this method computes a new end point, representing a cut version of the initial vector, modified in such a way that the end point is outside the obstacle.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Obtains the vertices of a polygonal shape. Any curved segment connecting two points will be considered as a straight line between them.