Class RuleElevationPenalty Extends GridGraphRule

Public

Applies penalty based on the elevation of the node.

This is useful if you for example want to discourage agents from walking high up in mountain regions.

The penalty applied is equivalent to:

penalty = curve.evaluate(Mathf.Clamp01(Mathf.InverseLerp(lower elevation range, upper elevation range, elevation))) * penaltyScale

Inner Types

Public Methods

DisposeUnmanagedData ()

Called when the rule is removed or the graph is destroyed.

Public
Register (rules)

Does preprocessing and adds callbacks to the GridGraphRules object.

Public

Public Variables

curve
Public
elevationRange
Public
penaltyScale
Public

Inherited Public Members

FilterNodeConnections< T > (bounds, nodeConnections, layeredDataLayout, filter)
Public Static
ForEachNode< T > (bounds, nodeNormals, callback)

Iterate through all nodes.

Public Static
GetNeighbourDataIndex (bounds, nodeConnections, layeredDataLayout, dataX, dataLayer, dataZ, direction)

Returns the data index for a node's neighbour in the given direction.

Public Static
Hash

Hash of the settings for this rule.

Public
Pass

Where in the scanning process a rule will be executed.

Public
SetDirty ()

Call if you have changed any setting of the rule.

Public
enabled

Only enabled rules are executed.

Public

Private/Protected Members

elevationToPenalty
Private