HighMap library (C++)
Loading...
Searching...
No Matches
rock_procedural.hpp
Go to the documentation of this file.
1/* Copyright (c) 2026 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
9#pragma once
10
11#include <cstddef>
12
13#include "highmap/array.hpp"
18
19namespace hmap
20{
21
22// ============================================================================
23// Procedural Rock Placement Functions (Alphabetically Sorted)
24// ============================================================================
25
53Array build_rock_density(const Array &heightmap,
54 float max_slope = 0.05f,
55 float bulkify_amp = 0.01f,
56 float weight_elev = 1.0f,
57 float weight_slope = 1.0f,
58 float weight_rivers = 1.0f,
59 float river_talus_ref = 0.1f,
60 float river_clipping_ratio = 1000.0f,
61 const Array &secondary_density = {},
62 float weight_secondary = 1.0f,
63 const Array &exclusion_mask = {},
64 float exclusion_threshold = 0.f,
65 const BBox2D &bbox = BBox2D{});
66
105 size_t rock_count,
106 const Array &elevation,
107 float min_elev = 0.f,
108 float max_elev = 0.9f,
109 float max_slope = 1.f,
110 const Array &density = {},
111 const Array &exclusion = {},
112 float size_slope_weight = 0.f,
113 float size_elevation_gain = 1.f,
114 float size_elevation_exponent = 1.f,
115 const RockSeedingOptions &options = {},
116 const UvTile &region = UvTile::unit(),
118
119} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Array class, helper to manipulate 2D float array with "(i, j)" indexing.
Definition array.hpp:31
Abstract communicator interface providing MPI-style collective directives for single-source SPMD Arra...
Definition communicator_interface.hpp:60
Container class representing a field of rocks/boulders (scree, talus, or boulder field).
Definition rock_field.hpp:32
static SingleArrayComm & instance()
Definition communicator.cpp:78
Definition opencv.hpp:20
RockField place_rocks_procedural(size_t rock_count, const Array &elevation, float min_elev=0.f, float max_elev=0.9f, float max_slope=1.f, const Array &density={}, const Array &exclusion={}, float size_slope_weight=0.f, float size_elevation_gain=1.f, float size_elevation_exponent=1.f, const RockSeedingOptions &options={}, const UvTile &region=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance())
Places rocks procedurally on a terrain, without physical simulation.
Definition rock_procedural.cpp:161
Array build_rock_density(const Array &heightmap, float max_slope=0.05f, float bulkify_amp=0.01f, float weight_elev=1.0f, float weight_slope=1.0f, float weight_rivers=1.0f, float river_talus_ref=0.1f, float river_clipping_ratio=1000.0f, const Array &secondary_density={}, float weight_secondary=1.0f, const Array &exclusion_mask={}, float exclusion_threshold=0.f, const BBox2D &bbox=BBox2D{})
Computes a probability density map in [0, 1] for rock placement based on elevation,...
Definition rock_procedural.cpp:33
Axis-aligned 2D bounding box in world coordinates.
Definition bbox2d.hpp:25
Configuration parameters for rock field seeding algorithms.
Definition rock_seeding.hpp:31
Describes an Array tile's position within the normalized [0, 1]^2 UV domain and global index grid.
Definition uv_tile.hpp:46
static const UvTile & unit()
Definition uv_tile.cpp:31
Normalized UV-domain tile descriptor for single-source SPMD Array algorithms and VirtualArray dispatc...