PathEngine home previous: iMesh::generateConnectedRegionPreprocessFor()next: iMesh::generateCurvedPath_WithEndVector()
Contents, API Reference, Interfaces, iMesh, generateCurvedPath

iMesh::generateCurvedPath()

Description

Post process path smoothing.
Returns a new path based on a 'base path', but with corners smoothed according to supplied parameters.

Syntax

std::unique_ptr<iPath> generateCurvedPath(const iShape& shape, iPath* basePath, const iCollisionContext* context, int32_t startVectorX, int32_t startVectorY, int32_t sectionLength, float turnRatio1, float turnRatio2) const

Parameters

shapeThe collision shape to use for this query.
basePath A straight line path from which to generate the curved path.
A null pointer may be passed in to this argument (in which case the result will also be a null pointer).
context The state of dynamic collision that will apply for this query.
An empty context can be specified by passing nullptr for this argument.
startVectorX X component of a start vector to incorporate into the curved path.
Must be in the range -1500000 to 1500000.
startVectorY Y component of a start vector to incorporate into the curved path.
Must be in the range -1500000 to 1500000.
sectionLength Desired minimum section length for the curved path.
turnRatio1 Desired maximum turn angle for a first pass, specified as a ratio.
turnRatio2 Desired maximum turn angle for a second pass, specified as a ratio.

Requirements

Requires that unobstructed space has been generated on this mesh for the collision shape specified.

Return Value

If basePath is not a null pointer then this method always returns a newly created Interface iPath object for the smoothed path.
If basePath is a null pointer then a null pointer will be returned

Remarks

Legacy version of iMesh::generateCurvedPath_WithEndVector().
Equivalent to calling that method with both end vector parameters set to zero.

C# Mapping

Path generateCurvedPath(Shape shape, Path basePath, CollisionContext context, int startVectorX, int startVectorY, int sectionLength, float turnRatio1, float turnRatio2);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iMesh::generateCurvedPath_WithEndVector()