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.

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

Questions

Questions with the jbox2d tag should be specifically about JBox2D and its implementation. Questions about the physics engine in general should be tagged with box2d as well.

Brief Definitions

  • World contains the physics environment for a simulation
  • Body is a physics entity with any number of child fixtures. These fixtures are treated as all part of the same physics object, and will interact accordingly (they won't break up). Bodies also provide support for user-applied forces and torque.
  • Fixture contains a single shape and information about it (for example, friction and restitution).
  • Shape contains information about the basic physical properties of the physics object. (for example, the vertices of the polygon shape)
  • Joint is basically a way of adding constraints to different bodies. There are a variety of joints, including revolute, distance, and prismatic joints.

Links

JBox2D

Box2D

183 questions
0
votes
2 answers

why does bounce increase in box2d when restitution=1

I have created a dynamic circle inside a static box (four static walls to make a box). applied negative gravity to the world. now the effect is the circular body should bounce off inner walls and eventually stabilize. with restituion=1 the effect…
maheshg
  • 339
  • 2
  • 7
  • 17
0
votes
1 answer

Create() or Render() for creating instances

I am learning Java, LibGDX, Box2D via the use of projects and tutorials, I am following a tutorial at the moment and I wanted to raise a question regarding the render() loop and the create() method. So first create() always gets called first, then…
Gibbo
  • 630
  • 1
  • 8
  • 22
0
votes
2 answers

Jbox2D - Body moving randomly

I'm having a little problem with jbox2d. As soon as the method world.step is called my dynamic body moves out of the original position. I tried to print everything else (the position of static bodies and the movement of the dynamic body) and it's…
Epi
  • 682
  • 3
  • 10
  • 16
0
votes
1 answer

Need some help learning jbox2d

first of all thanks a lot for your time :) I'm currently trying to understand how jbox2d works and I'm having some issues. The code I wrote makes sense to me, but there should be something I didn't understand at all. Basically what I want to do at…
Epi
  • 682
  • 3
  • 10
  • 16
0
votes
1 answer

Can't build JBox2D duplicate class(es)

I'm interested in learning JBox2D, but I seem to have stumbled at the first hurdle - building the library. The Quick-start instructions specify the following simple steps: Check out the project through Subversion: Import to your IDE as a Maven…
Levity
  • 315
  • 3
  • 11
0
votes
1 answer

How do I compute the force between two contacting bodies in box2d / jbox2d?

I am building a simulated robot hand using jbox2d (a port of box2d to Java). I have a Body which is the hand, and I would like to know what forces are on the hand when it is touching other bodies. I know I can get the ContactList, but I don't know…
hqm
  • 73
  • 6
0
votes
0 answers

Cannot load multiple bodies from World

I'm using JBox2d with json to add the bodies from a seprate file, in this case "game_shapes.json". It successfully adds the FIRST body of the json file, into the Bodies List, and shows it on the screen no probs. I try to loop through all of the…
Kevin Jensen Petersen
  • 423
  • 2
  • 22
  • 43
0
votes
2 answers

Finding point of touch on a shape

In a Box2D project I need to create a RevoluteJoint between two PolygonShaped bodies at the exact point where the user double tapped. I have the point of touch, and a list of vertices for each of the two shapes (obviously set not to collide with…
Eddy
  • 3,533
  • 13
  • 59
  • 89
0
votes
1 answer

Adding Exterior Physic Engine Library to new Project in Java (JBox2D)

I want to import JBox2D libraries into a new project, im new to using exterior libraries so my doubts will seem really stupid but oh well, thats how you learn. So i kind of followed the tutorial in JBox2D website and i made it this far: You can see…
Xkynar
  • 935
  • 1
  • 10
  • 31
0
votes
2 answers

Importing JBox2D libraries into a new project

I want to import JBox2D libraries into a new project, im new to using exterior libraries so my doubts will seem really stupid but oh well, thats how you learn. So i kind of followed the tutorial in JBox2D website and i made it this far: You can see…
Xkynar
  • 935
  • 1
  • 10
  • 31
0
votes
1 answer

realistic jumping box2d - configuration of variables

I'm still working on my Jump 'n' Run and have already solved the "can I jump" question. My Question is now, how should I configure the Gravity, the Timesteps, the Fixturesize, the applied Impulse and the Fixturedensity for the most realistic…
Xerusial
  • 525
  • 1
  • 5
  • 17
0
votes
1 answer

How to display/visualize JBox2D world with Java

I wrote a JBox2D app following a FlashDevelop tutorial. Everything seems to work well from the commandline, my problem now is how to display the world in a JFrame or an alternative approach to visualize. I tried DebugDraw, but was completely lost.…
piouson
  • 3,328
  • 3
  • 29
  • 29
0
votes
1 answer

LIBGDX Newest Testbed for Box2d

I'm testing the newest Box2d Testbed using Libgdx. It appears they aren't working and need to know if anyone else is having the same issue(s). The first one is called Conveyor Belt,…
0
votes
1 answer

Appropriate Drawing Library for JBox2D

I'm programming a JBox2D Application. Until now, I used the Graphics2D and the Swing library to draw JBox2D objects on the screen. But now it's getting difficult because I want to attach images and rotate Objects. If you work also with JBox2D, can…
lmaooooo
  • 3,364
  • 4
  • 19
  • 24
0
votes
1 answer

JBox2d: Negative gravity results in object going up?

I am a newbie learner to JBox2D. I was just trying JBox2D for the first time on Android(I know Android development and I'm good in it) because my project needed physics. Now, the tutorials and "Official User Manual" of Box2D said that negative…
hasankamal
  • 317
  • 2
  • 7