Fix Atlas gen with simplification

Only track lower and upper bounds in world space, and speak in terms of world space and chunks
This commit is contained in:
Marc Di Luzio 2020-07-04 22:34:28 +01:00
parent dbe944bb4e
commit 8b83672dcc
5 changed files with 240 additions and 121 deletions

View file

@ -39,3 +39,19 @@ func Min(x, y int) int {
}
return x
}
// RoundUp rounds a value up to the nearest multiple
func RoundUp(toRound int, multiple int) int {
remainder := Pmod(toRound, multiple)
if remainder == 0 {
return toRound
}
return (multiple - remainder) + toRound
}
// RoundDown rounds a value down to the nearest multiple
func RoundDown(toRound int, multiple int) int {
remainder := Pmod(toRound, multiple)
return toRound - remainder
}