Hello! I have some questions about physics.
1) How make joints break when a some big force is applied to it?
2) How to make body breakable (do some action, when outer forces (like a fall from big altitude) are very big?)
You answer for 2) its possible to calculate the force acting on a body, for that you need speed and mass, then apply this formula iarwain mentioned,
Energy = 1/2 * mass * velocity^2
After calculating energy, then you need to apply necessary steps. For breakable bodies you can use joint. Then calculated E for each body, if it crosses certain limit, remove that joint.
But afaik, GetReactionForce(...) is not exposed in orx, also I have not worked with joints before, so wait for iarwain what he says about it. You can also try the body speed approach to determine the force acting on each body. then remove joints if needed.
One thing, you don't need to simulate exact real world physics, just have to fake it enough so that it seems believable
Oh, thank you very much, you right, I can only simulate real physics! :laugh:
Also, I was thinking on number one and invented one thing: We can get hard spring jont and delete if when distance between objects is very big.
For number 2, realy, I can use energy.
Comments
https://forum.orx-project.org/discussion/6457&limit=20#6461
https://forum.orx-project.org/discussion/6457&limit=20&start=20#6484
You answer for 2) its possible to calculate the force acting on a body, for that you need speed and mass, then apply this formula iarwain mentioned,
Energy = 1/2 * mass * velocity^2
After calculating energy, then you need to apply necessary steps. For breakable bodies you can use joint. Then calculated E for each body, if it crosses certain limit, remove that joint.
And for 1) I have found some box2d related solution on the internet,
http://stackoverflow.com/questions/15066140/achieve-joint-break-when-more-than-certain-force-is-applied
But afaik, GetReactionForce(...) is not exposed in orx, also I have not worked with joints before, so wait for iarwain what he says about it. You can also try the body speed approach to determine the force acting on each body. then remove joints if needed.
One thing, you don't need to simulate exact real world physics, just have to fake it enough so that it seems believable
Also, I was thinking on number one and invented one thing: We can get hard spring jont and delete if when distance between objects is very big.
For number 2, realy, I can use energy.
If need be, I can try to find a way to expose GetReactionForce(). Lemme know.
You can add yourself to the watcher list in order to get notified when it's done.
Lemme know if you have any issues.