Ejemplo n.º 1
0
 public void calc_neighbour_distance()
 {
     node_edges.Clear ();
     foreach (int n in neighbours) {
         Vector3 neighbour_pos =  GameObject.Find(vars.wp_node_name + "_" + n).GetComponent<node>().node_pos;
         float dist = Vector3.Distance(node_pos, neighbour_pos);
         //Debug.Log("from node " + node_id +  " to " + n + " : Distance = " + dist);
         int edge_id = node_edges.Count;
         wp_edges wp_tmp = new wp_edges(edge_id  ,node_id, n, dist);
         node_edges.Add(wp_tmp);
         //node_edges[edge_id].debug_edge_info();
     }
 }
Ejemplo n.º 2
0
 public void calc_neighbour_distance()
 {
     node_edges.Clear();
     foreach (int n in neighbours)
     {
         Vector3 neighbour_pos = GameObject.Find(vars.wp_node_name + "_" + n).GetComponent <node>().node_pos;
         float   dist          = Vector3.Distance(node_pos, neighbour_pos);
         //Debug.Log("from node " + node_id +  " to " + n + " : Distance = " + dist);
         int      edge_id = node_edges.Count;
         wp_edges wp_tmp  = new wp_edges(edge_id, node_id, n, dist);
         node_edges.Add(wp_tmp);
         //node_edges[edge_id].debug_edge_info();
     }
 }