Questions tagged [box2d]

Box2D is a free open source 2-dimensional physics simulator engine written in C++ by Erin Catto and published under the zlib license

Box2D is a free open source 2-dimensional physics simulator engine written in C++ by Erin Catto and published under the zlib license.

The engine performs constrained rigid body simulation. It can simulate bodies composed of convex polygons, circles, and edge shapes. Bodies are joined together with joints and acted upon by forces. The engine also applies gravity, friction, and restitution.

Ports of Box2D exist for Java, ActionScript, C#, JavaScript, and D.

3289 questions
8
votes
1 answer

Xcode: Cocos2d: Can't create world with Box2D

My project originated as the cocos2d Box2D template and I'm having issues as soon as I tried to create a world: world = new b2World(gravity,doSleep); Gives the error: No matching constructor for initialization of 'b2World'. The file is .mm, I…
FBryant87
  • 4,273
  • 2
  • 44
  • 72
8
votes
2 answers

64Bit Version for AndEngine

I have to provide a 64 Bit Version of my Android Game which is using AndEngine in Google Play Store. The offical github repo of AndEngine doesn´t provide a 64 bit version of the library. Does anyone have an idea how to convert the library to 64 bit?…
Jonny Right
  • 528
  • 4
  • 10
8
votes
2 answers

Box2d: Maximum possible linear velocity?

I think I've configured Box2d to have some sort of maximum velocity for any body, but I'm not sure. I apply an impulse like (100000000, 100000000), and the body moves just as fast as (100, 100) - which is not that fast at all. I'm using the Box2d…
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699
8
votes
3 answers

Friction in Box2d

I am using Box2d for a topdown game. The "ground" is a series of tiles, where each tile is a static body with a sensor shape. Can I make friction take effect for this, even though the objects aren't really "colliding" with the ground? If Box2d won't…
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699
8
votes
4 answers

Xcode C++ and Objective-C refactoring

Is there a way to refactor mixed C++/Objective-C code in Xcode ?? I am writing a game using Cocos2D and Box2D, and the Box2D is written on C++, so every class I write should have .mm extension and therefore when I try to e.g. rename the variable, I…
Terko
  • 155
  • 1
  • 1
  • 5
8
votes
1 answer

EndContact of ContactListner(Box2d) not called everytime in LibGDX

I am new in box2d and trying to implement it in a LibGDX Game. What I want to do is to detect the collision between the various bodies. So,I made a class collisionDetection and implement ContactListener in it which gives me 4 overridden methods i.e.…
Jagdeep Singh
  • 1,200
  • 1
  • 16
  • 34
8
votes
3 answers

Floating point determinism between Apple A5 and Apple A6 CPUs

I am developing a multiplayer game with Box2D physics for iOS. The multiplayer is using lock-step method as usual. The game updates physics world fixed-timely. There is no desync among iOS devices with same CPU. However, when testing with new iOS…
8
votes
2 answers

Android libc.so crash?

I'm using AndEngine with the PhysicsBox2DExtension to make a game. My game keeps crashing and I get this in the unfiltered LogCat: 07-06 13:25:27.266: I/DEBUG(19582): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 07-06…
rphello101
  • 1,671
  • 5
  • 31
  • 59
8
votes
1 answer

Box2dweb - Collision Contact Point

I use box2dweb. I am trying to develop a game. At some point I need to find out the contact point between a "Circle" and "Box". All I know is it can be done using b2ContactListener. We can receive contact data by implementing b2ContactListener using…
Shekhar
  • 910
  • 1
  • 13
  • 23
7
votes
2 answers

How to use LibGDX cameras with Box2D Debug Renderers

I am trying to use a Box2D Debug Renderer along with my LibGDX Sprites and Bodies. The problem I am having is that the Renderer draws the Box Body in the center of the screen and then the Sprite is draw at its default location of (0,0) the bottom…
Free Lancer
  • 1,000
  • 2
  • 16
  • 33
7
votes
2 answers

How to generate textures to fit around shapes?

I have a randomly generated series of EdgeShapes, as shown here: My question is, how can I fill that bottom area with a texture in order to make it look like the ground?
Derek
  • 882
  • 1
  • 14
  • 36
7
votes
1 answer

body.setTransform does not work inside contact listener (andEngine and box2d)

I'm trying to move player body while contact with teleport but setTransform isn't executed.This is my contact listener mPhysicsWorld.setContactListener(new ContactListener() { @Override public void beginContact(Contact contact)…
Greg
  • 1,152
  • 1
  • 12
  • 28
7
votes
2 answers

Box2d - Variable length array of non-POD element type 'b2Vec2'

I'm working on a importer for a game of mine, it reads an xml and then creates the box2d bodies for everything. For example
M0rph3v5
  • 945
  • 1
  • 11
  • 23
7
votes
5 answers

How to set centers of shapes/fixtures/bodies in Box2D

Hey i'm trying to integrate SFML and Box2D, and SFML has made setting centers for sprites, shapes, etc. very easy. Box2D, on the other hand, I'm having trouble with as i can't figure out how to set or even find the center of a shape or fixture. It…
Griffin
  • 2,399
  • 7
  • 48
  • 83
7
votes
3 answers

jbox2d tutorial

can you tell me: where can I find tutorials "programming games in jbox2d"?
Piotrek K
  • 105
  • 1
  • 1
  • 3