Breaking a Hinge

For questions about using Classic.

Post » Fri Feb 05, 2010 9:57 pm

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.
B
3
G
2
Posts: 5
Reputation: 685

Post » Fri Feb 05, 2010 10:10 pm

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...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Feb 06, 2010 11:02 am

[quote="Box 2d User Manual":27f8v07x]
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();
[/quote:27f8v07x]

Please? :D
B
3
G
2
Posts: 5
Reputation: 685

Post » Sat Feb 06, 2010 4:50 pm

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 :cry:

COME BACK DAVID WE LOVE YOU :cry:
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest