Image Environment With Graph
An ImageEnvironment providing an Euclidean2DNavigationGraph. The NaviGator algorithm is used to produce such graph (see generateNavigationGraph). The positions where to plant initial seeds should be specified directly in the image, marking each area of the environment with one or more pixels of a given color (defaults to blue).
Constructors
Functions
node.canFit must be true for the returned position. For a better understanding of how to compute collision points with circular hitboxes see this discussion.
Gets the heading of a node as a direction vector.
Gets all nodes whose shape.intersect is true for the given shape.
Given a point and a range, retrieves all the obstacles within.
Gets the shape of a node relatively to its position and heading in the environment.
Checks whether a position is allowed to be occupied by a node in this environment.
Creates an euclidean position from the given coordinates.
Creates a new Euclidean2DPosition.
Moves the node to the farthestPositionReachable towards the desired newPosition. If the node is shapeless, it is simply moved to newPosition.
This method must calculate the ABSOLUTE next allowed position given the current position and the position in which the node wants to move. For example, if your node is in position [2,3], wants to move to [3,4] but the next allowed position (because, e.g., of physical obstacles) is [2.5,3.5], the result must be a Position containing coordinates [2.5,3.5].
A node should be added only if it doesn't collide with already existing nodes and fits in the environment's limits.
Sets the heading of a node.