Hi.
I'm trying to set up JBox2d. I'm basing my code off the box2d tutorials (
). This is my code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See
http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
iteration = 0 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 1 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 2 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 3 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 4 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 5 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 6 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 7 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 8 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 9 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 10 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 11 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 12 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 13 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 14 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 15 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 16 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 17 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 18 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 19 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 20 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 21 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 22 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 23 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 24 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 25 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 26 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 27 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 28 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 29 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 30 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 31 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 32 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 33 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 34 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 35 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 36 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 37 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 38 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 39 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 40 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 41 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 42 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 43 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 44 pos.x = 0.0 pos.y = -10.0 angle = 0.0
iteration = 45 pos.x = 0.0 pos.y = -10.0 angle = 0.0
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at org.jbox2d.dynamics.Island.add(Island.java:413)
at org.jbox2d.dynamics.World.solve(World.java:916)
at org.jbox2d.dynamics.World.step(World.java:560)
at test.Game.run(Game.java:53)
at test.Game.main(Game.java:65)
I have no idea why an exception is being thrown - I'm most likely screwing something up somewhere, but I'm unsure where as I'm still new to box2d.
Cheers.