Commit 0d119e6
Merge #791
791: Implement some of the Transform2D API in rust r=jacobsky a=setzer22
As we discussed, here's an initial implementation of the Transform2D. The implementation is currently untested, so I'm marking it as a work-in-progress. I'm just posting this early so we can discuss if you thing this is the right approach 👍
The code closely follows the exposed GDScript API and even copies its documentation strings. The Implementation is adapted from Godot's C++ source code, delegating to glam (via Vector2) when necessary.
I decided against adding a conversion between glam::Affine2 and Transform2D because it was not immediately clear to me if the mapping would be 1:1 (godot's Transform2D does not necessarily need to be an affine transformation, although it's assumed in certain places).
Instead, I decided to just follow the C++ implementation, which was simple enough, to ensure results would be predictable when porting code from GDScript. We are still using glam underneath when delegating all of `Vector3`'s operations, which happens in many places.
Co-authored-by: Setzer22 <jsanchezfsms@gmail.com>2 files changed
+417
-0
lines changed
0 commit comments