Reimplement Rect2, Rect2i, Aabb, and Plane in rust · Issue #209 · godot-rust/gdext (original) (raw)

Currently, Rect2, Rect2i, Aabb, and Plane have only a very simple implementation, requiring users to use InnerX to call most methods on them. We should reimplement these in rust, along the lines of the other mathematical types.

Have a look at for instance Vector2 and Basis to see what this should look like.

Another good source for inspiration is our gdnative bindings, they can be found here: Rect2, Aabb, Plane

In addition unit tests and integration tests would be needed.

For unit tests it can be useful to look at godot's unit tests for the same types, they can be found here.

For integration tests, basis_test.rs is a good example to go by, something like basis_equiv is a minimum to ensure our methods behave similarly to godot.

Finally, for writing documentation and ensuring you're covering all methods we want, look at the godot docs for the various types: Rect2, Rect2i, Aabb and Plane.

Not everything has to be done at once.

Reimplemented so far: