Skip to content

Commit

Permalink
glm_perlin_vec2 boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinKonowalczyk committed Jan 17, 2025
1 parent a98c270 commit 1377a94
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cglm/call/noise.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ CGLM_EXPORT
float
glmc_perlin_vec3(vec3 point);

CGLM_EXPORT
float
glmc_perlin_vec2(vec2 point);

#ifdef __cplusplus
}
#endif
Expand Down
12 changes: 12 additions & 0 deletions include/cglm/struct/noise.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
6 changes: 6 additions & 0 deletions src/noise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 1377a94

Please sign in to comment.