Some questions about physics.

edited October 2013 in Help request
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?)
rect4024.png

Comments

  • jimjim
    edited October 2013
    Hmm, few days ago, I asked kinda similar ques to iarwan, regarding how to get collision impact or force from a contact point acting on a body. Here are two useful answer you might need regarding breakable bodies
    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 :)
  • edited October 2013
    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.
  • edited October 2013
    Not much to add here, thanks to Jim's complete answer!

    If need be, I can try to find a way to expose GetReactionForce(). Lemme know. :)
  • edited October 2013
    Oh, that't will be fine! Add that function, of course. :laugh:
  • edited October 2013
    I created an issue there for tracking: https://bitbucket.org/orx/orx/issue/53/add-getreactionforce-getreactiontorque

    You can add yourself to the watcher list in order to get notified when it's done. :)
  • edited October 2013
    Done, albeit untested. :)

    Lemme know if you have any issues.
Sign In or Register to comment.