summaryrefslogtreecommitdiff
path: root/src/libs/din/din.h
AgeCommit message (Collapse)Author
2023-12-31libs/din: constify coordinate to din()Vito Caputo
This doesn't seem to make any impact on performance, but it's awkward to be modifying the supplied coordinate as if it's a result... the coordinate input should be left alone, and should be able to get reused across din calls so only the varying members need to get updated across calls.
2023-12-31libs/din: constify din_t for din()Vito Caputo
din() just samples the din_t which will always just be a read-only operation, so constify this. It might even help the compiler generate faster code for din-heavy inner loops like modules/swab uses.
2022-07-20libs/din: pass seed to din_new()Vito Caputo
also update call sites in modules/{meta2d,swab} accordingly
2019-11-25din: don't include v3f.h in din.hVito Caputo
This requires a forward declaration of v3f_t and changing din() to take a v3f_t *. The swab module needed updating to supply a pointer type and a v3f_t definition. This is being done so din.h users can have their own v3f implementations. I might consolidate all the duplicated vector code scattered throughout the libs and modules, but for now I'm carrying on with the original intention of having modules be largely self-contained. Though the introduction of libs like ray and din has certainly violated that a bit already.
2019-11-18libs/din: add a perlin noise implementationVito Caputo
This is a 3D noise field addressed as a unit cube. The caller supplies the resolution of the noise field in three dimensions. I've just pulled in my v3f.h here, but it probably makes sense to later on move vector headers into libs/ and share them. Later. It's called din as in noise, because it's shorter than perlin and noise.
© All Rights Reserved