Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question ArticulationBodies and break force/torque?

Discussion in 'Physics' started by shelshok, Dec 10, 2023.

  1. shelshok

    shelshok

    Joined:
    Feb 18, 2013
    Posts:
    10
    I'm considering replacing my rigidbodies/joints with articulation bodies because they make more sense in my hierarchy and they are generally easier to set up, but while the manual says that an articulationbody is basically a rigidbody and joint in one component, it is lacking a break force and break torque options.

    What is the best way to implement a similar setup for this, and would it also work for a fixed articulationbody?

    Edit: Actually to clarify that last question, I essentially want to break a "joint" when it's forced to go in a different direction than the one its free/limited motion is in, so a spherical probably won't break except for force, but a revolute would break if torque is added in one of the other two axes, and a fixed would break if forced in any direction. I suppose they could all be spherical with a high stiffness if needed.
     
    Last edited: Dec 10, 2023
  2. codebiscuits

    codebiscuits

    Joined:
    Jun 16, 2020
    Posts:
    86
    Do the joints still need to work after they're broken?
    Like, if it's an arm and you break at the elbow, does the wrist still need to be a joint?
    Do you need to lose the mass of the broken-off bit?
    If not, I'm currently breaking bits off my articulation hierarchy by cheating, I make the broken-off colliders triggers, hide the visible meshes & spawn a visual clone with a rigidbody to fall off:)
    I've some (not loads tho) experience with articulation hierarchies, as I understand it they're not really meant to change once they're in place, but you can kindof do it sometimes.
    Like, stuff like this can be an issue:
    https://anja-haumann.de/unity-preserve-articulation-body-state/ (I can't remember if this fix still works).
    So I used to disable the broken part's GameObject, and kindof restore the articulation hierarchy state in code, but I had to work around stuff like this:
    https://forum.unity.com/threads/featherstones-solver-for-articulations.792294/page-9#post-8970376
    I feel like generally, the farther you get away from "intended usage", the more edge-case problems you'll discover.
    I think to detect the kind of break you're talking about, I'd try everything being spherical like you suggested, and once you push past a certain point/ experience a certain force, snap, I guess: I've not tried anything like this, though.
     
    alexanderperrin likes this.
  3. shelshok

    shelshok

    Joined:
    Feb 18, 2013
    Posts:
    10
    Thanks. Ideally they would continue to work as when attached. That's useful info about needing to restore the state somehow.

    What I'm struggling with is the best way to determine when it should break. Like if it's at one of it's limits, is there a way to figure out if something is still pushing it further, and with how much force?

    This article says "The force applied to a joint can’t be retrieved."

    https://anja-haumann.de/unity-articulation-body-overview/