Esempio n. 1
0
        /// <summary>
        ///		Initilizes a new mesh from a file.
        /// </summary>
        /// <param name="path">Memory location (or url) of mesh file to load.</param>
        public Mesh(object path, MeshFlags flags)
        {
            if ((path is VertexMap) == false)
            {
                if (path is string)
                {
                    _url = (string)path;
                }
                _vertexMap = VertexMapFactory.LoadVertexMap(path);
            }
            else
            {
                _vertexMap = (path as VertexMap).Copy();
            }

            if (_vertexMap == null)
            {
                return;
            }

            _flags      = flags;
            _driverMesh = GraphicsManager.CreateDriverMesh(_vertexMap);

            // Are we dynamic? If not we don't need the full vertexmaps data so lets destroy it and
            // free up a bit of memory.
            //if ((_flags & MeshFlags.Dynamic) == 0 && _vertexMap != null)
            //{
            //    _vertexMap.Data = null;
            //}
        }
Esempio n. 2
0
 /// <summary>
 ///		Saves the given mesh to an mesh file.
 /// </summary>
 /// <param name="url">Location to save the mesh to.</param>
 /// <param name="mesh">Mesh to save to file.</param>
 /// <param name="flags">Bitmask of flags describing how to save the mesh.</param>
 public static bool SaveMesh(object url, Mesh mesh, VertexMapSaveFlags flags)
 {
     return(VertexMapFactory.SaveVertexMap(url, mesh.VertexMap, flags));
 }