godot-rust / gdext

Rust bindings for Godot 4
https://mastodon.gamedev.place/@GodotRust
Mozilla Public License 2.0
3.06k stars 190 forks source link

Reimplement `Rect2`, `Rect2i`, `Aabb`, and `Plane` in rust #209

Closed lilizoey closed 1 year ago

lilizoey commented 1 year ago

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:

Cankyre commented 1 year ago

Aabb is done, you can mark it as closed. #280

Bromeon commented 1 year ago

Will close automatically when #242 is merged.