// Here's the heuristic function that estimates the distance from a Node // to the Goal. public FP GoalDistanceEstimate(MapSearchNode nodeGoal) { FP X = nodeIndex.x - nodeGoal.nodeIndex.x; FP Y = nodeIndex.y - nodeGoal.nodeIndex.y; return(FPMath.Sqrt((X * X) + (Y * Y))); }
// *undoc* --- there's a property now public static FP Magnitude(FPVector4 a) { return(FPMath.Sqrt(Dot(a, a))); }