本文整理汇总了C++中MapView::deleteChunkView方法的典型用法代码示例。如果您正苦于以下问题:C++ MapView::deleteChunkView方法的具体用法?C++ MapView::deleteChunkView怎么用?C++ MapView::deleteChunkView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapView
的用法示例。
在下文中一共展示了MapView::deleteChunkView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: chunkGeneration
void ChunkGenerator::chunkGeneration(Map& map, Vec3i spectatorPos, MapView& mapView) {
// chunkPos ist Position des Chunks, in dem der Spectator steht in Chunkkoordinaten
Vec2i chunkPos = map.getChunkPos(spectatorPos);
for(int x = chunkPos.x - 8; x <= chunkPos.x + 8; x++) {
for(int z = chunkPos.y - 8; z <= chunkPos.y + 8; z++) {
if(!map.exists({x * 16, 0, z * 16})) {
map.addChunk({x, z});
Chunk chunk = map.getChunk({x, z});
double simpBiomeNoise = SimplexNoise::noise(0.01*x, 0.01*z, m_biome_seed);
int biomeNoise = SimplexNoise::noiseInt(0, 126, simpBiomeNoise);
if(0 <= biomeNoise && biomeNoise <= 44){
chunk.setBiomeType(BiomeType::Desert);
}
if(45 <= biomeNoise && biomeNoise <= 46){
chunk.setBiomeType(BiomeType::DesertPlain);
}
if(47 <= biomeNoise && biomeNoise <= 54){
chunk.setBiomeType(BiomeType::Plains);
}
if(55 <= biomeNoise && biomeNoise <= 56){
chunk.setBiomeType(BiomeType::PlainForest);
}
if(57 <= biomeNoise && biomeNoise <= 69){
chunk.setBiomeType(BiomeType::Forest);
}
// Biome ohne Wasser
if(!m_setWater) {
if(70 <= biomeNoise && biomeNoise <= 74){
chunk.setBiomeType(BiomeType::Hillside);
}
if(75 <= biomeNoise && biomeNoise <= 126){
chunk.setBiomeType(BiomeType::Mountains);
}
} else {
if(70 <= biomeNoise && biomeNoise <= 74){
chunk.setBiomeType(BiomeType::WaterHillside);
}
if(75 <= biomeNoise && biomeNoise <= 126){
chunk.setBiomeType(BiomeType::WaterMountains);
}
}
setBiomes(map, chunk, x, z, biomeNoise);
Vec2i chuPos = Vec2i(x + 1, z);
if(mapView.exists(chuPos)) {
mapView.deleteChunkView(chuPos);
}
chuPos = Vec2i(x - 1, z);
if(mapView.exists(chuPos)) {
mapView.deleteChunkView(chuPos);
}
chuPos = Vec2i(x, z + 1);
if(mapView.exists(chuPos)) {
mapView.deleteChunkView(chuPos);
}
chuPos = Vec2i(x, z - 1);
if(mapView.exists(chuPos)) {
mapView.deleteChunkView(chuPos);
}
}
}
}
}