Monkey Box2d Port - Gearjoints not working?

Monkey Forums/Monkey Programming/Monkey Box2d Port - Gearjoints not working?

PhillipK(Posted 2014) [#1]
Hello everybody,
iam sorry if i post my issue on the wrong place here.

I figured that i should start a new topic on my issue, because the box2d port thread ( http://monkeycoder.co.nz/Community/posts.php?topic=2721&page=last ) had the last post 9 months ago.
Also, the last "update" on the module ( http://code.google.com/p/monkeybox2d ) was posted on Mar 2013.. long time ago :(

Currently iam wrapping box2d in a more confortable private module. It seems impossible to get the geartjoint to work. After hours of debbuging the world, it seems that no gearjoint ever recieves and update.
My prismatic / revolute joints are working as intended - but the gearjoint never get any calls on his functions.
I think that the gearjoint wasn't ported well / had never been tested. I dont think that iam the first person, that wants to use the gearjoint, so i ask here for some solutions. Maybe there is another user who is more into the Box2d mod than me, who already solve this issue.


muddy_shoes(Posted 2014) [#2]
If you post in a thread it gets popped to the top of the forum. If you don't post in the thread because you think it looks "too old" it remains looking old.

The gearjoint is used in the testcrankgearspulley.monkey test file, which is called "Joints" in the demo. This appears to be working fine. I suggest you look at the code and compare with whatever you're doing.


PhillipK(Posted 2014) [#3]
Oh, so "Thread-ressurection" is allowed here? I come frome the german basic portal (short: BBP), maybe the rules there are a bit more harsh. :x The next time, i will post on the correct thread to keep the informations together :)

Now, to the problem: Thanks for pointing me to this direction, muddy_shoes! I've never realised before that a gearjoint is allready in the demo. Dont know whats wrong, but the demo works - so my box2d version is not screwed as i thought.

I will take a look right after cleaning up my box2d again (i've spend the whole day yesterday for addings print's, DebugStop()'s and Error(" ")'s to find whenever a gearjoint is used *sigh*) - if i find the difference of declarations between http://www.box2d.org/manual.html#_Toc258082974 and my, i will edit it in here to help other people who uses the box2d manual and cant get them to work :)

Edit:
Oh wow, THATS screwed. (no, not really. But i just wasted ~ 10 hours of my time for a LITTLE difference. Yesh, i like it ^^)

In the Demo-Example, the revolute joints are created with the groundbody as body1, the circlebody as body2. And thats all the magic o_O
If:
Revolute1.Body1 -> Static and Revolute2.Body1 -> Static, The Gearjoint works as expected.
If:
Revolute1.Body2 -> Static and Revolute2.Body1 -> Static, they both (R1.Body1 and R2.Body2) turn into the same direction when connected by a gearjoint.
If both' Body2 are the statics, the gearjoint refuses to work.

So, as far as i can see, its also very important to watch the setup of the revolute/prismatic joints, and not only the gearjoint setup. You can tell the gearjoint which body's it should use, but keep in mind which bodys are attached in which order to the revolute / prismatic joints...

Again, Thanks muddy_shoes :)