I'm trying to compile Box2DFlash on Linux using the mxmlc compiler, but I'm unfamiliar with it's usage. The only build instructions in Box2DFlash are "extract Box2DFlashAS3 and open PhysTest.fla in Flash CS3 (9) and hit Ctrl+Enter", which clearly doesn't work on Linux. I tried "mxmlc Main.as", but I just get a bunch of warning messages and no swf output. Does anyone know how to compile this library on Linux?
Box2DFlash on Linux
Bugs, Requests, and FeedbackHi Cerin,
I haven't been able to test Box2DFlash under Flex or using the mxmlc compiler, but I've had a few people send me updates for 1.4.2 that compile under Flex, and I've kept those changes in 1.4.3, which you can download here:
http://skatehed.ho8.com/flash9/143/Box2DFlashAS3_1.4.3.rar
Try compiling Main.as, it doesn't depend on the .fla at all so it should work without the Flash 9 IDE.
Let me know how it goes,
-Matt
I haven't been able to test Box2DFlash under Flex or using the mxmlc compiler, but I've had a few people send me updates for 1.4.2 that compile under Flex, and I've kept those changes in 1.4.3, which you can download here:
http://skatehed.ho8.com/flash9/143/Box2DFlashAS3_1.4.3.rar
Try compiling Main.as, it doesn't depend on the .fla at all so it should work without the Flash 9 IDE.
Let me know how it goes,
-Matt
Hi Matt,
That link timed out for me.
I was able to compile 1.4.2 with mxmlc after I commented out the line "m_aboutText = m_aboutTextN;". However, all the resulting Main.swf does is show the text"memory wasted". I'll retry your link again in a few hours.
Chris
That link timed out for me.
I was able to compile 1.4.2 with mxmlc after I commented out the line "m_aboutText = m_aboutTextN;". However, all the resulting Main.swf does is show the text"memory wasted". I'll retry your link again in a few hours.
Chris
Yeah, there's a few more changes you'll need to make for it to work I think.
I just tried the link I posted and it downloaded ok, but if it's still not working for you I've attached the .rar to this post, hopefully that will work.
Cheers,
-Matt
I just tried the link I posted and it downloaded ok, but if it's still not working for you I've attached the .rar to this post, hopefully that will work.
Cheers,
-Matt
Thanks Matt. I was able to compile and run that just fine. The only oddity was the gear example, which doesn't move all the way.
Thanks Cerin, that's good to hear.
The gear example hasn't been fixed up since moving to pixel units, so the translation limit is -5 to 5, which was 10 meters, but is now only 10 pixels.
The slider crank example is also messed up from not having a big enough motor torque.
They will be fixed before it's officially released, but I'm still deciding whether or not to actually use pixel units in the examples.
All the best,
-Matt
The gear example hasn't been fixed up since moving to pixel units, so the translation limit is -5 to 5, which was 10 meters, but is now only 10 pixels.
The slider crank example is also messed up from not having a big enough motor torque.
They will be fixed before it's officially released, but I'm still deciding whether or not to actually use pixel units in the examples.
All the best,
-Matt
I think if the default was cm units things would work out much better
for using them as pixels.
Vote cm 🙂
Mike
for using them as pixels.
Vote cm 🙂
Mike
As an exercise to familiarize myself with the library, I was going to create a simple side-scrolling shooter game using Box2D to detect collisions. Is there a way to attach a custom callback to an object that would get called during a collision? Also, is there any built-in KNN-like datastructure that would allow easy lookup of the nearby shapes?
Hi Cerin,
Take a look at the Box2D User Manual.
Specifically the sections on 'AABB Queries' and 'Contact Callbacks'.
-Matt
Take a look at the Box2D User Manual.
Specifically the sections on 'AABB Queries' and 'Contact Callbacks'.
-Matt
Thanks, that's exactly what I was looking for.
Original thread: https://box2d.org/forum/viewtopic.php?t=180