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
6
votes
3 answers

Are there any tutorials on coding a parser for SVG files to be used by box2D?

I am trying to create an iPhone game with fairly large levels. Hard coding the platforms and physics objects is very time consuming. I have seen some people have made their own parsers for svg files to use in box2D, and Riq is selling levelSVG but…
kai Taylor
  • 785
  • 1
  • 7
  • 21
6
votes
1 answer

How to import `.a` file to CMake in C++?

I've generated libBox2D.a. Now I want to import it to C++ project, but I don't know how. How I can import my libBox2D.a to my project using CMake?
Szymon Marczak
  • 1,055
  • 1
  • 16
  • 31
6
votes
2 answers

How to slow down box2d body linear or angular velocity

I have a circle shape dynamic body that simulates a bouncing ball, I set the restitution to 2 and it just gets out of control to the point it does't stop from bouncing up and down. So I want to slow down the ball linear or angular velocity using…
Kevin Bryan
  • 1,846
  • 2
  • 22
  • 45
6
votes
3 answers

Farseer or Box2D? Top-down shooter physics implementation

Which one of these would fit a top down shooter better? I've heard that Box2D performs faster, but I've also noticed that it lacks wider community support for XNA (it rather seems to be used for flash - for a reason unknown to me). Farseer is…
Johnny
  • 889
  • 2
  • 13
  • 24
6
votes
1 answer

LibGDX BOX2D change maxPolygonVertices

I need to make a body with more than 8 vertices, and i get the error. AL lib: (EE) alc_cleanup: 1 device not closed Assertion failed! Program: C:\Program Files\Java\jre7\bin\javaw.exe File:…
Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94
6
votes
2 answers

What effect does "wake" have in b2Body::ApplyLinearImpulse?

I am using Box2d v2.3 The following box2d method takes a bool "wake" : inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake) What does it do? Regardless of whether I set it to YES or NO, it doesn't seem to…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
6
votes
2 answers

Set Camera Rotation in Libgdx

I can't seem to find a way to tie the rotation of my ortho camera in libgdx (project with box2d) to the rotation of a box2d body. There is the method of cam.rotate(xy), giving it an impulse or acceleration, but I would like to set a definitive…
Jonas
  • 381
  • 3
  • 15
6
votes
2 answers

CMake: How to access a variable from a subdirectory without explicitly setting it in parent scope

I have added a subdirectory in CMake by using add_subdirectory. How can I access a variable from the scope of that subdirectory without explicitly setting the variable by using set in combination with PARENT_SCOPE ? set(BOX2D_BUILD_STATIC …
user1492625
  • 313
  • 5
  • 10
6
votes
6 answers

Add existing SVG or HTML5 Elements to a Box2D World

I have an SVG logo made up predominatly of elements. I want to animate this, or more specifically drop it into a "gravity world". I was hoping to use Box2D (web port). I'm a noob to Box2D and Canvas really, but I've got as far as converting my SVG…
cirrus
  • 5,624
  • 8
  • 44
  • 62
6
votes
1 answer

Graphical effects like elastic tentacles in Contre Jour

I am wondering how beautiful is "Contre jour" game for IOS. Especially i like elastic "tentacles",shown in this video on 2 min 20 seconds: http://www.youtube.com/watch?v=ptdTdJarWLw How can I implement such effects? I know that there is technic…
Alexander Tkachenko
  • 3,221
  • 1
  • 33
  • 47
5
votes
1 answer

Header files not found

I'm adding unit tests (SenTest) to my existing XCode 4.2 project. XCode is complaining that it can't find the required Box2D header files. For instance, Box2D/Dynamics/b2Fixture.h file not found The Box2D source files are added to my project…
user371320
  • 1,388
  • 14
  • 23
5
votes
3 answers

box2d Apply force in a particular direction

I want to apply a force to my object in the direction that it is currently facing, here is my code so far but it is throwing errors when I try do force * t, what am I doing wrong? b2Transform t; t.Set(b2Vec2(0, 0),…
Chris
  • 26,744
  • 48
  • 193
  • 345
5
votes
1 answer

Threading Box2D with pthreads

So I'm essentially trying to implement an AIR Native Extension that does the physics simulation in C with interfaces through Actionscript. I've gone through quite a few iterations which I'll list below for interest sake and I'm at what I think could…
Jon
  • 263
  • 4
  • 19
5
votes
2 answers

GTA2 like Car Physics, but extremely simplified

Okay so this problem has been bothering me for the longest time. Can anyone show me or point me to an algorithm that can control a car like that of GTA2? After 3 days of research all I could come up with was all of these algorithms for using pivot…
Free Lancer
  • 1,000
  • 2
  • 16
  • 33
5
votes
1 answer

Turn based multiplayer physics networking

I am currently in the planning stages for a 2D game for mobile devices which I will be making in C++ using cocos2d-x. The game will be turn based and each turn will have a phase in which the physics simulations will take place. It will also be…
ash
  • 51
  • 2