jbox2d

Is this the correct way of using Java 2D Graphics API?

感情迁移 提交于 2019-11-27 09:52:25
I'm creating a graphical front-end for a JBox2D simulation. The simulation runs incrementally, and in between the updates, the contents of the simulation are supposed to be drawn. Similar to a game except without input. I only need geometric primitives to draw a JBox2D simulation. This API seemed like the simplest choice, but its design is a bit confusing. Currently I have one class called Window extending JFrame , that contains as a member another class called Renderer . The Window class only initializes itself and provides an updateDisplay() method (that is called by the main loop), that

Libgdx Box2D pixel to meter conversion?

白昼怎懂夜的黑 提交于 2019-11-26 21:43:16
问题 When trying to program a game using Box2D, I ran into a problem with Box2D. I filled in pixel numbers for the lengths of the the textures and sprites to create a box around it. Everything was at the right place, but for some reason everything went very slowly. By looking on the internet I found out that if you didn't convert pixels to meters box2d might handle shapes as very large objects. this seemed to be a logical cause of everything moving slowly. I found similar questions on this site,

Is this the correct way of using Java 2D Graphics API?

十年热恋 提交于 2019-11-26 17:52:50
问题 I'm creating a graphical front-end for a JBox2D simulation. The simulation runs incrementally, and in between the updates, the contents of the simulation are supposed to be drawn. Similar to a game except without input. I only need geometric primitives to draw a JBox2D simulation. This API seemed like the simplest choice, but its design is a bit confusing. Currently I have one class called Window extending JFrame , that contains as a member another class called Renderer . The Window class