{"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/3049","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/3049/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/3049/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/3049/events","html_url":"https://github.com/libgdx/libgdx/issues/3049","id":70540892,"number":3049,"title":"Box2D: Box2DDebugRenderer Render call before RayHandler Render call.","user":{"login":"CoderMusgrove","id":5943031,"avatar_url":"https://avatars.githubusercontent.com/u/5943031?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderMusgrove","html_url":"https://github.com/CoderMusgrove","followers_url":"https://api.github.com/users/CoderMusgrove/followers","following_url":"https://api.github.com/users/CoderMusgrove/following{/other_user}","gists_url":"https://api.github.com/users/CoderMusgrove/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderMusgrove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderMusgrove/subscriptions","organizations_url":"https://api.github.com/users/CoderMusgrove/orgs","repos_url":"https://api.github.com/users/CoderMusgrove/repos","events_url":"https://api.github.com/users/CoderMusgrove/events{/privacy}","received_events_url":"https://api.github.com/users/CoderMusgrove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-23T23:37:19Z","updated_at":"2015-04-29T12:06:15Z","closed_at":null,"body":"Yesterday, I was working on re-learning Box2D, and I had a previous example before-hand. When I was doing this, I was having trouble rendering the fixture that I have created, and I had no idea why.\r\n\r\nWhat it turned out to be was that I was calling code in this order:\r\n```\r\nbox2dDebugRenderer.render(world, camera.combined);\r\nrayHandler.render();\r\n```\r\n\r\nCalling the code this way, without having any *Light* objects in my *RayHandler* would keep my *Box2DDebugRenderer* from rending my *Body*.\r\n\r\nFull *working* Code (if necessary):\r\n```java\r\npublic class TestBox2D extends EGGame {\r\n\r\n\tint width;\r\n\tint height;\r\n\r\n\tstatic final Vector2 ZERO_GRAVITY = new Vector2(0f, 0f);\r\n\r\n\tOrthographicCamera camera;\r\n\tWorld world;\r\n\tBody body;\r\n\tBox2DDebugRenderer box2dDebugRenderer;\r\n\tRayHandler rayHandler;\r\n\tArray<Body> bodies;\r\n\r\n\tpublic TestBox2D(EGVersion version, String dataFolderName, LwjglApplicationConfiguration config) {\r\n\t\tsuper(version, dataFolderName, config);\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void init() {\r\n\t\twidth = Gdx.graphics.getWidth()/4;\r\n\t\theight = Gdx.graphics.getHeight()/4;\r\n\t\tcamera = new OrthographicCamera(width, height);\r\n\t\tcamera.position.set(width / 2, height / 2, 0);\r\n\t\tcamera.update();\r\n\r\n\t\tworld = new World(ZERO_GRAVITY, true);\r\n\t\tbox2dDebugRenderer = new Box2DDebugRenderer();\r\n\t\trayHandler = new RayHandler(world);\r\n\t\trayHandler.setCombinedMatrix(camera.combined);\r\n\r\n\t\tBodyDef bodyDef = new BodyDef();\r\n\t\tbodyDef.type = BodyDef.BodyType.StaticBody;\r\n\t\t bodyDef.position.set(width / 2, height / 2);\r\n\r\n\t\tbody = world.createBody(bodyDef);\r\n\r\n\t\tCircleShape shape = new CircleShape();\r\n\t\tshape.setRadius(1f);\r\n\r\n\t\tFixtureDef fixtureDef = new FixtureDef();\r\n\t\tfixtureDef.shape = shape;\r\n\t\tbody.createFixture(fixtureDef);\r\n\r\n\t\tbodies = new Array<>();\r\n\t\t\r\n//\t\tnew PointLight(rayHandler, 500, Color.GREEN, 50, 20, 20);\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void updateGame() {\r\n\t\tworld.step(1f / 30f, 6, 2);\r\n\t\tworld.getBodies(bodies);\r\n\t\trayHandler.update();\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void renderGame() {\r\n//\t\trayHandler.render();\r\n\t\tbox2dDebugRenderer.render(world, camera.combined);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void dispose() {\r\n\t\tworld.dispose();\r\n\t}\r\n\r\n\tpublic static void main(String... args) {\r\n\t\tnew TestBox2D(null, null, new LwjglApplicationConfiguration());\r\n\t}\r\n}\r\n```\r\n\r\n**The Issue is**:\r\n\r\nWhen rendering, if the code is called like:\r\n```java\r\nbox2dDebugRenderer.render(world, camera.combined);\r\nrayHandler.render();\r\n```\r\nand there are no *Light* objects associated with the *RayHandler*, the *Box2DDebugRenderer* doesn't render (at least) the fixtures."},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/97402012","html_url":"https://github.com/libgdx/libgdx/issues/3049#issuecomment-97402012","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/3049","id":97402012,"user":{"login":"nooone","id":5896510,"avatar_url":"https://avatars.githubusercontent.com/u/5896510?v=3","gravatar_id":"","url":"https://api.github.com/users/nooone","html_url":"https://github.com/nooone","followers_url":"https://api.github.com/users/nooone/followers","following_url":"https://api.github.com/users/nooone/following{/other_user}","gists_url":"https://api.github.com/users/nooone/gists{/gist_id}","starred_url":"https://api.github.com/users/nooone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nooone/subscriptions","organizations_url":"https://api.github.com/users/nooone/orgs","repos_url":"https://api.github.com/users/nooone/repos","events_url":"https://api.github.com/users/nooone/events{/privacy}","received_events_url":"https://api.github.com/users/nooone/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T12:06:15Z","updated_at":"2015-04-29T12:06:15Z","body":"Does it render the fixtures if you completely remove the `RayHandler` and all other box2dlights specific things? If so, this is definetely the wrong place for this issue. Try it at https://github.com/libgdx/box2dlights/issues"}}