Box2D Forums

It is currently Thu May 23, 2013 5:48 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Apr 20, 2012 12:29 pm 
Offline

Joined: Mon Jul 28, 2008 9:24 am
Posts: 18
Has anyone ported b2RopeJoint to the main flash port?

I see that the Alchemy port has it, but it seems like a big job to port my project over just for that - plus, with the new licensing terms I'd prefer to avoid using native code where possible.


Top
 Profile  
 
PostPosted: Wed May 09, 2012 4:07 am 
Offline

Joined: Wed May 09, 2012 4:03 am
Posts: 2
I have just finished porting the b2RopeJoint :) Hopefully it still proves to be of some use for you - if you have not changed over to the Alchemy port already.

See my blog post for details and the files: http://blog.allanbishop.com/box2d-2-1a-rope-joint-ported-to-as3/


Top
 Profile  
 
PostPosted: Sun May 13, 2012 2:32 pm 
Offline

Joined: Mon Jul 28, 2008 9:24 am
Posts: 18
Ah, brilliant, thanks a million.


Top
 Profile  
 
PostPosted: Wed May 16, 2012 9:59 am 
Offline

Joined: Mon Jul 28, 2008 9:24 am
Posts: 18
It seems to cause a crash when the ropejoint gets wedged against two objects:

Code:
Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
   at Box2D.Collision::b2TimeOfImpact$/TimeOfImpact()
   at Box2D.Dynamics.Contacts::b2Contact/http://www.box2d.org/ns/b2internal::ComputeTOI()
   at Box2D.Dynamics::b2World/http://www.box2d.org/ns/b2internal::SolveTOI()
   at Box2D.Dynamics::b2World/Step()
   at PlayState/update()
   at org.flixel::FlxGame/update()
   at org.flixel::FlxGame/step()
   at org.flixel::FlxGame/onEnterFrame()


Top
 Profile  
 
PostPosted: Wed May 16, 2012 1:53 pm 
Offline

Joined: Mon Jul 28, 2008 9:24 am
Posts: 18
further update: setting fixedRotation = false on the connected bodies solves the problem.

/edit make that "reduces but does not solve" the problem


Top
 Profile  
 
PostPosted: Wed May 16, 2012 5:59 pm 
Offline

Joined: Wed May 09, 2012 4:03 am
Posts: 2
So I have been trying to replicate the error by modifying my test environment for the b2RopeJoint by adding in some dynamic and static boxes to try and wedge the rope. I also added in another b2RopeJoint next to the original one. While they do get caught on some boxes, I haven't experienced the #1502 error (except if I randomly spawn a box inside another box). I also set the fixedRotation to true to see if that helped trigger the Error.

Is there anyway you can send me a file that can replicate the problem?

Also, what happens if you replace the b2RopeJoint with a b2DistanceJoint?

I also had another look over the ported code but couldn't see anything obviously wrong. The way I ported it in the first place was to look at the difference between the C++ b2RopeJoint and the C++ b2DistanceJoint as they are already very similar. Then, I could figure out what differences needed to be applied to the b2DistanceJoint of AS3 2.1a to turn it into a b2RopeJoint.

There is a chance there were other changes to the Box2D engine when the b2RopeJoint was introduced that could account for it, or, there could be some bugs still in the Box2DAS3 port.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], psbot [Picsearch] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group