briansemrau / godot_box2d

A C++ module that integrates the Box2D library with the Godot game engine by providing nodes for standard Box2D objects.
MIT License
44 stars 4 forks source link

Refactor Box2DPhysicsBody to enable future implementation of Box2DArea #50

Closed briansemrau closed 3 years ago

briansemrau commented 3 years ago

This move b2Body ownership to a new abstract class, Box2DCollisionObject. Exposed properties are very similar to CollisionObject2D in Godot physics. This allows creation of new node types that depend on b2Body (specifically Box2DArea 🙂) without duplication of hundreds of lines of code, improving future maintainability.

This should break absolutely nothing - all existing functionality should be identical. However, downstream changes may have merge conflicts. I'm willing to resolve conflicts in this PR if anything else can be merged before this.

Relevant to #10

briansemrau commented 3 years ago

and of course this doesn't have to be looked at now, it being the holiday :)

review is just to make sure I don't cause too much of a ruckus downstream and in case there is any disagreement about the restructure