Closed singlecoder closed 2 weeks ago
The changes introduced in this pull request involve the addition of a new method named copyTo
across several classes including Vector2
, Vector3
, Vector4
, Color
, and Quaternion
. This method facilitates the copying of values from an instance of each class to a target object that adheres to the respective interfaces (Vector2Like
, Vector3Like
, Vector4Like
, ColorLike
, QuaternionLike
). Corresponding test cases have also been added for each class to validate the functionality of the new copyTo
method, ensuring its correct operation without altering existing methods or properties.
File | Change Summary |
---|---|
packages/math/src/Vector2.ts | Added method copyTo(target: Vector2Like): Vector2Like in class Vector2 . |
packages/math/src/Vector3.ts | Added method copyTo(target: Vector3Like): Vector3Like in class Vector3 . |
packages/math/src/Vector4.ts | Added method copyTo(target: Vector4Like): Vector4Like in class Vector4 . |
packages/math/src/Color.ts | Added method copyTo(target: ColorLike): ColorLike in class Color . |
packages/math/src/Quaternion.ts | Added method copyTo(target: QuaternionLike): QuaternionLike in class Quaternion . |
packages/math/src/ICopy.ts | Added optional method copyTo?(target: S): S in interface ICopy<S, T> . |
tests/src/math/Vector2.test.ts | Added test case for copyTo method in Vector2 class. |
tests/src/math/Vector3.test.ts | Added test case for copyTo method in Vector3 class. |
tests/src/math/Vector4.test.ts | Added test case for copyTo method in Vector4 class. |
tests/src/math/Color.test.ts | Added test case for copyTo method in Color class. |
tests/src/math/Quaternion.test.ts | Added test case for copyTo method in Quaternion class. |
In the land of vectors, so bold and bright,
A newcopyTo
method takes flight.
FromVector2
,3
, and4
, they share,
Their values with targets, with utmost care.
Hopping with joy, we test and we play,
For vectors unite in a magical way! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 69.42%. Comparing base (
4c0cfd0
) to head (a021a4b
). Report is 7 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
copyTo
method in theVector2
,Vector3
,Vector4
,Color
, andQuaternion
classes, allowing users to copy values to target objects.Tests
copyTo
method inVector2
,Vector3
,Vector4
,Color
, andQuaternion
to ensure functionality and accuracy.