PathEngine home previous: iPathEngine::newContentChunk()next: iPathEngine::pathfindPreprocessVersionIsCompatible()
Contents, API Reference, Interfaces, iPathEngine, newShape

iPathEngine::newShape()

Description

Creates a new iShape object.

Syntax

iShape* newShape(tSigned32 numberOfPoints, const tSigned32* coordinateData);

Parameters

numberOfPointsThe number of vertices in the shape.
coordinateDataPoints to an array of tSigned32, of size numberOfPoints * 2. This array is copied, and can therefore be safely deleted after the call returns.

Return Value

If the shape specified is valid then a newly created Interface iShape object is returned.
Otherwise a non-fatal error is emitted and zero is returned.

Remarks

The iShape obtained can be used to place agents with the given shape on a ground mesh, or to make queries about possibilities for movement for agents with this shape.

The coordinate data is interpreted as x1, y1, x2, y2.. up to the number of points specified.
These coordinates are relative to the origin (0, 0), and specifiy a shape boundary relative to this origin.
See Shape Validation for details about the constraints on this shape.

See PathEngine Coordinates for information about the pathengine coordinate system.

The created Interface iShape can be explicitly deleted when no longer required, but will also be deleted if iPathEngine::deleteAllObjects() is called - in either case the pointer can no longer be used. Any shapes not deleted will be cleaned up automatically when PathEngine is shut down.

Use iPathEngine::shapeIsValid() if you are unsure whether a set of coordinates is valid before calling this method.
In cases where an iShape instance is only needed to place an obstacle, and where shapes can potentially fail validation due to general shape range constraints, iMesh::placeLargeStaticObstacle() should be preferred.


Documentation for PathEngine release 5.24 - Copyright © 2002-2010 PathEnginenext: iPathEngine::pathfindPreprocessVersionIsCompatible()