I’m using Box2D (the AS3/Flash version, if it matters) and I’m trying to calculate how much weight each body is carrying.
I know how to iterate through all the bodies, and I know how to poll the Collion Detection routines, but it seems the collision forces die off to zero once weight is applied. Is there some sort of “total static force” property I’m overlooking?
Using the contactResult type in the optional contactListener object, you can poll the normalForce of each item to find out what forces (which intrinsically includes weight) are being applied to objects.
Note that sleeping bodies (a resting stack for example) will not trigger contactResults, but it should work fine if you turn off sleeping or if you want to measure forces only while motion is happening.
For info on how to implement the contactListener class check up on the documentation.