Improve Vec4Base sub-class functionality and Vec4 directional vector method name change #2072
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.
Describe your changes
Move methods from
Vec4
toVec4Base
, specificallyset(x,y,z,w)
andset(float*)
. This allows their usage in Color4F and other sub-classes ofVec4Base
.Remove trivial copy constructor method, since it does not need to be explicitly implemented.
Rename
Vec4::set(const Vec4& p1, const Vec4& p2)
method toVec4::setDirection
to reflect its actual purpose.If anyone currently uses the
Vec4::set(const Vec4& p1, const Vec4& p2)
, then it is a simple rename toVec4::setDirection(const Vec4& p1, const Vec4& p2)
. Theset
name was a bit misleading, and this change renames it to what the method actually does, which is to calculate the directional vector from pointp1
to pointp2
. The compiler will throw an error regarding this, so there is no danger that this goes unnoticed.Note that I did try to add the
AX_DEPRECATED_ATTRIBUTE
specifier to the theVec4::set(const Vec4& p1, const Vec4& p2)
method, but the compiler would throw errors when attempting to use the otherset
methods that were moved toVec4Base
, since they were being hidden by theVec4::set
method.Issue ticket number and link
Checklist before requesting a review
For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."
I have performed a self-review of my code.
Optional:
For core/new feature PR