Ejemplo n.º 1
0
        public static MyStorageBase LoadRandomizedVoxelMapPrefab(string prefabFilePath)
        {
            var storage = MyStorageBase.LoadFromFile(prefabFilePath);

            storage.DataProvider = MyCompositeShapeProvider.CreateAsteroidShape(
                MyUtils.GetRandomInt(int.MaxValue - 1) + 1,
                storage.Size.AbsMax() * MyVoxelConstants.VOXEL_SIZE_IN_METRES,
                MySession.Static.Settings.VoxelGeneratorVersion);
            storage.Reset(MyStorageDataTypeFlags.Material);
            return(storage);
        }
Ejemplo n.º 2
0
        IMyVoxelMap IMyVoxelMaps.CreateVoxelMapFromStorageName(string storageName, string prefabVoxelMapName, Vector3D position)
        {
            var filePath = MyWorldGenerator.GetVoxelPrefabPath(prefabVoxelMapName);
            var storage  = MyStorageBase.LoadFromFile(filePath);

            if (storage == null)
            {
                return(null);
            }
            storage.DataProvider = MyCompositeShapeProvider.CreateAsteroidShape(0,
                                                                                storage.Size.AbsMax() * MyVoxelConstants.VOXEL_SIZE_IN_METRES,
                                                                                MySession.Static.Settings.VoxelGeneratorVersion);
            return(MyWorldGenerator.AddVoxelMap(storageName, storage, position));
        }
 public static MyStorageBase CreateProceduralAsteroidStorage(int seed, float radius)
 {
     return(new MyOctreeStorage(MyCompositeShapeProvider.CreateAsteroidShape(seed, radius, 0), MyVoxelCoordSystems.FindBestOctreeSize(radius)));
 }
 public static MyStorageBase CreateProceduralAsteroidStorage(int seed, float radius, float deviationScale)
 {
     return(new MyOctreeStorage(MyCompositeShapeProvider.CreateAsteroidShape(seed, radius, 0), FindBestOctreeSize(radius)));
 }