I'm wanting to create a demo that uses gears. Each gear could have hundreds of teeth, and the gear itself needs to be anchored in the center. The only way I see to create something like this with Box2D would be to create a circle, then manually apply the "teeth" shapes individually.
If I were to do this, say 100 teeth per gear, how many gears could you use before Box2D died?
-Javin
Why not use the gear joint and only put the teeth in the graphics?
But I think you'll be surprised at how much you can throw at Box2D before it starts to get slow.
I've made gears in a 3d engine that was hacked into 2d by forcing z-velocities and positions. It worked but there were no advantages compared to something like a gear joint. I'm sure an actual gear made in box2d would work very nicely but in the end there are no advantages to modeling it realistically like that because it will affect performance and the mechanical action will not be as nice.
Wow! I didn't realize Box2D had a gear joint. That would solve EVERYTHING, even simplifying the degree of accuracy I would need in my models. (Ultimately, this will be a 3D game.) I'm sold. Now, how easy is it to fold Box2D into VB.NET? Is there an API/Library for it?
-Javin
Edit: This brings up another question. I assume a gear joint would only work between two gears. What if I wanted a "hook" to catch the gear to stop it? Is this doable? I could manually halt the torque on a gear when there's an impact, but this wouldn't allow the hook to slide across a gear before locking into an open spot.
I suppose my best option is to just try a test bed. I won't go into the need for multiple 2D planes to simulate a depth buffer at this point.
Hrm.... So theoretically, I could do the following:
__________
| ___ |
| |__| |
|_________|
(Methinks this would be considerably easier to draw with a monotype font, but I digress...)
Basically, I have one box body, with an additional box body inside of it. So I could (using filtering) tell object A to interact with the larger box, and tell object B to interact with the smaller box, but I could have the two boxes "attached" to each other so as one rotates, the other does as well?
Yes. You want 2 sprockets on a single axes I guess? You could use a gear joint for that, or a rotating joint with the limits set to 0.
Why not two shapes attached to a single body where the shapes have different filtering values? If I'm understanding this correctly?