Refactor radar to return a full set of the tiles within rover range
This commit is contained in:
parent
4e6bf385ad
commit
b0e076ac1a
7 changed files with 74 additions and 77 deletions
|
@ -144,9 +144,17 @@ func (a *Atlas) ChunkOrigin(chunk int) Vector {
|
|||
return v.Multiplied(a.ChunkSize)
|
||||
}
|
||||
|
||||
// GetWorldExtent gets the extent of the world
|
||||
func (a *Atlas) GetWorldExtent() int {
|
||||
return (a.Size / 2) * a.ChunkSize
|
||||
// GetWorldExtent gets the min and max valid coordinates of world
|
||||
func (a *Atlas) GetWorldExtents() (min Vector, max Vector) {
|
||||
min = Vector{
|
||||
-(a.Size / 2) * a.ChunkSize,
|
||||
-(a.Size / 2) * a.ChunkSize,
|
||||
}
|
||||
max = Vector{
|
||||
-min.X - 1,
|
||||
-min.Y - 1,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Grow will return a grown copy of the current atlas
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue