Questions tagged [jbox2d]

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.

6 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
250 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 ...
bobbyrne01's user avatar
1 vote
0 answers
53 views

Uniform lighting when there are multiple light sources

I'm writing a 2d game where there are walls and the NPCs can only see what is within their line of site. To do this I'm using Box2dLights so the walls create shadows. The problem I'm having is ...
Michael's user avatar
  • 121
1 vote
0 answers
35 views

Getting a TOISolver ArrayIndexOutOfBoundsException creating a tile based game

I've been making a tile-based game on java using jBox2D.For adding tiles to physical world I use static bodies which are stored in updating ArrayList(i use PhysicBlock class as a wrapper). Whenever I ...
Daniel's user avatar
  • 11
1 vote
0 answers
33 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 ...
Petter Thowsen's user avatar
0 votes
1 answer
102 views

Have body resume constant velocity after collision

I want to have a body move at a constant velocity, but react to collisions. My example game is a train, I want it to move at 1 meter a second. If an obstacle appears on the tracks, I want it to react ...
Rogerio's user avatar
-1 votes
1 answer
178 views

Collision problem JBox2D

I work with Processing and the JBox2D library and wanna code a new Ping Pong game. But if I move the player to the top border (or lower border), he collide on a wrong position. The picture shows ...
user67272's user avatar