Function inexor::vulkan_renderer::world::create_random_world

Function Documentation

std::shared_ptr<world::Cube> inexor::vulkan_renderer::world::create_random_world(std::uint32_t max_depth, const glm::vec3 &position, std::optional<std::uint32_t> seed = std::nullopt)

Construct a randomly generated cube world. Using the following probabilities: empty: 30% solid: 30% normal: 40% The number of indentations are evenly distributed. Empty normal cubes are not generated.

Parameters
  • max_depth – The maximum of nested octants.

  • position – The position where the root cube is placed.

  • seed – The seed used for the random number generator.