Skip to content

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Jun 17, 2023

Changes:

Add ApproxEq trait and implement it for many builtin types.

  • This standardizes checking for approximate equality across types.
  • Gets rid of the boilerplate 3rd argument assert_eq_approx!(a, b, is_equal_approx).
    • That argument can still be specified if desired, using assert_eq_approx!(a, b, fn = is_equal_approx).
    • In 95% of cases, it's not needed though.

Refactor modules

  • godot::builtin::math is now a public module, which contains:
    • Godot ported functions such as lerp, sign
    • ApproxEq trait + assert_eq_approx!, assert_ne_approx! macros
    • glam utilities: IVec4, GlamConv, etc (internal)
  • The above symbols are no longer in godot::builtin. If this turns out to be an issue, we can also revert this in the future; but it might help some discoverability. Some symbols could also be considered to be part of the prelude.
  • Move godot::native_structure -> godot::engine::native
  • Move real-related symbols into their own real.rs file (internal; API unaffected).

Refactor import statements (just around geometric types, not whole codebase)

  • Remove wildcard imports
  • Remove nested import statements
  • Consistent order

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: core Core components labels Jun 17, 2023
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-314

@Bromeon
Copy link
Member Author

Bromeon commented Jun 17, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 17, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 00a3005 into master Jun 17, 2023
@bors bors bot deleted the qol/approx-eq branch June 17, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: core Core components quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants