Euclidean2DPassage

data class Euclidean2DPassage(val tail: ConvexPolygon, val head: ConvexPolygon, val passageShapeOnTail: Segment2D<Euclidean2DPosition>)

Defines a passage between two ConvexPolygons in an euclidean bidimensional space. The passage is oriented, which means it connects tail to head, but the opposite is not necessarily true. tail and head can be non-adjacent (there can be some distance between them), this introduces navigation issues as agents may not know which direction to follow when crossing a passage. passageShapeOnTail is a Segment2D representing the shape of the passage on tail's boundary (e.g. in indoor environments, the segment should represent the shape of the door between two rooms). passageShapeOnTail must be determined so as to guarantee that head is reachable by throwing a ray from any point of the segment in its normal direction. This solves navigation issues as it provides agents with a direction to follow when crossing Euclidean2DPassages (namely, the normal direction to passageShapeOnTail).

Constructors

Link copied to clipboard
constructor(tail: ConvexPolygon, head: ConvexPolygon, passageShapeOnTail: Segment2D<Euclidean2DPosition>)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Provided the crossingPointOnTail that an agent has reached (or will reach), this method computes the point belonging to the boundary of head that the agent should point towards to cross the passage (i.e. the first point belonging to head's boundary that is encountered by throwing a ray from crossingPointOnTail along passageShapeOnTail's normal direction). Note that the returned point may not be formally contained in head depending on the definition of insideness used by ConvexPolygon.contains, prefer using ConvexPolygon.containsBoundaryIncluded.

Link copied to clipboard

Provided the position of an agent that may want to cross this passage, this method computes the point belonging to passageShapeOnTail which is more convenient to cross. Note that the agent must be inside tail.

Link copied to clipboard

Provided the position of an agent that may want to cross this passage, this method returns a pair containing both crossingPointOnTail and crossingPointOnHead.