开发者

Box2d create breakable joints for dynamic body

Have been working on building a Bridge builder using box2d.

Basically you build a brid开发者_运维问答ge and stress test it by passing objects on top of it. The joints break if the stress applied is high.

Can you please help how best to join the b2Body. Have tried revolute joint, but they are not breaking. Any suggestions.

Thanks


"You can get the reaction force and torque off the joint. You can query these forces after each time step and destroy the joint when your threshold is exceeded." - Quote from Erin Catto - http://www.box2d.org/forum/viewtopic.php?f=3&t=1079


I think the joints will not break by themselves. You have to break them using DestroyJoint function. You can setup b2ContactListener and get the impulse velocity of the object that hits your bridge and you can take the decision if you want to break the joint or not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜