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:
parent
dbe944bb4e
commit
8b83672dcc
5 changed files with 240 additions and 121 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue