JBox2D is a java physics engine often used in games an other physics simulations, and is a port/extension of the C++ physics engine, Box2D.

learn more… | top users | synonyms

2
votes
2answers
118 views

Why do my Box2D bodies occasionally get stuck and separate forcibly?

I'm making a space game with LibGDX and Box2D. I made a video here to illustrate the issue. Verbal description: When objects collide, they sometimes get stuck together and are then suddenly separated ...
1
vote
1answer
64 views

Rotating towards a point in Box2D

I'm using Box2d as my physics engine and I'm trying to solve what would normally be a simple problem but what has become a nightmare for me and preventing me from finishing my app. (6 months work) ...
1
vote
1answer
67 views

In JBox2d when dragging a Body, why is the direction is flipped vertically?

Why is it when I drag a JBox2d Body with the mouse, the vertical component is flipped? e.g. If I drag down-right, the Body moves up-right. Is this expected behaviour, a bug in JBox2D, a Mac ...
-1
votes
1answer
55 views

Relative movement in Box2D (keep object from falling off planet)

I'm creating a game with planets orbiting around a sun, like this: The brown square is the earth, rotating around its center and around the sun. The yellow square is the sun, which doesn't move. Now ...
1
vote
0answers
71 views

Mouse click coordinates not mapping to Box2d world

I'm using Box2d in Java with OpenGL, trying to detect if a mouse has clicked on a Body. But having trouble mapping mouse coordinates to Box2d world. I have a Body positioned at 20.0f, 30.0f in the ...
0
votes
0answers
27 views

Can't perform normal jump after applying revolute joint

I have encountered the following problem: I have two PolygonShapes which I had connected with a RevoluteJoint. The first body is called square the second is called weapon, before connecting the two ...
0
votes
0answers
38 views

Simulate juggling : how throw and grab objects with JBOX2D

There is an object which simulates a ball and another which simulates a hand (square).I want to be able to catch the ball and throw it with a projection force with the hand on JBOX2D. Any sample code ...
0
votes
0answers
36 views

Box2DLight position seems to Floor

I am creating a top down game and i'm using raycasted lights from Box2Dlights, My light is all set up and working. its attached to the player's Body, and when the player moves, the sprite I attached ...
0
votes
0answers
37 views

Using debugdraw in jbox2d

I've created a class which implements org.jbox2d.callbacks.DebugDraw. And implemented the abstract methods too. DebugDrawHandler extends org.jbox2d.callbacks.DebugDraw I've instanciated it with: ...
0
votes
0answers
98 views

Correctly identifying a Fixture from an extended class in Box2D's ContactListener

Sorry for the confusing title, I dont know how to resume it that much. Im making a game, and I have a simple class Mob which is extended by Warrior and Enemy. A Mob has a Body, and that body usually ...
0
votes
0answers
32 views

Drawing jbox2d shapes in slick2d

How would be the best way to go about drawing polygons in slick after forces where applied to them via jbox2d? There seems to be no way to get the vertices of a body defined in jbox2d...
0
votes
0answers
21 views

How can I avoid duplication of jBox2D physics attributes?

I'm using jBox2D for physics and collision detection in a game engine with an entity-component system. It works, but I'm unsure how to structure my code with respect to the values represented in the ...