示例#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;
            //}
        }
示例#2
0
 /// <summary>
 ///		Recreates the mesh  and resources required to render this mesh.
 /// </summary>
 public void CreateMesh()
 {
     _driverMesh = GraphicsManager.CreateDriverMesh(_vertexMap);
 }
示例#3
0
 /// <summary>
 ///		Disposes of all resources used by this image.
 /// </summary>
 public void Dispose()
 {
     _vertexMap  = null;
     _driverMesh = null;
 }
示例#4
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;
            //}
        }
示例#5
0
 /// <summary>
 ///		Disposes of all resources used by this image.
 /// </summary>
 public void Dispose()
 {
     _vertexMap = null;
     _driverMesh = null;
 }
示例#6
0
 /// <summary>
 ///		Recreates the mesh  and resources required to render this mesh.
 /// </summary>
 public void CreateMesh()
 {
     _driverMesh = GraphicsManager.CreateDriverMesh(_vertexMap);
 }