I want to add a bit of physics into my engine / games. I most certainly will not use any external library, and want to code it from scratch.
I expect a lot of code to be refactored progressively, and that's fine. The thing is, I have to avoid reading 5 books and 20 articles to extract just those few important bits and pieces of them. This is not a complex ragdoll physics.
1. All I need is to be able to break the wall of stones (say, 20-30 big stones) and have them react realistically, depending on the force exerted.
2. Perhaps only 1 stone will fall out (and others will move a bit - kinda lean along the vector of the force), with the quadratic falloff based on distance from the center.
3. When you exert more force, more stones will fall out and when they collide, they should definitely react realistically - e.g. behave differently depending whether they fall on edge or a side.
4. My understanding is that I need to account for a friction, since if they just slid smoothly over one another, that would break the realism
5. Stones need to pile up
6. Stones will be aware of the gravity, so if enough of the stone is sticking out (without the support of the stone below and above), it will tip over itself and fall down.
So, how would I go about it and where would I start ? I remember having a physics subject at high school where we used to calculate all kinds of examples with heavy stones/friction/falling - but it was all just a single stone.
I'm not really looking for code examples, more like articles with game environment in mind.
Theoretically, it does not sound like a lot of work - perhaps 50-100 hrs would be my early guess ?
My early outline of things to experiment with:
1. Start with stone simply falling down (accounting for gravitation) and stopping when it hits floor.
2. Get two stones to react - when one falls on top of another - and let it react appropriatelly (either stay on top of it, or tip over and continue falling till it reaches floor)
3. Self-aware stones in the wall, sticking out a bit that will tip over based on how much they stick out.
Any specific ideas ?