Ignoring mass from welded joints in box2d?

When you are using weld joints, you aren't deleting any of the bodies (which have their own mass) as you attach them to your circle. Since you are content to simply assume that once something becomes stuck to the circle that it no longer needs to collide with anything, a good solution would be to add them as sensors to your circle body. This will require you to delete the body and add the fixture to your circle.

Up vote 0 down vote favorite share g+ share fb share tw.

What I have is a circle that rolls over other objects and 'picks' them up. My current setup uses WeldJoint to join and place the picked up object at the circle's edge. I then edit these object's fixtures to become a sensor to avoid collision response.

The circle is pushed around using applyForceToCenter() and a slight impulse to get it going. This all works. The problem is that the the accumulating mass from the new bodies is limiting the main circle's movement.

Too realistic for my game. The bodies keep tugging the circle around. I want to zero out any physics-based attributes affecting the circle.

I've tried a variety of methods using resetMassData(), MassData. Mass = 0, setAwake(false), setActive(false) ... Any help is appreciated, thanks. Edit: I've thought about using a math function to spiral the object's around the circle, e.g. Make a sprite go in a circle.

I'm not so sure if that's the route to go with box2d in hand. Box2d link|improve this question edited Sep 25 '11 at 22:18 asked Sep 25 '11 at 22:12IvanArellano154.

When you are using weld joints, you aren't deleting any of the bodies (which have their own mass) as you attach them to your circle. Since you are content to simply assume that once something becomes stuck to the circle that it no longer needs to collide with anything, a good solution would be to add them as sensors to your circle body. This will require you to delete the body and add the fixture to your circle.

I think it would be cool to have more objects result in more mass for your circle. Why not make a routine that determines the total additional mass currently stuck on your ball, and scale your ball's push force accordingly? You'll end up with the same acceleration but you will get a realistic increase in collision forces generated for free.

Not only that, but your welded sensors will also effectively modify the inertia so your ball's center-of-gravity will now reflect how things are stuck on it! It's free realism, so I'd try to take advantage of it. Plus it will be easier than writing code to correctly move the fixtures.

You could also in addition reduce the density of a newly "stuck-on" object by some factor to reduce the effect as necessary.

I solved my immediate problem of having 'too much' mass. The problem was the objects had a very high density vs the circle! I also like this idea of free acceleration from the mass.

Thanks. – IvanArellano Sep 25 '11 at 23:11 1 @IvanArellano I updated my answer a bit just now. And what I meant was that you can account for the increase in mass with a proportional increase in force.

It would serve to keep controllability, the acceleration, at a constant. A very natural mechanism for "leveling up" as you stick more things on. – Steven Lu Sep 25 '11 at 23:18.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions