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