PathEngine home previous: iPathEngine::newMesh()next: iPathEngine::newShape_FromExpanded2DObstacles()
Contents, API Reference, Interfaces, iPathEngine, newShape

iPathEngine::newShape()

Description

Creates a new iShape object.

Syntax

std::unique_ptr<iShape> newShape(int32_t const * shapeCoordinates_Buffer, uint32_t shapeCoordinates_BufferEntries)

Parameters

shapeCoordinates_Buffer, shapeCoordinates_BufferEntries (See Passing Arrays.) A sequence of x and y coordinate value pairs for the shape.

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.. and so an even number of coordinate values should be specified (an.
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.

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.

C# Mapping

Shape newShape(int[] shapeCoordinates);

Java Mapping

Shape newShape(int[] shapeCoordinates);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iPathEngine::newShape_FromExpanded2DObstacles()