diff --git a/include/cglm/call/noise.h b/include/cglm/call/noise.h index bf2e7886..6020c89b 100644 --- a/include/cglm/call/noise.h +++ b/include/cglm/call/noise.h @@ -21,6 +21,10 @@ CGLM_EXPORT float glmc_perlin_vec3(vec3 point); +CGLM_EXPORT +float +glmc_perlin_vec2(vec2 point); + #ifdef __cplusplus } #endif diff --git a/include/cglm/struct/noise.h b/include/cglm/struct/noise.h index 4b856f03..3fd7d2e3 100644 --- a/include/cglm/struct/noise.h +++ b/include/cglm/struct/noise.h @@ -42,4 +42,16 @@ glms_perlin_vec3(vec3s point) { return glm_perlin_vec3(point.raw); } +/*! + * @brief Classic perlin noise + * + * @param[in] point 2D vector + * @returns perlin noise value + */ +CGLM_INLINE +float +glms_perlin_vec2(vec2s point) { + return glm_perlin_vec2(point.raw); +} + #endif /* cglms_noises_h */ diff --git a/src/noise.c b/src/noise.c index 8be47382..70a8f3c8 100644 --- a/src/noise.c +++ b/src/noise.c @@ -18,4 +18,10 @@ CGLM_EXPORT float glmc_perlin_vec3(vec3 p) { return glm_perlin_vec3(p); +} + +CGLM_EXPORT +float +glmc_perlin_vec2(vec2 p) { + return glm_perlin_vec2(p); } \ No newline at end of file