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
4
votes
1 answer

Box2D static body collision performance issue

I'm using JBox2d to perform collision detection in a game project I'm working on. I represent obstacles in the world with static bodies. Whenever a dynamic body (i.e. a game character) collides with one of these obstacles, there is a very noticeable…
Willow Boy
  • 41
  • 2
3
votes
1 answer

Where can I find fixture presets of different materials?

Where can I find fixture presets, that can be used in rigid body physics engines, like Box2D to simulate the behaviour of different materials? I'm looking for values of density, friction and restitution for common materials like: Smooth/rough…
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
3
votes
1 answer

PlayN HTML wont work with playn-jbox2d

Whenever I try and Compile my PlayN project with playn-jbox2D as a dependecy, I get the following error on HTML ONLY, the rest turns out ok [INFO] [ERROR] An internal compiler exception occurred [INFO]…
KatGaea
  • 996
  • 1
  • 12
  • 31
3
votes
1 answer

Java Game Networking with Kryonet: Bare-bones packet transfering

I'm using Opengl and Jbox2d to write a real-time 2d game in Java. I want to start coding the networking components. Although it uses box2d, my game is very small and I want to create a bare-bones architecture using the Kryonet library. The program…
bigcodeszzer
  • 916
  • 1
  • 8
  • 27
3
votes
1 answer

Top-Down Car in JBox2D libGDX movement issues

I am trying to implement a Java version of the top down car game based on Emanuele Feronato's "Two ways to make Box2D cars". I know some basics of box2d and for the most part I converted the code to Java as is with few exceptions. However, when I…
BBogie
  • 31
  • 5
3
votes
2 answers

Purpose of a "ground body" in Box2D?

I'm just starting on making an Asteroids clone game in java for a class. This is my first time working with Box2D, so I'm trying to make sure I understand the basics of the class hierarchy. One thing I'm confused about is something in the Box2D…
DementedDr
  • 177
  • 2
  • 15
3
votes
2 answers

JBox2d - world.getBodyList() goes into an infinite loop

I'm trying to make a class that would draw objects of my JBox2d's world onto a canvas. On update I have a call to render.draw(canvas,world); which passes the world and the canvas to the drawing class, which will be supposed to cycle through the…
Roger Travis
  • 8,402
  • 18
  • 67
  • 94
2
votes
2 answers

Box2D - Falling body not accelerating under gravity

I have created a basic example of a falling ball but I am slightly confused to why the object is not accelerating while falling. It is travelling at constant speed which isn't what I would expect. This is my first day using Box2D I assume I have…
Moz
  • 1,494
  • 6
  • 21
  • 32
2
votes
3 answers

Are there any easy-to-understand and working tutorials for JBox2D?

I am looking for some beginner tutorials for the newest release of JBox2D. The ones I have found are all outdated. If possible a tutorial on how to apply the whole thing on android would also be good. I am simply trying to make some walls that the…
chrypthic
  • 579
  • 1
  • 6
  • 15
2
votes
1 answer

How to make box2d mouse joint works similar to box2d setposition

I want to make b2mouse joint working similar to b2setposition, though i know in mouse joint force is applied, so it's not possible to reach the desired point without any delay like setPosition(), but i want to make it works as close as…
russell
  • 3,668
  • 9
  • 43
  • 56
2
votes
1 answer

Ball in JBox2d bounces forever

Im trying out JBox2d. I´ve been through a couple of tutorials, and got it up and running. Created four walls and a ball that should bounch. At the start the ball would bounce too little, just making 2-3 bounces then stopping suddenly. I managed to…
dac2009
  • 3,521
  • 1
  • 22
  • 22
2
votes
1 answer

Box2D : Check collision with the Joint?

As shown in the image I have implemented "blob" by connecting Circle shapes with "Distance Joints". (refering JBox2D ContantVolume joint). Is it possible to check whether other objects (in above case,circle in Magenta color) collide with the…
Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
2
votes
1 answer

When removing items on Bubble-Picker, The following errors occur

Introduction ( What is Bubble-Picker?) 1.1 Bubble-Picker with removing feature : Source => https://github.com/tuxxon/Bubble-Picker Error movie => https://www.youtube.com/watch?v=ukS30xoCxhc 1.2 Bubble-Picker: An easy-to-use animation which can…
안국환
  • 21
  • 1
2
votes
1 answer

How to have the screen/camera follow a box2d body as it moves

I am trying to learn how to use box2d (a lot of this code is unashamedly stolen from the legend Dan Shiffman) so I have created a small "game" where a ball rolls in Perlin noise terrain. The obvious problem with my code is that quite quickly the…
User9123
  • 35
  • 5
2
votes
1 answer

How can I import multiple classes in Java with fewer import fewer import statements?

I am quite new to using packages in Java and I would like to know if there is an easier way to import classes with fewer import statements. I am using Processing and I have started using Box2D for Processing to create some games. In order to use the…
Ed The ''Pro''
  • 875
  • 10
  • 22
1
2
3
12 13