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 missing vector methods #228

Merged
merged 15 commits into from
Jul 21, 2024

Conversation

ZachCurtis
Copy link
Contributor

Adds the following methods:

Vector2:

  • Vector2:Angle(rhs)
  • Vector2:FuzzyEq(rhs)
  • Vector2:Abs()
  • Vector2:Ceil()
  • Vector2:Floor()
  • Vector2:Sign()

Vector3:

  • Vector3:Abs()
  • Vector3:Ceil()
  • Vector3:Floor()
  • Vector3:Sign()

Doesn't implement optional isSigned boolean for Vector2:Angle(rhs, isSigned) Not totally sure if Option would be a good fit here. The optional axis vector is also missing on Vector3:Angle(rhs, axis)

Closes #214

@filiptibell
Copy link
Collaborator

Nice, thank you for the PR! Could we expand the Vector2 and Vector3 test suites to include these new methods? They are located here:

We don't have much in terms of tests for methods there yet but I think this would be a good opportunity to start and shouldn't be too complicated to do.

@ZachCurtis
Copy link
Contributor Author

Sure thing, I should have time to add to those tests tonight.

@ZachCurtis
Copy link
Contributor Author

Added to the tests for the methods in this PR, as well as Vector3:FuzzyEq(rhs, epsilon).

There might be a better way to test Vector2:Angle(rhs) than this, it doesn't ever return a "rounded" radian to directly check against.

Copy link
Collaborator

@filiptibell filiptibell left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@filiptibell filiptibell merged commit 5379c79 into lune-org:main Jul 21, 2024
6 checks passed
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.

Vector2 and Vector3 do not support methods added after March 2023
2 participants