Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++.
5
votes
2answers
1k views
cocos2d Merging box2d bodies
i'm using cocos2d to build an iphone game.
my game currently has two sprites: one for the main character and another for an item i should carry once he gets on him.
the main character and the item ...
5
votes
3answers
4k views
Polygon/Shape definition changes in Box2D 2.1
I was going through a pretty good tutorial on Box2D here, but I ran into a problem when he made a b2PolygonDef, because the tutorials were made in 2.0, and I'm using 2.1. I could download 2.0 I guess, ...
49
votes
5answers
14k views
Good 2D Platformer Physics
I have a basic character controller set up for a 2D platformer with Box2D, and I'm starting to tweak it to try to make it feel good. Physics engines have a lot of knobs to tweak, and it's not clear to ...
7
votes
6answers
595 views
Physics library internals
I've seen box2d and bullet ports into javascript, but neither of them attracted me particularly, except by source code.
It all seemed, after all, quite simple once I looked inside them. But what are ...
5
votes
2answers
3k views
Using The Box2D Polygon “Set()” function?
I'm using the Box2D physics engine. And there's a type of shape for box2D called b2PolygonShape.
In this class, you can create polygons. There is also a Set() function that takes an array of points ...
5
votes
3answers
3k views
Box2D Check If Point Intersects a Body
Is there a way to check if a point is intersecting a body?
For example, lets say there's a body in the world at a position of (100,100).
Is there a way to check if a point at (100,100) intersects ...
9
votes
1answer
2k views
Box2D Get Bounding Box of a Body
In Box2D, I was curious if it's possible to get a bounding box of a body already created in the world.
So basically, the Body is created, it's interacting with the world and such. And I needed that ...