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

Added a couple more vectormath operations #35

Merged
merged 7 commits into from
Nov 26, 2024
Merged

Conversation

Incoherent-Code
Copy link
Contributor

I added a couple more vector math functions.

  • multiply([vector], [vector]) multiplies 2 vectors together.
  • rotateX([vector], [angle]) rotates the vector around the x axis.
  • rotateY([vector], [angle]) rotates the vector around the y axis.
  • rotateZ([vector], [angle]) rotates the vector around the z axis.

I wrote tests and ran beachball already. Let me know if you have any concerns.

Copy link
Collaborator

@rlandav rlandav left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I have added comments suggesting a few changes to be made.

libraries/math/src/vector3/coreHelpers.ts Outdated Show resolved Hide resolved
libraries/math/src/vector3/coreHelpers.ts Outdated Show resolved Hide resolved
libraries/math/src/vector3/coreHelpers.ts Outdated Show resolved Hide resolved
libraries/math/src/vector3/vectorWrapper.test.ts Outdated Show resolved Hide resolved
@Incoherent-Code
Copy link
Contributor Author

This last commit should fix all the aforementioned issues

Copy link
Collaborator

@rlandav rlandav left a comment

Choose a reason for hiding this comment

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

Rotate Y should also be counter clockwise. Last change and otherwise looks good and I can merge it.

libraries/math/src/vector3/vectorWrapper.ts Outdated Show resolved Hide resolved
libraries/math/src/vector3/coreHelpers.ts Outdated Show resolved Hide resolved
@Incoherent-Code
Copy link
Contributor Author

Third times the charm.

Copy link
Collaborator

@rlandav rlandav left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes! I'll merge these in.

@rlandav rlandav merged commit 9d6cb50 into Mojang:main Nov 26, 2024
2 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.

2 participants