PathEngine home previous: iAgent::release()next: iAgent::setTraverseCostDirection()
Contents, API Reference, Interfaces, iAgent, setTraverseCost

iAgent::setTraverseCost()

Description

Specifies if the obstacle should function as a 'soft obstacle', and specifies the traversal cost.

Syntax

void setTraverseCost(float cost);

Parameters

cost The additional cost to be applied to parts of a path that cross this obstacle, or -1.f to indicate that the obstacle should function as a traditional 'hard obstacle'.

Remarks

An agent's traverse cost defaults to -1 which indicates that the agent should function as a traditional 'hard obstacle'.
Setting the traverse cost to a value >= 0.f specifies that the agent should behave as a 'soft obstacle'.
You can switch the agent back to behaving as a hard obstacle by setting the traverse cost back to -1.f

Refer to Representing Regions with Cost to Traverse for more details about the 'soft obstacle' functionality.

The traverse cost currently associated with an agent can be obtained with iAgent::getTraverseCost().

C# Mapping

void setTraverseCost(float cost);

Java Mapping

void setTraverseCost(float cost);

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