SEToolbox.Interop.Asteroids.MyVoxelMap.GetPreview C# (CSharp) Method

GetPreview() public static method

public static GetPreview ( string filename, Vector3I &size, BoundingBoxD &contentBounds, long &voxCells, bool &isValid ) : void
filename string
size Vector3I
contentBounds BoundingBoxD
voxCells long
isValid bool
return void
        public static void GetPreview(string filename, out Vector3I size, out BoundingBoxD contentBounds, out long voxCells, out bool isValid)
        {
            try
            {
                var map = new MyVoxelMap();
                map.Load(filename, SpaceEngineersCore.Resources.GetDefaultMaterialName(), false);
                size = map.Size;
                contentBounds = map.BoundingContent;
                voxCells = map.SumVoxelCells();
                isValid = map.IsValid;
            }
            catch (Exception ex)
            {
                size = Vector3I.Zero;
                contentBounds = new BoundingBoxD();
                voxCells = 0;
                isValid = false;
                DiagnosticsLogging.LogWarning(string.Format(Res.ExceptionState_CorruptAsteroidFile, filename), ex);
            }
        }