Reviewing merge request #13: Add support for mouse joints
Right, been a while since I fiddled around with this, but finally managed to get something done. :)
This merge request actually has two new features, first of all the implementation of mouse joints (which behave somewhat... strangely, see distance.qml in distance joint example for an explanation about setting bodyA and bodyB for the joint). Secondly it introduces a simple Q_INVOKABLE helper function to Box2DWorld, which enables the finding of a Box2DBody at a given point. I implemented it because I needed it for my mouse joint example and in all honesty it does make sense to have such functionality in my opinion. :)
Commits that would be merged:
- 15cc953
- 74ee537
Add mouse joints and show example usage in distance joint example
15cc953-74ee537Comments
Pushed new version 1
Pushed new version 2
Sorry but I kind of stopped working on this project half a year ago.
Your patch looks generally fine, though I have to agree that creating that mouse joint dynamically and setting bodyA/bodyB/world on it is a bit strange from the API point of view.
As for Box2DWorld::bodyAt, isn’t there some Box2D API for quickly finding fixtures in the world? One would expect that, since it does that all the time, and if it exists it should be a lot faster than this linear search.


Add a new comment:
Login or create an account to post a comment