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

More Vector math functions #3828

Merged
merged 1 commit into from
Feb 26, 2024
Merged

More Vector math functions #3828

merged 1 commit into from
Feb 26, 2024

Conversation

Bowserinator
Copy link
Contributor

Some of the Vector3 functions have no Vector2 equivalent and vice-versa, this helps increase parity a bit. Functions added for Vector2 and Vector3:

Vector2 Vector2Min(Vector2 v1, Vector2 v2);
Vector2 Vector2Max(Vector2 v1, Vector2 v2);
Vector2 Vector2Refract(Vector2 v, Vector2 n, float r);
Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance);

Also added Vector4 math functions:

Vector4 Vector4Zero(void);
Vector4 Vector4One(void);
Vector4 Vector4Add(Vector4 v1, Vector4 v2);
Vector4 Vector4Subtract(Vector4 v1, Vector4 v2);
Vector4 Vector4SubtractValue(Vector4 v, float add);
float Vector4Length(Vector4 v);
float Vector4LengthSqr(Vector4 v);
float Vector4DotProduct(Vector4 v1, Vector4 v2);
float Vector4Distance(Vector4 v1, Vector4 v2);
float Vector4DistanceSqr(Vector4 v1, Vector4 v2);
Vector4 Vector4Scale(Vector4 v, float scale);
Vector4 Vector4Multiply(Vector4 v1, Vector4 v2);
Vector4 Vector4Negate(Vector4 v);
Vector4 Vector4Divide(Vector4 v1, Vector4 v2);
Vector4 Vector4Normalize(Vector4 v);
Vector4 Vector4Min(Vector4 v1, Vector4 v2);
Vector4 Vector4Max(Vector4 v1, Vector4 v2);
Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount);
Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance);
Vector4 Vector4Invert(Vector4 v);
int Vector4Equals(Vector4 p, Vector4 q);

@raysan5 raysan5 merged commit d919d45 into raysan5:master Feb 26, 2024
@raysan5
Copy link
Owner

raysan5 commented Feb 26, 2024

@Bowserinator Thank you very much! This is a nice addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants