Skip to content

Conversation

luanpotter
Copy link

@luanpotter luanpotter commented Aug 5, 2025

Before the deprecation of the dynamic translate method, since the z variable had default value of 0, you could translate by a vector two by doing:

matrix4.translate(vector2.x, vector2.y)

Here is an example "in the wild" of such usage.

With the new methods, this becomes even less ergonomic, as it would require either calling translateByDouble with 2 extra parameters, or converting the Vector2 to a Vector3.

So I propose we introduce a translateByVector2 which behaves exactly as translate(x, y) would before.


for (var i = 0; i < inputA.length; i++) {
relativeTest(output1[i], output2[i]);
relativeTest(outputA[i], outputB[i]);
}
Copy link
Author

Choose a reason for hiding this comment

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

note: I shifted the variable names a bit here to make it match some sort of logic with the new names, but please lmk if there is a preferred naming convention.

tbh this test feels like two tests in one but I don't want to change the structure too much.

@coveralls
Copy link

coveralls commented Aug 8, 2025

Coverage Status

coverage: 26.708% (+0.006%) from 26.702%
when pulling 3c4c518 on luanpotter:luan.translateByVector2
into 3939545 on google:master.

@spydon
Copy link
Contributor

spydon commented Aug 15, 2025

@kevmoo could we have a review of this one? :)

@spydon
Copy link
Contributor

spydon commented Aug 15, 2025

@luanpotter tool/generate_vector_math_64.dart needs to be run so that it generates the vector_math_64 file too.

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.

3 participants