Re: [android-developers] Box2d on Android
Thanks. Looks like there is a book on this: http://www.amazon.com/AndEngine-Android-Game-Development-Cookbook/dp/184951898X/ The price of the Kindle version looks reasonable. On Saturday, February 23, 2013 10:39:10 AM UTC-6, mbanzon wrote: Most examples of Box2D on Android I've seen use AndEngine: http://www.andengine.org/ fredag den 22. februar 2013 skrev bob : I guess that is a red herring. I think people must be using JBox2d. Here's a quick test I wrote in case it helps anyone: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Vec2 gravity = new Vec2(0, -10); World world = new World(gravity, true); world.setContactListener(new My_Listener()); BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.DYNAMIC; bodyDef.position = new Vec2(0, 110); bodyDef.linearVelocity = new Vec2(100, 0); Body body = world.createBody(bodyDef); PolygonShape box = new PolygonShape(); box.setAsBox(0.5f, 0.5f); FixtureDef fixtureDef = new FixtureDef(); fixtureDef.shape = box; fixtureDef.density = 1.0f; fixtureDef.friction = 0.3f; body.createFixture(fixtureDef); Vec2 pos1 = body.getPosition(); Log.d(test, pos1: + pos1.x + , + pos1.y); world.step((float) 1, 8, 1); Vec2 pos2 = body.getPosition(); Log.d(test, pos2: + pos2.x + , + pos2.y); } On Thursday, February 21, 2013 2:26:01 PM UTC-6, bob wrote: I heard rumors of people using Box2d on Android. I searched and came across this project: http://code.google.com/p/**androidbox2d/http://code.google.com/p/androidbox2d/ However, it appears to be in disarray. Does anyone know if this is what people are really using to do Box2d on Android? Also, it has this curious outstanding issue of almost 4 years: *What steps will reproduce the problem?* 1. Open androidbox2d wiki 2. Search for instructions. 3. Deal with disappointment and dismay. No instructions will be found. *What is the expected output? What do you see instead?* Expected instructions. Instead, I see nothing. *What version of the product are you using? On what operating system?* Latest. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Michael Banzon http://michaelbanzon.com/ -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Box2d on Android
Most examples of Box2D on Android I've seen use AndEngine: http://www.andengine.org/ fredag den 22. februar 2013 skrev bob : I guess that is a red herring. I think people must be using JBox2d. Here's a quick test I wrote in case it helps anyone: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Vec2 gravity = new Vec2(0, -10); World world = new World(gravity, true); world.setContactListener(new My_Listener()); BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.DYNAMIC; bodyDef.position = new Vec2(0, 110); bodyDef.linearVelocity = new Vec2(100, 0); Body body = world.createBody(bodyDef); PolygonShape box = new PolygonShape(); box.setAsBox(0.5f, 0.5f); FixtureDef fixtureDef = new FixtureDef(); fixtureDef.shape = box; fixtureDef.density = 1.0f; fixtureDef.friction = 0.3f; body.createFixture(fixtureDef); Vec2 pos1 = body.getPosition(); Log.d(test, pos1: + pos1.x + , + pos1.y); world.step((float) 1, 8, 1); Vec2 pos2 = body.getPosition(); Log.d(test, pos2: + pos2.x + , + pos2.y); } On Thursday, February 21, 2013 2:26:01 PM UTC-6, bob wrote: I heard rumors of people using Box2d on Android. I searched and came across this project: http://code.google.com/p/**androidbox2d/http://code.google.com/p/androidbox2d/ However, it appears to be in disarray. Does anyone know if this is what people are really using to do Box2d on Android? Also, it has this curious outstanding issue of almost 4 years: *What steps will reproduce the problem?* 1. Open androidbox2d wiki 2. Search for instructions. 3. Deal with disappointment and dismay. No instructions will be found. *What is the expected output? What do you see instead?* Expected instructions. Instead, I see nothing. *What version of the product are you using? On what operating system?* Latest. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.comjavascript:_e({}, 'cvml', 'android-developers@googlegroups.com'); To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript:_e({}, 'cvml', 'android-developers%2bunsubscr...@googlegroups.com'); For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.comjavascript:_e({}, 'cvml', 'android-developers%2bunsubscr...@googlegroups.com');. For more options, visit https://groups.google.com/groups/opt_out. -- Michael Banzon http://michaelbanzon.com/ -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Box2d on Android
I heard rumors of people using Box2d on Android. I searched and came across this project: http://code.google.com/p/androidbox2d/ However, it appears to be in disarray. Does anyone know if this is what people are really using to do Box2d on Android? Also, it has this curious outstanding issue of almost 4 years: *What steps will reproduce the problem?* 1. Open androidbox2d wiki 2. Search for instructions. 3. Deal with disappointment and dismay. No instructions will be found. *What is the expected output? What do you see instead?* Expected instructions. Instead, I see nothing. *What version of the product are you using? On what operating system?* Latest. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Box2D on Android via JNI
Hi there, i thought i'd post a link here for future reference. I wrote a complete JNI bridge to the latest Box2D release for Android. All relevant classes are wrapped via lightweight Java counter parts, all listeners except the destroy listener are exposed, all joints are support and so on and so forth. The only things missing are some of the body-GetNextBody() methods which would just not work out very well in Java (well, it's possible but not very wise performance wise). The focus of this port was on getting a zero dynamic allocation version of Box2D directly accessible in Java and i think i succeeded in that. You can find more info about it at http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=586. I altered the source only marginally, some of the include definitions needed reworking (at least i couldn't get it to work any other way) and the dependence on the stl algorithm package for sorting has been replaced by a simple qsort. Other than that it's a vanilla Box2D version that's used. Also note that this does work on the desktop as well (libgdx is crossplatform ). I consider making a seperate project out of this so it is not dependant on libgdx. For the time being i keep it there though as it eases my pains of managing multiple projects a little. It should be trivial to cut out the box2d parts from the libgdx source and create a seperate project out of it. So just go ahead if that's what you want to do :) Hope that helps out a couple of you guys a little, Mario -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en