@brief Add wave amplitude to existing value at a position @param x X coordinate in grid space @param y Y coordinate in grid space @param value Wave amplitude to add (clamped to max 1.0) Adds to existing wave amplitude, useful for creating multiple overlapping disturbances. Result is clamped to maximum of 1.0.
| 305 | /// Adds to existing wave amplitude, useful for creating multiple |
| 306 | /// overlapping disturbances. Result is clamped to maximum of 1.0. |
| 307 | void addf(size_t x, size_t y, float value) { |
| 308 | // Add a value at the given coordinates in the wave simulation. |
| 309 | float sum = value + mWaveSim.getf(x, y); |
| 310 | mWaveSim.setf(x, y, fl::min(1.0f, sum)); |
| 311 | } |
| 312 | |
| 313 | /// @brief Get wave amplitude as 8-bit value |
| 314 | /// @param x X coordinate in grid space |