Conversation
K0lb3
reviewed
Feb 3, 2025
Owner
|
Thanks for the PR and fixes. I'm also rewriting and pruning these classes for the next minor patch, For the version 2 update I plan to include numpy....and for that the math classes are going to get another rewrite, But that's still some time off, |
Contributor
Author
|
No problem at all! The simple work didn’t take long, happy to help. Good luck with the UnityPy 2 updates! |
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.
Summary
This PR has undergone comprehensive optimizations and fixes for the math module.
Breaking Changes
Vector2andVector4. (According toVector3.)Half.pysince the only functionToHalfin this file is not used any more. (ToHalfwas used in theTexture2DConvertorin the earlier version of UnityPy, but this usage has been removed in later versions.)Common Changes
@dataclassdecorator for all classes. (Before this PR, onlyVector3had this decorator.)__truediv__(Python 3) to replace__div__(Python2).__eq__method declarations.Individual Optimizations
Vector3: UseMethod = methodto redirect duplicated method.Vector3: Use a better__eq__method (which is also Unity's implementation).Quaternion: Remove the redundantself._datafield.Color: Use a better__eq__method.Individual Fixes
Vector3: Incorrect if-statement in__init__method.Vector3: Incorrect else-body innormalizemethod.Vector3: IncorrectLengthSquaremethod.Quaternion: Thewvalue of the identity quaternion (default quaternion) is1.0, not0.0.Matrix4x4: Corrupted__eq__method.