PathEngine home previous: iAgent::generateCurvedPath()next: iAgent::getAllAgentsOverlapped()
Contents, API Reference, Interfaces, iAgent, generateCurvedPath_WithEndVector

iAgent::generateCurvedPath_WithEndVector()

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_WithEndVector(iPath* basePath, const iCollisionContext* context, int32_t startVectorX, int32_t startVectorY, int32_t endVectorX, int32_t endVectorY, int32_t sectionLength, float turnRatio1, float turnRatio2) const

Parameters

basePath A straight line path from which to generate the curved path.
context The state of dynamic collision that will apply for this query.
An empty context can be specified by passing nullptr for this argument.
Note that the agent is not considered to obstruct itself even if included in this context.
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.
endVectorX X component of an end vector to incorporate into the curved path.
Must be in the range -1500000 to 1500000.
endVectorY Y component of an end 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 the agent is moveable and that collision preprocess has been generated on the agent's mesh for the agent's collision shape.

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

Setting both startVectorX and startVectorY to zero indicates no start vector.

Setting both endVectorX and endVectorY to zero indicates no end vector.

See Path Post Processing for further details, including details about how the parameters control the shape of the resulting path.

Collision is only checked for curved sections.
The sections already present in base_path are assumed to be non-colliding.
If no curved sections can be generated to smooth a given corner then the algorithm falls back on the sections from the base path.
This way, the function is always guaranteed to succeed.
(But it is possible in pathological situations that the resulting path is exactly the same as the path passed in.)

See Also

Interface iPath, iMesh::generateCurvedPath_WithEndVector()

C# Mapping

Path generateCurvedPath_WithEndVector(Path basePath, CollisionContext context, int startVectorX, int startVectorY, int endVectorX, int endVectorY, int sectionLength, float turnRatio1, float turnRatio2);

Java Mapping

Path generateCurvedPath_WithEndVector(Path basePath, CollisionContext context, int startVectorX, int startVectorY, int endVectorX, int endVectorY, int sectionLength, float turnRatio1, float turnRatio2);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iAgent::getAllAgentsOverlapped()