Ejemplo n.º 1
0
        // 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)));
        }
Ejemplo n.º 2
0
 // *undoc* --- there's a property now
 public static FP Magnitude(FPVector4 a)
 {
     return(FPMath.Sqrt(Dot(a, a)));
 }