Exemplo n.º 1
0
        //Get one Reeds-Shepp path and display it
        private void GetOnePath()
        {
            //Deactivate all line renderers
            DeactivateAllLineRenderers();

            //Get one path
            Vector3 startPos = startCarObj.transform.position;

            float startHeading = startCarObj.transform.eulerAngles.y * Mathf.Deg2Rad;

            Vector3 goalPos = goalCarObj.transform.position;

            float goalHeading = goalCarObj.transform.eulerAngles.y * Mathf.Deg2Rad;

            OneReedsSheppPath oneReedsSheppPath = generateReedsShepp.GetOneReedSheppPath(startPos, startHeading, goalPos, goalHeading);

            if (oneReedsSheppPath != null && oneReedsSheppPath.pathCoordinates.Count > 0)
            {
                //Display the path with a line renderer
                DisplayOneReedsSheppPath(oneReedsSheppPath.pathCoordinates);

                //Display the tangent spheres
                //DisplayTangentSpheres(oneReedsSheppPath);
            }
        }
Exemplo n.º 2
0
        //Get the shortest Reeds-Shepp path and display it
        private void DisplayShortestPath(Transform startCarTrans, Transform goalCarTrans)
        {
            Vector3 startPos = startCarTrans.position;

            float startHeading = startCarTrans.eulerAngles.y * Mathf.Deg2Rad;

            Vector3 goalPos = goalCarTrans.position;

            float goalHeading = goalCarTrans.eulerAngles.y * Mathf.Deg2Rad;

            //Get the path
            OneReedsSheppPath oneReedsSheppPath = generateReedsShepp.GetOneReedSheppPath(startPos, startHeading, goalPos, goalHeading);

            //If we found a path
            if (oneReedsSheppPath != null && oneReedsSheppPath.pathCoordinates.Count > 0)
            {
                //Display the path with line renderers
                //DisplayPath(oneReedsSheppPath.pathCoordinates);
            }
        }