PathEngine home previous: iCollisionContext::setQueryBounds()next: iCollisionContext::setSurfaceTypeTraverseCostDirection()
Contents, API Reference, Interfaces, iCollisionContext, setSurfaceTypeTraverseCost



Associates a traverse cost with regions marked with a specified surface type.


void setSurfaceTypeTraverseCost(int32_t surfaceType, float cost);


surfaceType (Must be >= 0.)
The traverse cost will apply to movement through regions marked with this surface type.
cost The additional cost to traverse to be applied to movement through the specified regions.
This parameter must be zero, positive or set to exactly -1.


Refer to Representing Regions with Cost to Traverse for more detail about surface type based costs.

Note that the cost to traverse is added to a base (distance-based) movement cost.
So, for example, to make a region twice as expensive to cross as unmarked ground, set this additional cost to 1.f.

The traverse cost for each surface type region defaults to 0.f, which indicates no additional cost to traverse.

Setting the cost to -1 indicates that the specified region should be considered impassible for movement in the direction associated with this cost.
Note that surface type regions are only taken into account for pathfinding. Regions with cost set to -1 prevent paths being generated, but do not affect collision queries.

See Also


C# Mapping

void setSurfaceTypeTraverseCost(int surfaceType, float cost);

Java Mapping

void setSurfaceTypeTraverseCost(int surfaceType, float cost);

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: iCollisionContext::setSurfaceTypeTraverseCostDirection()