private ArrayList<AStarNode> backTrace(AStarNode start){
  ArrayList<AStarNode> foundpath=new ArrayList<AStarNode>();
  foundpath.add(currentNode);
  int x;
  int y;
  int z;
  int px;
  int pz;
  int dx;
  int dz;
  while (!currentNode.equals(start)) {
    x=currentNode.x;
    y=currentNode.y;
    z=currentNode.z;
    px=currentNode.parent.x;
    pz=currentNode.parent.z;
    dx=(px - x) / Math.max(Math.abs(x - px),1);
    dz=(pz - z) / Math.max(Math.abs(z - pz),1);
    x+=dx;
    z+=dz;
    while (x != px || z != pz) {
      y=getGroundNodeHeight(x,y,z);
      foundpath.add(new AStarNode(x,y,z,0,null));
      x+=dx;
      z+=dz;
    }
    foundpath.add(currentNode.parent);
    currentNode=currentNode.parent;
  }
  return foundpath;
}

private ArrayList < AStarNode > backTrace ( AStarNode start ) { ArrayList < AStarNode > foundpath = new ArrayList < AStarNode > ( ) ; foundpath . add ( currentNode ) ; int x ; int y ; int z ; int px ; int pz ; int dx ; int dz ; while ( ! currentNode . equals ( start ) ) { x = currentNode . x ; y = currentNode . y ; z = currentNode . z ; px = currentNode . parent . x ; pz = currentNode . parent . z ; dx = ( px - x ) / Math . max ( Math . abs ( x - px ) , 1 ) ; dz = ( pz - z ) / Math . max ( Math . abs ( z - pz ) , 1 ) ; x += dx ; z += dz ; while ( x != px || z != pz ) { y = getGroundNodeHeight ( x , y , z ) ; foundpath . add ( new AStarNode ( x , y , z , 0 , null ) ) ; x += dx ; z += dz ; } foundpath . add ( currentNode . parent ) ; currentNode = currentNode . parent ; } return foundpath ; }
traces the path back to our starting node , interpolating new nodes inbetween the jump poins as we go .
