Type Alias veloren_common::terrain::TerrainGrid
source · pub type TerrainGrid = VolGrid2d<TerrainChunk>;
Aliased Type§
struct TerrainGrid {
map_size_lg: MapSizeLg,
default: Arc<Chonk<Block, TerrainChunkSize, TerrainChunkMeta>>,
chunks: HashMap<Vec2<i32>, Arc<Chonk<Block, TerrainChunkSize, TerrainChunkMeta>>, GridHasher>,
}
Fields§
§map_size_lg: MapSizeLg
Size of the entire (not just loaded) map.
default: Arc<Chonk<Block, TerrainChunkSize, TerrainChunkMeta>>
Default voxel for use outside of max map bounds.
chunks: HashMap<Vec2<i32>, Arc<Chonk<Block, TerrainChunkSize, TerrainChunkMeta>>, GridHasher>
Implementations§
source§impl TerrainGrid
impl TerrainGrid
sourcepub fn find_ground(&self, pos: Vec3<i32>) -> Vec3<i32>
pub fn find_ground(&self, pos: Vec3<i32>) -> Vec3<i32>
Find a location suitable for spawning an entity near the given position (but in the same chunk).