Realistic physics values (Farseer)
BlitzMax Forums/BlitzMax Programming/Realistic physics values (Farseer)
| ||
Hi again--been a while since I've posted. I've never used a physics engine before but I started experimenting with Farseer on the weekend. I'm having some difficulty getting my head around producing physics values appropriately to produce realistic (i.e. Earth-like) results. I presume the values for gravity, friction, weight etc are just arbitrary and up to the programmer to balance as desired. By default the values produce very "airy", floaty objects. I found myself getting to values like 2000 for gravity to make things actually fall to the ground normally, but in turn needed like 150,000 torque on a cart wheel to get it moving. Does this seem normal? Is there any guide to producing good results? Then also when I fiddled with the physics update timer from, say, 0.2 to 0.1 then all those values are screwed up and need adjusting. I was having trouble with some objects crashing through collision boundaries (e.g. a ball would get stuck in the ground). Any advice for balancing these things would be appreciated. |
| ||
Reworded so people might feel like answering :) - What sort of values should be used to produce realistic gravity etc in Farseer? (may apply to other physics engines too). Does gravity like 2000 and torque 150000 make sense? - With such high values what can be tweaked to prevent glitches? Thanks |
| ||
Well, I can't speak for Farseer, but Box2D works in metre units, so you don't need a high gravity value to get the desired effect (eg. 10 can can work well). Once you know what a unit length represents, it should be fairly easy to base everything on that. |
| ||
Thanks a lot for the reply, Brucey. I've been checking out the Box2D examples now. It's a bit harder to get started with than Farseer but I'm liking what the engine produces. The values seem a lot better in Box2D. |
| ||
- What sort of values should be used to produce realistic gravity etc in Farseer? (may apply to other physics engines too). Does gravity like 2000 and torque 150000 make sense? - With such high values what can be tweaked to prevent glitches? 2000 seems awfully high for gravity for Farseer. I've found 100-200 gives good results. It's also a matter of how small your time step is. A value of 0.2 is rather large. I've found that when calling update() on it, I typically scale down the real-world time ie: physics.update(delta *0.1) and then tweak from there. |