Hello I am trying to make a chrater with a lighter, that will only send light to the forward.
something like this:

But currently I have this:
How can I do this?
My light point and ray initialization
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| debug = new Box2DDebugRenderer(); this.texture = new Texture("sprites/water.png"); this.camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); this.camera.setToOrtho(false); this.renderer = new SpriteBatch(); this.map = new TileMap(20, 20); this.map.generateAllSame(new Texture("sprites/sprite.png")); this.world = new World(new Vector2(), true); this.createBodies(); RayHandler.setGammaCorrection(true); RayHandler.useDiffuseLight(true); this.ray = new RayHandler(this.world); this.ray.setAmbientLight(0.1f, 0.4f, 0.2f, 0.1f); this.ray.setCulling(true); this.ray.setBlurNum(2); camera.update(true); this.spriteLight = new PointLight(ray, 1000, Color.CYAN, 5, 1.f, 1.f); this.spriteLight.attachToBody(this.bodies.get(1), 0, 0); |