PathEngine home | previous: | next: |

Pre-expands and combines a set of convex 2D obstacles, with optional boundary optimisation.

iExpanded2DObstacles* preExpandObstacles(int32_t originX, int32_t originY, int32_t const * obstacles_Buffer, uint32_t obstacles_BufferEntries, const iShape* shape, bool optimise, int32_t optimiseHorizontalRange); |

originX | The x coordinate for a world origin for the obstacles. | ||

originY | The y coordinate for a world origin for the obstacles. | ||

obstacles_Buffer, obstacles_BufferEntries |
(See | ||

shape | The shape to expand by. | ||

optimise | Controls whether or not a boundary optimisation step is applied to the expanded obstacles. | ||

optimiseHorizontalRange | Maximum horizontal range to be applied during boundary optimisation. |

If the data passed in is valid then a newly created

Otherwise non-fatal errors will be reported relating to
the validation failure and **zero** will be returned.

The first value in the obstacle data specifies the number of obstacles being passed in. After that the number of points in each obstacle should be supplied, following by coordinate data (x,y pairs, relative to the world origin) for each obstacle point.

The points for each obstacle must form a convex polygon that goes clockwise around the obstructed area, subject to the same constraints as on coordinate data being pass in to the iMesh placeLargeStatic2DObstacle() method.

The obstacles may overlap one another.
(In fact,
a key purpose of

So, for example, the following boundary data includes two rectangular obstacles,
which overlap and actually form one larger square.

const int32_t boundaryData[] = { 2, 4, 0,0, 0,100, 50,100, 50,0, 5, 50,0, 40,50, 50,100, 100,100, 100,0 }; |

This decomposes as:

- number of obstacles = 2
- number of points in first obstacle = 4
- coordinate data for points clockwise around a rectangular shape
- number of points in second obstacle = 5
- coordinate data for points clockwise around another, overlapping, convex polygon

An optional boundary optimisation phase is included, similar to the optional boundary optimisation step in unobstructed space generation.

As with that unobstructed space optimisation step, the amount of optimisation is constrolled by a maximum horizontal range between removed vertices and resulting optimised boundaries.

As with unobstructed space optimisation, there are restrictions on the maximum permitted range, depending on the agent shape being used for expansion.

Expanded2DObstacles preExpandObstacles(int originX, int originY, int[] obstacles, Shape shape, bool optimise, int optimiseHorizontalRange); |

Expanded2DObstacles preExpandObstacles(int originX, int originY, int[] obstacles, Shape shape, boolean optimise, int optimiseHorizontalRange); |

Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEngine | next: |