mass?
Posted: Tue Sep 06, 2011 3:47 am
What should I set mass as for objects? Would it be a bad idea to have everything have the same mass? Should I do like width*height or pi*radius^2? I'm confused
It does. And if you set the mass to 0 then it doesn't fall.T-Bone wrote:Why would you need to set a mass? Does love.physics require that?
Well, you'll have to experiment with what mass you want each object as. How about something like 20-40? I highly doubt you want a tiny ball to fall like 20 cars glued together.miloguy wrote:I don't really care how much each object weighs, as long as it falls the same speed and moves the same speed
Yeah, 0 mass makes the object static.miloguy wrote:And if you set the mass to 0 then it doesn't fall.
That actually makes sense when you think about it: how much force would you need to apply to move a body with a mass of 0? (the equation is Force = Mass * Acceleration)miloguy wrote:And if you set the mass to 0 then it doesn't fall.
Box2D works with mass in KG.I don't really care how much each object weighs, as long as it falls the same speed
It depends on how you move the bodies. If you use SetLinearVelocity then the mass is irrelevant. If you use ApplyForce or ApplyImpulse it is. Keep in mind that a super massive object with a velocity of 10 m/s will produce different collision responses than a less massive object moving at the same speed.and moves the same speed
There's also: http://love2d.org/wiki/Body:setMassFromShapesmiloguy wrote:What should I set mass as for objects? Would it be a bad idea to have everything have the same mass? Should I do like width*height or pi*radius^2? I'm confused