update: add Vector2.hpp based on old vector3 functions - #148
Open
Hugo-Cathelain wants to merge 1 commit into
Open
update: add Vector2.hpp based on old vector3 functions#148Hugo-Cathelain wants to merge 1 commit into
Hugo-Cathelain wants to merge 1 commit into
Conversation
Contributor
|
Welcome to Graphical Playground (gp-engine), @Hugo-Cathelain! 🎉 We are thrilled to have you here and appreciate you opening your first Pull Request! What's next?
Thanks again for your contribution! |
mallory-scotton
self-requested a review
September 12, 2026 06:14
mallory-scotton
requested changes
Sep 12, 2026
mallory-scotton
left a comment
Member
There was a problem hiding this comment.
Overall LGTM, but please review the small nitpicks I commented
| /// @return A reference to this vector after the division. | ||
| constexpr Vector3<T>& operator/=(const Vector3<T>& other) noexcept | ||
| { | ||
| { |
Member
There was a problem hiding this comment.
The code hasn't be formatted using clang-format, otherwise, this spaces wouldn't been there, please format the code !
| template <concepts::IsArithmetic U> | ||
| constexpr Vector2<T>& operator/=(const U scale) noexcept | ||
| { | ||
| x /= static_cast<T>(scale); |
Member
There was a problem hiding this comment.
Please use the invScale to gain a bit of performance per CPU cycle
| x /= static_cast<T>(scale); | ||
| y /= static_cast<T>(scale); | ||
| z /= static_cast<T>(scale); | ||
| GP_ASSERT(scale != T(0), "Division by zero"); |
Member
There was a problem hiding this comment.
Suggested change
| GP_ASSERT(scale != T(0), "Division by zero"); | |
| GP_ASSERT(scale != T{ 0 }, "Division by zero"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #{LINK TO GITHUB ISSUE}
Type of Change
Description
Adding old Vector2 that wasn't pushed at the time and were sitting on another machine
Docs
like old vector3 docs and will need change ^^
Checklist
gp-engineC++ Coding Standard.GP Contributor License Agreement
I give to the Graphical Playground Team, LLC permission to license my contributions on any terms
they like. I am giving them this license in order to make it possible for them to accept my
contributions into their project.