godot-extended-libraries / hydro

Hydro is a Godot Engine module which allows rigid bodies to behave realistically in water.
MIT License
63 stars 15 forks source link

Work around Face3::get_area() bug in engine #4

Closed jonri closed 3 years ago

jonri commented 4 years ago

We rely on the Face3::get_area() function returning the correct result, but it returns a value twice the actual area.

Until the pull request with the fix is merged, we could divide the result of the function in half ourselves. This should also be noted in the documentation in case someone fixes the function on their own.

https://github.com/godotengine/godot/issues/37048 https://github.com/godotengine/godot/pull/37064

GNSS-Stylist commented 3 years ago

For a case someone stumbles upon buoyancy-related issues: Pull request mentioned has been merged to godot's master and 3.x-branches. So if someone is using those they may want to remove the workaround.

fire commented 3 years ago

@jonri

jonri commented 3 years ago

Thanks. Since this fix will appear in 3.4, I can add some automatic version detection to apply/remove the workaround at compile time.

jonri commented 3 years ago

Unless a user has manually fixed the bug in the engine source, the version detection added in d5c34d6 should just do the right thing without any user intervention.