DynamicPathThreadJob.getPathWayPoints C# (CSharp) Method

getPathWayPoints() public method

Returns the list of path way points that were determined from ThreadFunction
public getPathWayPoints ( ) : List
return List
    public List<Vector3> getPathWayPoints()
    {
        return pathWayPoints;
    }

Usage Example

Example #1
0
    // <summary>
    // Performs path planning for the next path segment by utilizing a DynamicPathThreadJob
    // that calculates the path in the background
    // </summary>
    public void PathPlanNextSegment()
    {
        bool noItem = (GetComponent <PowerUp>().powerUp == "");

        //Check if the next path segment needs to be calculated in a thread
        if (jobInProgress == false && nextWayPoints == null && dynamicReplan == false)
        {
            //trigger thread job for this car to obtain the next set of waypoints
            Node pathStartNode;
            if (currentThreadJob.destinationNode == PathPlanningDataStructures.graph.endNode)
            {
                pathStartNode = startNode;
            }
            else
            {
                pathStartNode = currentThreadJob.destinationNode;
            }
            currentThreadJob = new DynamicPathThreadJob(pathStartNode, PathPlanningDataStructures.graph.endNode, closedNodes, 12.0f, noItem);
            currentThreadJob.Start();
            jobInProgress = true;
        }
        else if (jobInProgress == false && dynamicReplan)
        {
            Node pathStartNode;
            if (currentThreadJob.destinationNode == PathPlanningDataStructures.graph.endNode)
            {
                pathStartNode = startNode;
            }
            else
            {
                pathStartNode = PathPlanningDataStructures.graph.getClosestNode(transform.position + 3 * transform.forward);
            }
            currentThreadJob = new DynamicPathThreadJob(pathStartNode, PathPlanningDataStructures.graph.endNode, closedNodes, 5.0f, noItem);
            currentThreadJob.Start();
            jobInProgress = true;
        }
        //Check if in progress thread has completed the path calculation
        if (jobInProgress)
        {
            if (currentThreadJob.isFinished())
            {
                if (dynamicReplan)
                {
                    dynamicWayPoints = currentThreadJob.getPathWayPoints();
                    nextWayPoints    = null;
                }
                else
                {
                    nextWayPoints    = currentThreadJob.getPathWayPoints();
                    dynamicWayPoints = null;
                }
                closedNodes   = currentThreadJob.getClosedNodes();
                jobInProgress = false;
            }
        }
    }
All Usage Examples Of DynamicPathThreadJob::getPathWayPoints