/* check slope to determine if two points should connect - assumes anything more than 45 degrees is impassable */
member IsSteep(float FromX, float FromY, float FromZ, float ToX, float ToY, float ToZ)
{
/* determine horizontal distance and vertical distance between points */
variable float slope = 0
variable float maxslope = 0.8
variable float horizontal = ${Math.Distance[${FromX}, ${FromY}, ${ToZ},${ToX}, ${ToY},${ToZ}]}
variable float vertical = ${Math.Distance[${ToX}, ${ToY}, ${FromZ}, ${ToX}, ${ToY}, ${ToZ}]}
/* did we move? */
if ${horizontal} < 1.5
{
return FALSE
}
/* adjust for greater distance */
if ${horizontal} > 5
{
maxslope:Set[1.15]
}
/* calculate slope by dividing vertical distance by horizontal */
slope:Set[${vertical}/${horizontal}]
/* if slope is greater than 1, the slope is greater than a 45 degree angle - lets not map it */
if ${slope} > ${maxslope}
{
return TRUE
}
return FALSE
}
}