Example #1
0
 //Determines the intial path segment for the car
 private void InitialPathPlan()
 {
     //first triggered thread job for this car
     startNode        = PathPlanningDataStructures.graph.getClosestNode(transform.position);
     currentThreadJob = new DynamicPathThreadJob(startNode, PathPlanningDataStructures.graph.endNode);
     currentThreadJob.Start();
     currentThreadJob.Join();
     currentWayPoints = currentThreadJob.getPathWayPoints();
     //indicate that next path segment needs to calculated
     pathCalculated = false;
     jobInProgress  = false;
 }
 // <summary>
 // Performs path planning for the first path segment by utilizing a DynamicPathThreadJob
 // and waiting for it to complete
 // </summary>
 public void PathPlanInitialSegment()
 {
     //first triggered thread job for this car
     startNode = PathPlanningDataStructures.graph.getClosestNode (transform.position);
     currentThreadJob = new DynamicPathThreadJob (startNode, PathPlanningDataStructures.graph.endNode, closedNodes, 15.0f, true);
     currentThreadJob.Start();
     currentThreadJob.Join();
     currentWayPoints = currentThreadJob.getPathWayPoints();
     usesWaypoints = new bool[currentWayPoints.Count];
     for (int i = 0; i < usesWaypoints.Length; i++) {
         usesWaypoints [i] = true;
     }
     closedNodes = currentThreadJob.getClosedNodes ();
     //indicate that next path segment needs to calculated
     jobInProgress = false;
     dynamicReplan = false;
 }
Example #3
0
 // <summary>
 // Performs path planning for the first path segment by utilizing a DynamicPathThreadJob
 // and waiting for it to complete
 // </summary>
 public void PathPlanInitialSegment()
 {
     //first triggered thread job for this car
     startNode        = PathPlanningDataStructures.graph.getClosestNode(transform.position);
     currentThreadJob = new DynamicPathThreadJob(startNode, PathPlanningDataStructures.graph.endNode, closedNodes, 15.0f, true);
     currentThreadJob.Start();
     currentThreadJob.Join();
     currentWayPoints = currentThreadJob.getPathWayPoints();
     usesWaypoints    = new bool[currentWayPoints.Count];
     for (int i = 0; i < usesWaypoints.Length; i++)
     {
         usesWaypoints [i] = true;
     }
     closedNodes = currentThreadJob.getClosedNodes();
     //indicate that next path segment needs to calculated
     jobInProgress = false;
     dynamicReplan = false;
 }
Example #4
0
 //Determines the intial path segment for the car
 private void InitialPathPlan()
 {
     //first triggered thread job for this car
     startNode = PathPlanningDataStructures.graph.getClosestNode (transform.position);
     currentThreadJob = new DynamicPathThreadJob (startNode, PathPlanningDataStructures.graph.endNode);
     currentThreadJob.Start();
     currentThreadJob.Join();
     currentWayPoints = currentThreadJob.getPathWayPoints();
     //indicate that next path segment needs to calculated
     pathCalculated = false;
     jobInProgress = false;
 }