add placements priority
This commit is contained in:
parent
fb53b3941c
commit
b5c1050f43
@ -1,3 +1,3 @@
|
|||||||
[
|
[
|
||||||
{"struct": "coal_ore0", "rarity": 22000}
|
{"struct": "coal_ore0", "rarity": 4400}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -17,7 +17,7 @@ local function place_ores(placements, x, z, w, d, seed, hmap, chunk_height)
|
|||||||
local sz = math.random() * d
|
local sz = math.random() * d
|
||||||
local sy = math.random() * (chunk_height * 0.5)
|
local sy = math.random() * (chunk_height * 0.5)
|
||||||
if sy < hmap:at(sx, sz) * chunk_height - 6 then
|
if sy < hmap:at(sx, sz) * chunk_height - 6 then
|
||||||
table.insert(placements, {ore.struct, {sx, sy, sz}, math.random()*4})
|
table.insert(placements, {ore.struct, {sx, sy, sz}, math.random()*4, -1})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -33,7 +33,7 @@ function place_structures_wide(x, z, w, d, seed, chunk_height)
|
|||||||
local placements = {}
|
local placements = {}
|
||||||
if math.random() < 0.05 then -- generate caves
|
if math.random() < 0.05 then -- generate caves
|
||||||
local sx = x + math.random() * 10 - 5
|
local sx = x + math.random() * 10 - 5
|
||||||
local sy = math.random() * (chunk_height / 4) + 27
|
local sy = math.random() * (chunk_height / 4) + 10
|
||||||
local sz = z + math.random() * 10 - 5
|
local sz = z + math.random() * 10 - 5
|
||||||
|
|
||||||
local dir = math.random() * math.pi * 2
|
local dir = math.random() * math.pi * 2
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public:
|
|||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
void perform_line(lua::State* L, PrototypePlacements& placements) {
|
void perform_line(lua::State* L, std::vector<Placement>& placements) {
|
||||||
rawgeti(L, 2);
|
rawgeti(L, 2);
|
||||||
blockid_t block = touinteger(L, -1);
|
blockid_t block = touinteger(L, -1);
|
||||||
pop(L);
|
pop(L);
|
||||||
@ -101,10 +101,17 @@ public:
|
|||||||
int radius = touinteger(L, -1);
|
int radius = touinteger(L, -1);
|
||||||
pop(L);
|
pop(L);
|
||||||
|
|
||||||
placements.lines.emplace_back(block, a, b, radius);
|
int priority = 0;
|
||||||
|
if (objlen(L, -1) >= 6) {
|
||||||
|
rawgeti(L, 6);
|
||||||
|
priority = tointeger(L, -1);
|
||||||
|
pop(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
void perform_placement(lua::State* L, PrototypePlacements& placements) {
|
placements.emplace_back(priority, LinePlacement {block, a, b, radius});
|
||||||
|
}
|
||||||
|
|
||||||
|
void perform_placement(lua::State* L, std::vector<Placement>& placements) {
|
||||||
rawgeti(L, 1);
|
rawgeti(L, 1);
|
||||||
int structIndex = 0;
|
int structIndex = 0;
|
||||||
if (isstring(L, -1)) {
|
if (isstring(L, -1)) {
|
||||||
@ -129,19 +136,28 @@ public:
|
|||||||
pop(L);
|
pop(L);
|
||||||
|
|
||||||
rawgeti(L, 3);
|
rawgeti(L, 3);
|
||||||
int rotation = tointeger(L, -1) & 0b11;
|
uint8_t rotation = tointeger(L, -1) & 0b11;
|
||||||
pop(L);
|
pop(L);
|
||||||
|
|
||||||
placements.structs.emplace_back(structIndex, pos, rotation);
|
int priority = 1;
|
||||||
|
if (objlen(L, -1) >= 4) {
|
||||||
|
rawgeti(L, 4);
|
||||||
|
priority = tointeger(L, -1);
|
||||||
|
pop(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrototypePlacements placeStructuresWide(
|
placements.emplace_back(
|
||||||
|
priority, StructurePlacement {structIndex, pos, rotation}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<Placement> placeStructuresWide(
|
||||||
const glm::ivec2& offset,
|
const glm::ivec2& offset,
|
||||||
const glm::ivec2& size,
|
const glm::ivec2& size,
|
||||||
uint64_t seed,
|
uint64_t seed,
|
||||||
uint chunkHeight
|
uint chunkHeight
|
||||||
) override {
|
) override {
|
||||||
PrototypePlacements placements {};
|
std::vector<Placement> placements {};
|
||||||
|
|
||||||
stackguard _(L);
|
stackguard _(L);
|
||||||
pushenv(L, *env);
|
pushenv(L, *env);
|
||||||
@ -165,11 +181,11 @@ public:
|
|||||||
return placements;
|
return placements;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrototypePlacements placeStructures(
|
std::vector<Placement> placeStructures(
|
||||||
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
|
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
|
||||||
const std::shared_ptr<Heightmap>& heightmap, uint chunkHeight
|
const std::shared_ptr<Heightmap>& heightmap, uint chunkHeight
|
||||||
) override {
|
) override {
|
||||||
PrototypePlacements placements {};
|
std::vector<Placement> placements {};
|
||||||
|
|
||||||
stackguard _(L);
|
stackguard _(L);
|
||||||
pushenv(L, *env);
|
pushenv(L, *env);
|
||||||
|
|||||||
@ -118,11 +118,6 @@ struct Biome {
|
|||||||
BlocksLayers seaLayers;
|
BlocksLayers seaLayers;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PrototypePlacements {
|
|
||||||
std::vector<StructurePlacement> structs {};
|
|
||||||
std::vector<LinePlacement> lines {};
|
|
||||||
};
|
|
||||||
|
|
||||||
/// @brief Generator behaviour and settings interface
|
/// @brief Generator behaviour and settings interface
|
||||||
class GeneratorScript {
|
class GeneratorScript {
|
||||||
public:
|
public:
|
||||||
@ -154,7 +149,7 @@ public:
|
|||||||
uint bpd
|
uint bpd
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
virtual PrototypePlacements placeStructuresWide(
|
virtual std::vector<Placement> placeStructuresWide(
|
||||||
const glm::ivec2& offset,
|
const glm::ivec2& offset,
|
||||||
const glm::ivec2& size,
|
const glm::ivec2& size,
|
||||||
uint64_t seed,
|
uint64_t seed,
|
||||||
@ -169,7 +164,7 @@ public:
|
|||||||
/// @param heightmap area heightmap
|
/// @param heightmap area heightmap
|
||||||
/// @param chunkHeight chunk height to use as heights multiplier
|
/// @param chunkHeight chunk height to use as heights multiplier
|
||||||
/// @return structure & line placements
|
/// @return structure & line placements
|
||||||
virtual PrototypePlacements placeStructures(
|
virtual std::vector<Placement> placeStructures(
|
||||||
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
|
const glm::ivec2& offset, const glm::ivec2& size, uint64_t seed,
|
||||||
const std::shared_ptr<Heightmap>& heightmap, uint chunkHeight) = 0;
|
const std::shared_ptr<Heightmap>& heightmap, uint chunkHeight) = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <variant>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
@ -25,3 +26,13 @@ struct LinePlacement {
|
|||||||
: block(block), a(std::move(a)), b(std::move(b)), radius(radius) {
|
: block(block), a(std::move(a)), b(std::move(b)), radius(radius) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Placement {
|
||||||
|
int priority;
|
||||||
|
std::variant<StructurePlacement, LinePlacement> placement;
|
||||||
|
|
||||||
|
Placement(
|
||||||
|
int priority,
|
||||||
|
std::variant<StructurePlacement, LinePlacement> placement
|
||||||
|
) : priority(priority), placement(std::move(placement)) {}
|
||||||
|
};
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#include "WorldGenerator.hpp"
|
#include "WorldGenerator.hpp"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "maths/util.hpp"
|
#include "maths/util.hpp"
|
||||||
#include "content/Content.hpp"
|
#include "content/Content.hpp"
|
||||||
@ -147,34 +148,36 @@ inline AABB gen_chunk_aabb(int chunkX, int chunkZ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::placeStructure(
|
void WorldGenerator::placeStructure(
|
||||||
const glm::ivec3& offset, size_t structureId, uint8_t rotation,
|
const StructurePlacement& placement, int priority,
|
||||||
int chunkX, int chunkZ
|
int chunkX, int chunkZ
|
||||||
) {
|
) {
|
||||||
auto& structure = *def.structures[structureId]->fragments[rotation];
|
auto& structure =
|
||||||
auto position = glm::ivec3(chunkX * CHUNK_W, 0, chunkZ * CHUNK_D)+offset;
|
*def.structures[placement.structure]->fragments[placement.rotation];
|
||||||
|
auto position =
|
||||||
|
glm::ivec3(chunkX * CHUNK_W, 0, chunkZ * CHUNK_D) + placement.position;
|
||||||
auto size = structure.getSize() + glm::ivec3(0, CHUNK_H, 0);
|
auto size = structure.getSize() + glm::ivec3(0, CHUNK_H, 0);
|
||||||
AABB aabb(position, position + size);
|
AABB aabb(position, position + size);
|
||||||
for (int lcz = -1; lcz <= 1; lcz++) {
|
for (int lcz = -1; lcz <= 1; lcz++) {
|
||||||
for (int lcx = -1; lcx <= 1; lcx++) {
|
for (int lcx = -1; lcx <= 1; lcx++) {
|
||||||
if (lcx == 0 && lcz == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto& otherPrototype = requirePrototype(
|
auto& otherPrototype = requirePrototype(
|
||||||
chunkX + lcx, chunkZ + lcz
|
chunkX + lcx, chunkZ + lcz
|
||||||
);
|
);
|
||||||
auto chunkAABB = gen_chunk_aabb(chunkX + lcx, chunkZ + lcz);
|
auto chunkAABB = gen_chunk_aabb(chunkX + lcx, chunkZ + lcz);
|
||||||
if (chunkAABB.intersect(aabb)) {
|
if (chunkAABB.intersect(aabb)) {
|
||||||
otherPrototype.structures.emplace_back(
|
otherPrototype.placements.emplace_back(
|
||||||
structureId,
|
priority,
|
||||||
offset - glm::ivec3(lcx * CHUNK_W, 0, lcz * CHUNK_D),
|
StructurePlacement {
|
||||||
rotation
|
placement.structure,
|
||||||
|
placement.position -
|
||||||
|
glm::ivec3(lcx * CHUNK_W, 0, lcz * CHUNK_D),
|
||||||
|
placement.rotation}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::placeLine(const LinePlacement& line) {
|
void WorldGenerator::placeLine(const LinePlacement& line, int priority) {
|
||||||
AABB aabb(line.a, line.b);
|
AABB aabb(line.a, line.b);
|
||||||
aabb.fix();
|
aabb.fix();
|
||||||
aabb.a -= line.radius;
|
aabb.a -= line.radius;
|
||||||
@ -187,30 +190,29 @@ void WorldGenerator::placeLine(const LinePlacement& line) {
|
|||||||
for (int cx = cxa; cx <= cxb; cx++) {
|
for (int cx = cxa; cx <= cxb; cx++) {
|
||||||
const auto& found = prototypes.find({cx, cz});
|
const auto& found = prototypes.find({cx, cz});
|
||||||
if (found != prototypes.end()) {
|
if (found != prototypes.end()) {
|
||||||
found->second->lines.push_back(line);
|
found->second->placements.emplace_back(priority, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::placeStructures(
|
void WorldGenerator::placeStructures(
|
||||||
const PrototypePlacements& placements,
|
const std::vector<Placement>& placements,
|
||||||
ChunkPrototype& prototype,
|
ChunkPrototype& prototype,
|
||||||
int chunkX,
|
int chunkX,
|
||||||
int chunkZ
|
int chunkZ
|
||||||
) {
|
) {
|
||||||
util::concat(prototype.structures, placements.structs);
|
for (const auto& placement : placements) {
|
||||||
for (const auto& placement : prototype.structures) {
|
if (auto sp = std::get_if<StructurePlacement>(&placement.placement)) {
|
||||||
const auto& offset = placement.position;
|
if (sp->structure < 0 || sp->structure >= def.structures.size()) {
|
||||||
if (placement.structure < 0 || placement.structure >= def.structures.size()) {
|
logger.error() << "invalid structure index " << sp->structure;
|
||||||
logger.error() << "invalid structure index " << placement.structure;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
placeStructure(
|
placeStructure(*sp, placement.priority, chunkX, chunkZ);
|
||||||
offset, placement.structure, placement.rotation, chunkX, chunkZ);
|
} else {
|
||||||
|
const auto& line = std::get<LinePlacement>(placement.placement);
|
||||||
|
placeLine(line, placement.priority);
|
||||||
}
|
}
|
||||||
for (const auto& line : placements.lines) {
|
|
||||||
placeLine(line);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +253,7 @@ void WorldGenerator::generateStructures(
|
|||||||
for (uint x = 0; x < CHUNK_W; x++) {
|
for (uint x = 0; x < CHUNK_W; x++) {
|
||||||
float rand = structsRand.randFloat();
|
float rand = structsRand.randFloat();
|
||||||
const Biome* biome = biomes[z * CHUNK_W + x];
|
const Biome* biome = biomes[z * CHUNK_W + x];
|
||||||
size_t structureId = biome->structures.choose(rand, -1);
|
int structureId = biome->structures.choose(rand, -1);
|
||||||
if (structureId == -1) {
|
if (structureId == -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -264,12 +266,16 @@ void WorldGenerator::generateStructures(
|
|||||||
glm::ivec3 position {x, height, z};
|
glm::ivec3 position {x, height, z};
|
||||||
position.x -= structure.getSize().x / 2;
|
position.x -= structure.getSize().x / 2;
|
||||||
position.z -= structure.getSize().z / 2;
|
position.z -= structure.getSize().z / 2;
|
||||||
prototype.structures.push_back({
|
prototype.placements.emplace_back(
|
||||||
static_cast<int>(structureId), position, rotation});
|
1, StructurePlacement {structureId, position, rotation}
|
||||||
|
);
|
||||||
placeStructure(
|
placeStructure(
|
||||||
position,
|
StructurePlacement {
|
||||||
structureId,
|
structureId,
|
||||||
rotation,
|
position,
|
||||||
|
rotation
|
||||||
|
},
|
||||||
|
1,
|
||||||
chunkX,
|
chunkX,
|
||||||
chunkZ
|
chunkZ
|
||||||
);
|
);
|
||||||
@ -361,6 +367,9 @@ void WorldGenerator::generatePlants(
|
|||||||
blockid_t plant = biome->plants.choose(rand);
|
blockid_t plant = biome->plants.choose(rand);
|
||||||
if (plant) {
|
if (plant) {
|
||||||
auto& voxel = voxels[vox_index(x, height+1, z)];
|
auto& voxel = voxels[vox_index(x, height+1, z)];
|
||||||
|
if (voxel.id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
auto& groundVoxel = voxels[vox_index(x, height, z)];
|
auto& groundVoxel = voxels[vox_index(x, height, z)];
|
||||||
if (indices.get(groundVoxel.id)->rt.solid) {
|
if (indices.get(groundVoxel.id)->rt.solid) {
|
||||||
voxel = {plant, {}};
|
voxel = {plant, {}};
|
||||||
@ -422,9 +431,8 @@ void WorldGenerator::generate(voxel* voxels, int chunkX, int chunkZ) {
|
|||||||
generate_pole(groundLayers, height, 0, seaLevel, voxels, x, z);
|
generate_pole(groundLayers, height, 0, seaLevel, voxels, x, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
generateLines(prototype, voxels, chunkX, chunkZ);
|
generatePlacements(prototype, voxels, chunkX, chunkZ);
|
||||||
generatePlants(prototype, values, voxels, chunkX, chunkZ, biomes);
|
generatePlants(prototype, values, voxels, chunkX, chunkZ, biomes);
|
||||||
generateStructures(prototype, voxels, chunkX, chunkZ);
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (uint i = 0; i < CHUNK_VOL; i++) {
|
for (uint i = 0; i < CHUNK_VOL; i++) {
|
||||||
@ -436,13 +444,36 @@ void WorldGenerator::generate(voxel* voxels, int chunkX, int chunkZ) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::generateStructures(
|
void WorldGenerator::generatePlacements(
|
||||||
const ChunkPrototype& prototype, voxel* voxels, int chunkX, int chunkZ
|
const ChunkPrototype& prototype, voxel* voxels, int chunkX, int chunkZ
|
||||||
) {
|
) {
|
||||||
for (const auto& placement : prototype.structures) {
|
auto placements = prototype.placements;
|
||||||
|
std::stable_sort(
|
||||||
|
placements.begin(),
|
||||||
|
placements.end(),
|
||||||
|
[](const auto& a, const auto& b) {
|
||||||
|
return a.priority < b.priority;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
for (const auto& placement : placements) {
|
||||||
|
if (auto structure = std::get_if<StructurePlacement>(&placement.placement)) {
|
||||||
|
generateStructure(prototype, *structure, voxels, chunkX, chunkZ);
|
||||||
|
} else {
|
||||||
|
const auto& line = std::get<LinePlacement>(placement.placement);
|
||||||
|
generateLine(prototype, line, voxels, chunkX, chunkZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorldGenerator::generateStructure(
|
||||||
|
const ChunkPrototype& prototype,
|
||||||
|
const StructurePlacement& placement,
|
||||||
|
voxel* voxels,
|
||||||
|
int chunkX, int chunkZ
|
||||||
|
) {
|
||||||
if (placement.structure < 0 || placement.structure >= def.structures.size()) {
|
if (placement.structure < 0 || placement.structure >= def.structures.size()) {
|
||||||
logger.error() << "invalid structure index " << placement.structure;
|
logger.error() << "invalid structure index " << placement.structure;
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
auto& generatingStructure = def.structures[placement.structure];
|
auto& generatingStructure = def.structures[placement.structure];
|
||||||
auto& structure = *generatingStructure->fragments[placement.rotation];
|
auto& structure = *generatingStructure->fragments[placement.rotation];
|
||||||
@ -476,14 +507,16 @@ void WorldGenerator::generateStructures(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldGenerator::generateLines(
|
void WorldGenerator::generateLine(
|
||||||
const ChunkPrototype& prototype, voxel* voxels, int chunkX, int chunkZ
|
const ChunkPrototype& prototype,
|
||||||
|
const LinePlacement& line,
|
||||||
|
voxel* voxels,
|
||||||
|
int chunkX, int chunkZ
|
||||||
) {
|
) {
|
||||||
const auto& indices = content->getIndices()->blocks;
|
const auto& indices = content->getIndices()->blocks;
|
||||||
for (const auto& line : prototype.lines) {
|
|
||||||
int cgx = chunkX * CHUNK_W;
|
int cgx = chunkX * CHUNK_W;
|
||||||
int cgz = chunkZ * CHUNK_D;
|
int cgz = chunkZ * CHUNK_D;
|
||||||
|
|
||||||
@ -510,7 +543,10 @@ void WorldGenerator::generateLines(
|
|||||||
glm::ivec3 closest = util::closest_point_on_segment(
|
glm::ivec3 closest = util::closest_point_on_segment(
|
||||||
a, b, point
|
a, b, point
|
||||||
);
|
);
|
||||||
if (y > 0 && util::distance2(closest, point) <= radius*radius && line.block == BLOCK_AIR) {
|
if (y > 0 &&
|
||||||
|
util::distance2(closest, point) <= radius * radius &&
|
||||||
|
line.block == BLOCK_AIR
|
||||||
|
) {
|
||||||
auto& voxel = voxels[vox_index(x, y, z)];
|
auto& voxel = voxels[vox_index(x, y, z)];
|
||||||
if (!indices.require(voxel.id).replaceable) {
|
if (!indices.require(voxel.id).replaceable) {
|
||||||
voxel = {line.block, {}};
|
voxel = {line.block, {}};
|
||||||
@ -529,7 +565,6 @@ void WorldGenerator::generateLines(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldGenDebugInfo WorldGenerator::createDebugInfo() const {
|
WorldGenDebugInfo WorldGenerator::createDebugInfo() const {
|
||||||
|
|||||||
@ -17,7 +17,6 @@ struct GeneratorDef;
|
|||||||
class Heightmap;
|
class Heightmap;
|
||||||
struct Biome;
|
struct Biome;
|
||||||
class VoxelFragment;
|
class VoxelFragment;
|
||||||
struct PrototypePlacements;
|
|
||||||
|
|
||||||
enum class ChunkPrototypeLevel {
|
enum class ChunkPrototypeLevel {
|
||||||
VOID=0, WIDE_STRUCTS, BIOMES, HEIGHTMAP, STRUCTURES
|
VOID=0, WIDE_STRUCTS, BIOMES, HEIGHTMAP, STRUCTURES
|
||||||
@ -32,9 +31,7 @@ struct ChunkPrototype {
|
|||||||
/// @brief chunk heightmap
|
/// @brief chunk heightmap
|
||||||
std::shared_ptr<Heightmap> heightmap;
|
std::shared_ptr<Heightmap> heightmap;
|
||||||
|
|
||||||
std::vector<StructurePlacement> structures;
|
std::vector<Placement> placements;
|
||||||
|
|
||||||
std::vector<LinePlacement> lines;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WorldGenDebugInfo {
|
struct WorldGenDebugInfo {
|
||||||
@ -69,22 +66,32 @@ class WorldGenerator {
|
|||||||
|
|
||||||
void generateStructures(ChunkPrototype& prototype, int x, int z);
|
void generateStructures(ChunkPrototype& prototype, int x, int z);
|
||||||
|
|
||||||
|
void generatePlacements(
|
||||||
|
const ChunkPrototype& prototype, voxel* voxels, int x, int z
|
||||||
|
);
|
||||||
|
|
||||||
void generateBiomes(ChunkPrototype& prototype, int x, int z);
|
void generateBiomes(ChunkPrototype& prototype, int x, int z);
|
||||||
|
|
||||||
void generateHeightmap(ChunkPrototype& prototype, int x, int z);
|
void generateHeightmap(ChunkPrototype& prototype, int x, int z);
|
||||||
|
|
||||||
void placeStructure(
|
void placeStructure(
|
||||||
const glm::ivec3& offset, size_t structure, uint8_t rotation,
|
const StructurePlacement& placement, int priority,
|
||||||
int chunkX, int chunkZ
|
int chunkX, int chunkZ
|
||||||
);
|
);
|
||||||
|
|
||||||
void placeLine(const LinePlacement& line);
|
void placeLine(const LinePlacement& line, int priority);
|
||||||
|
|
||||||
void generateLines(
|
void generateLine(
|
||||||
const ChunkPrototype& prototype, voxel* voxels, int x, int z
|
const ChunkPrototype& prototype,
|
||||||
|
const LinePlacement& placement,
|
||||||
|
voxel* voxels,
|
||||||
|
int x, int z
|
||||||
);
|
);
|
||||||
void generateStructures(
|
void generateStructure(
|
||||||
const ChunkPrototype& prototype, voxel* voxels, int x, int z
|
const ChunkPrototype& prototype,
|
||||||
|
const StructurePlacement& placement,
|
||||||
|
voxel* voxels,
|
||||||
|
int x, int z
|
||||||
);
|
);
|
||||||
void generatePlants(
|
void generatePlants(
|
||||||
const ChunkPrototype& prototype,
|
const ChunkPrototype& prototype,
|
||||||
@ -104,7 +111,7 @@ class WorldGenerator {
|
|||||||
);
|
);
|
||||||
|
|
||||||
void placeStructures(
|
void placeStructures(
|
||||||
const PrototypePlacements& placements,
|
const std::vector<Placement>& placements,
|
||||||
ChunkPrototype& prototype,
|
ChunkPrototype& prototype,
|
||||||
int x, int z);
|
int x, int z);
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user