Breaking a Hinge

This forum is currently in read-only mode.
  • Hi Guys,

    Been playing with Construct for a few days, it's awesome! I want to give hinges a maximum load strength, but am not quite sure how I can work it out.

    I can break the hinge, that's not a problem (I've yet to find a 'break hinge' action, so I just spawn a temporary object and carry the velocities across, then destroy the original and in a separate event spawn another instance of the first object based on the temporary object, which seems to work nicely. Then kill the temp).

    My problem is the actual working out of a threshold. I originally tried comparing velocity of object A with the velocity of object B, but that broke too early when swinging around. In other words, it didn't check that that velocity was in fact being pulled against the hinge itself.

    Next attempt was to base the whole thing on centrifugal force (thanks Google), and that didn't work either, likely because of my formula. You move above a certain speed, and your hinges start to fall apart.

    So I need some way to tell how much stress the hinge is under, and then trigger my cool hinge-snappin' function. Mercilessly.

  • I'm not sure of any way to do that currently. I believe it would require a HingeForce expression to be added to Construct, if that's even possible with the Box2D engine. Physics definitely needs to be fleshed out a bit more in terms of features.

    In all honesty I don't even think the Hinge Stiffness setting even does anything...

    You might just have to settle with faking it by getting the force of objects hitting your hinge, or by measuring the angle between your hinged objects. Unless there's something I'm missing and some clever Constructor can pop in and correct me...

  • All joints have a reaction force and torque. This the reaction force applied to body 2 at the anchor point. You can use reaction forces to break joints or trigger other game events. These functions may do some computations, so don't call them if you don't need the result.

    b2Vec2 GetReactionForce();

    float32 GetReactionTorque();

    Please?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I believe that would be up to David... I'm pretty sure he's the one who handles Physics. Try posting a feature request, he might be able to add it.

    If he ever comes back

    COME BACK DAVID WE LOVE YOU

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)