public TerrainGenerator(long seed) { var seededConstant = new SimplexPerlin((int)seed, NoiseQuality.Fast); TurbX = new OpenSimplex(seed); TurbY = new OpenSimplex(seed); Chaos = new RidgedMultiFractal { OctaveCount = 7, Primitive2D = seededConstant }; Hill = new OpenSimplex(seed); Alt = new HybridMultiFractal { OctaveCount = 8, Gain = 0.1f, Primitive2D = seededConstant }; Temp = new OpenSimplex(seed); Dry = new HeterogeneousMultiFractal() { Primitive2D = seededConstant }; Small = new HeterogeneousMultiFractal { OctaveCount = 2, Primitive2D = seededConstant }; Rock = new HybridMultiFractal() { Gain = 0.3f, Primitive2D = seededConstant }; Cliff = new HybridMultiFractal() { Gain = 0.3f, Primitive2D = seededConstant }; Humid = new Billow { OctaveCount = 12, Gain = 0.125f, Frequency = 1, Primitive2D = seededConstant }; }
public void Begin() { TexturePack = AssetDatabase.GetAsset <TexturePack>(""); TerrainNoise = new OpenSimplex(Seed.GetSeedNum()); BiomeNoise = new CellNoise(Seed.GetSeedNum()); Randomizer = new Random(Seed.GetSeedNum()); WorldCamera = new Camera(); Skybox = new Skybox(AssetDatabase.GetAsset <Material>("Resources/Materials/World/Sky.mat")); loadingScreenTexture = AssetDatabase.GetAsset <Texture>("Resources/Textures/GUI/img_loading_screen.png"); loadingScreenTextureDickJoke = AssetDatabase.GetAsset <Texture>("Resources/Textures/GUI/img_loading_screen_willy.png"); isDickJoke = Maths.Chance(0.01f); loadingScreenStyle = new GUIStyle() { Normal = new GUIStyleOption() { TextColor = Color4.White }, HorizontalAlignment = HorizontalAlignment.Middle, VerticalAlignment = VerticalAlignment.Middle, FontSize = 48, Font = GUI.LabelStyle.Font }; lightAngle = 5; lightBufferData = new LightingUniformBufferData(); HasFinishedInitialLoading = false; requiredChunksLoadedNum = (worldSize + worldSize + 1) * (worldSize + worldSize + 1); foreach (var entity in loadedEntities) { entity.Begin(); } ThreadStart chunkThreadStart = ChunkThread; chunkThread = new Thread(chunkThreadStart) { Name = "Chunk Generation Thread" }; chunkThread.Start(); }
public RandomMotionProviderViewModel(DeviceAxis target, IEventAggregator eventAggregator) : base(target, eventAggregator) { _noise = new OpenSimplex(Random.Shared.NextInt64()); }