Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic ivec functions #251

Merged
merged 30 commits into from
May 22, 2022
Merged

Conversation

Chris-F5
Copy link
Contributor

Pull request for issue #248
Adds functions for ivec[2|3|4]
Each new function has test and documentation.
Compiled successfully on windows with CMake.
Compiled successfully on linux with both CMake and meson/ninja.

New Functions:

void glm_ivec2(int * __restrict v, ivec2 dest)
void glm_ivec2_copy(ivec2 a, ivec2 dest)
void glm_ivec2_zero(ivec2 v)
void glm_ivec2_one(ivec2 v)
void glm_ivec2_add(ivec2 a, ivec2 b, ivec2 dest)
void glm_ivec2_adds(ivec2 v, int s, ivec2 dest)
void glm_ivec2_sub(ivec2 a, ivec2 b, ivec2 dest)
void glm_ivec2_subs(ivec2 v, int s, ivec2 dest)
void glm_ivec2_mul(ivec2 a, ivec2 b, ivec2 dest)
void glm_ivec2_scale(ivec2 v, int s, ivec2 dest)
int glm_ivec2_distance2(ivec2 a, ivec2 b)
float glm_ivec2_distance(ivec2 a, ivec2 b)
void glm_ivec2_maxv(ivec2 a, ivec2 b, ivec2 dest)
void glm_ivec2_minv(ivec2 a, ivec2 b, ivec2 dest)
void glm_ivec2_clamp(ivec2 v, int minVal, int maxVal)

void glm_ivec3(ivec4 v4, ivec3 dest)
void glm_ivec3_copy(ivec3 a, ivec3 dest)
void glm_ivec3_zero(ivec3 v)
void glm_ivec3_one(ivec3 v)
void glm_ivec3_add(ivec3 a, ivec3 b, ivec3 dest)
void glm_ivec3_adds(ivec3 v, int s, ivec3 dest)
void glm_ivec3_sub(ivec3 a, ivec3 b, ivec3 dest)
void glm_ivec3_subs(ivec3 v, int s, ivec3 dest)
void glm_ivec3_mul(ivec3 a, ivec3 b, ivec3 dest)
void glm_ivec3_scale(ivec3 v, int s, ivec3 dest)
int glm_ivec3_distance2(ivec3 a, ivec3 b)
float glm_ivec3_distance(ivec3 a, ivec3 b)
void glm_ivec3_maxv(ivec3 a, ivec3 b, ivec3 dest)
void glm_ivec3_minv(ivec3 a, ivec3 b, ivec3 dest)
void glm_ivec3_clamp(ivec3 v, int minVal, int maxVal)

void glm_ivec4(ivec3 v3, int last, ivec4 dest)
void glm_ivec4_copy(ivec4 a, ivec4 dest)
void glm_ivec4_zero(ivec4 v)
void glm_ivec4_one(ivec4 v)
void glm_ivec4_add(ivec4 a, ivec4 b, ivec4 dest)
void glm_ivec4_adds(ivec4 v, int s, ivec4 dest)
void glm_ivec4_sub(ivec4 a, ivec4 b, ivec4 dest)
void glm_ivec4_subs(ivec4 v, int s, ivec4 dest)
void glm_ivec4_mul(ivec4 a, ivec4 b, ivec4 dest)
void glm_ivec4_scale(ivec4 v, int s, ivec4 dest)
int glm_ivec4_distance2(ivec4 a, ivec4 b)
float glm_ivec4_distance(ivec4 a, ivec4 b)
void glm_ivec4_maxv(ivec4 a, ivec4 b, ivec4 dest)
void glm_ivec4_minv(ivec4 a, ivec4 b, ivec4 dest)
void glm_ivec4_clamp(ivec4 v, int minVal, int maxVal)

Feedback welcome!

Copy link
Owner

@recp recp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chris-F5 may thanks for working on this, it would be nice to have struct api too in this PR or next PRs maybe

@recp recp added the feature label May 22, 2022
@recp recp merged commit 63990be into recp:master May 22, 2022
@recp
Copy link
Owner

recp commented May 22, 2022

@Chris-F5 the PR is merged 🚀

@Chris-F5 Chris-F5 deleted the add-basic-ivec-functions branch May 23, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants