Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.77k stars 326 forks source link

Make `FNL::new` and `FNL::with_seed` const #139

Open Kyllingene opened 6 months ago

Kyllingene commented 6 months ago

Makes the two constructors const. Nothing else can be constified because they're setters (which require &mut): the two fields that this is a limitation for are transform_type_3d and fractal_bounding, as they are private. Others require float ops, and are thus also barred (such as get_noise_2d).

If/when constant float ops are stabilized, this might warrant being revisited.

Kyllingene commented 6 months ago

Addresses #137.