7#include "resource/asset/terrain_asset.h"
31 bool empty()
const {
return i1 < i0 || j1 < j0; }
82 const glm::vec3& origin,
83 const glm::vec3& direction,
The edits a brush makes to a terrain, one dab at a time: raise, smooth and flatten its heights,...
Definition terrain_brush.h:20
bool hit(const TerrainAsset &terrain, const glm::vec3 &origin, const glm::vec3 &direction, float range, float &t)
Where a ray first meets terrain's surface, over its grid.
Region grow(TerrainAsset &terrain, const Dab &dab, uint32_t foliage, float target)
Move the density of plant layer foliage under dab toward target.
Region paint(TerrainAsset &terrain, const Dab &dab, uint32_t layer)
Move each vertex's layer shares under dab toward all of layer.
float falloff(const Dab &dab, float distance)
How much of a dab's effect reaches distance from its centre.
Region smooth(TerrainAsset &terrain, const Dab &dab)
Pull each height under dab toward its neighbours' mean.
Region raise(TerrainAsset &terrain, const Dab &dab, float metres)
Raise the heights under dab, metres at its centre; negative lowers.
Region flatten(TerrainAsset &terrain, const Dab &dab, float height)
Pull each height under dab toward height.
Region reach(const TerrainAsset &terrain, const Dab &dab)
The grid vertices within dab, clamped to terrain's grid.
A terrain: a square grid of heights, the share of each of four materials painted at each grid vertex,...
Definition terrain_asset.h:54
One application of a brush: where, how wide, how much.
Definition terrain_brush.h:40
glm::vec2 centre
Local metres along X and Z.
Definition terrain_brush.h:41
float radius
Metres.
Definition terrain_brush.h:42
float hardness
Definition terrain_brush.h:46
float strength
Definition terrain_brush.h:43
Grid vertices [i0, i1] by [j0, j1], inclusive: what a dab touched.
Definition terrain_brush.h:25
void add(const Region &other)
Grow to hold other too.
int i1
Below i0 when nothing was touched.
Definition terrain_brush.h:28