Exemplo n.º 1
0
        //private void BuildVerticiesAndIndicies()
        //{
        //    Vector3[] vertices;
        //    _manager.GetRecastTriangleMesh(out vertices, out indices);



        //    _cachedVertices = new VertexPositionNormalColored[vectors.Length];
        //    //_cachedIndices = indices;
        //    for (var i = 0; i < vectors.Length; i++)
        //    {
        //        _cachedVertices[i] = new VertexPositionNormalColored(vectors[i], Color.White, Vector3.Up);
        //    }

        //}

        /// <summary>
        /// TODO: Add Identifier for mesh to be generated
        /// </summary>
        /// <param name="geom"></param>
        /// <returns></returns>
        bool GenerateInputMesh(IntPtr geom)
        {
            //Console.WriteLine("GenMesh");
            _manager.GetRecastTriangleMesh(out vectors, out indices);
            RecastAPI.GenerateInputMesh(geom, vectors, indices, "Default");
            return(true);
        }
Exemplo n.º 2
0
        // TODO: Make RecastRenderer work, too
        public void Start()
        {
            //RecastAPI.RemoveMeshGenerator("xxx");
            RecastAPI.InitAPI();

            RecastAPI.AddInputMeshGenerator("[Default]", InputMeshGenerator); // Input

            RecastAPI.NavMeshGenerated += OnNewNavMesh;                       // Ouptut

            RecastAPI.SetNavSpeed(100.0f);

            RecastAPI.RunRecast();
        }