next
fun next(@Nonnull current: Euclidean2DPosition, @Nonnull desired: Euclidean2DPosition): Euclidean2DPosition(source)
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].
Return
the next allowed position, where the node can actually move. This position MUST be considered as a vector whose start point is in [ox, oy].
Parameters
ox
The current X position
oy
The current Y position
nx
The requested X position
ny
The requested Y position