Procedural Planets

Integrated Sebastian Lague's Planet Generator
Created Tour function in SectorRenderer which makes the camera follow each terrestrial planet in turn
This commit is contained in:
Reinier Vens 2020-12-05 23:43:02 +00:00
commit 53a91351b7
332 changed files with 11904 additions and 78 deletions

View file

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class Normalizer {
public static void Normalize (System.Func<int, float> getValue, System.Action<int, float> setValue, int length) {
float min = float.PositiveInfinity;
float max = float.NegativeInfinity;
for (int i = 0; i < length; i++) {
float value = getValue (i);
min = System.Math.Min (min, value);
max = System.Math.Max (max, value);
}
for (int i = 0; i < length; i++) {
setValue (i, Mathf.InverseLerp (min, max, getValue (i)));
}
}
}