简体   繁体   中英

Box2d is freezing when enableMotor is set to true on a revolute joint

I have a strange bug in an box2d project(AS3, box2d 2.1a).

I have a dynamic rectangle and a small static circle overlapping. I create a revolute joint to those 2 objects(located inside the center of the small circle, point which is also inside the rectangle). If enableMotor is set to false when the joint is created the scene works perfectly, with the rectangle hanging. When I set enableMotor to true the scene freezes.

Did you encountered by any chance the same problem? Do you have any hints where to look to fix the problem?

I had a similar problem a few days ago. In my case the problem seemed to lie with the fixed_rotation value for one of the objects. When i set it to true, and enabled the motor on the revolute joint, flash would hang. I changed the value to false on the offending object and things are running smoothly now. Could be the problem in your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM