// Use this for initialization void Start() { controller = GetComponent <CarController>(); phy = GetComponent <OnDemandPhysics>(); Bounds b = GameObject.Find("Ground").GetComponent <Collider>().bounds; bounds = new Bounds(b.center, new Vector3(b.size.x, Mathf.Infinity, b.size.z)); try { ReedAndShepp.ReedAndShepp.SetDllFolder(Application.streamingAssetsPath); ras = new ReedAndShepp.ReedAndShepp(controller.radius); } catch { Debug.Log("Error while initializing R&S module !"); } retry(); }
static void Main(string[] args) { try { ReedAndShepp ras = new ReedAndShepp(5.0); ReedAndShepp.Vector3[] path; Console.WriteLine(ras.ComputeCurve(new ReedAndShepp.Vector3(0, 0, 0), new ReedAndShepp.Vector3(1, 1, 0), 0.1, out path)); foreach (ReedAndShepp.Vector3 v in path) { ReedAndShepp.Vector3 v2 = v.Floor(2); Console.WriteLine(v2.x.ToString() + "\t" + v2.y.ToString() + "\t" + v2.z.ToString()); } Console.ReadLine(); } catch (Exception e) { Console.WriteLine(e.ToString() + " : " + e.Message); Console.ReadLine(); } }