0

coneLight = new ConeLight(rayHandler,100,Color.WHITE,200/PPM,0,0,30,30); At directionDegree = 30

    coneLight = new ConeLight(rayHandler,100,Color.WHITE,200/PPM,0,0,60,30);

At directionDegree = 60

    coneLight = new ConeLight(rayHandler,100,Color.WHITE,200/PPM,0,0,130,30);

At directionDegree = 130

why the same result is coming in all case(different values of direction degrees)?

  • It looks like you are attaching the light to a body. This overwrites the angle offset. To add an offset when attaching to a body user coneLight.attach(body, x, y, degrees). – dfour Aug 14 '18 at 09:14
  • thanks ...it worked....and can you please tell me how many types of lights are there in box2D related to libgdx – Shubham Tripathi Aug 14 '18 at 11:20
  • The only ones I used were, point, cone, directional and chain light. Not sure if there are any others. You could check the src on github https://github.com/libgdx/box2dlights – dfour Aug 14 '18 at 11:42
  • @dfour thanks for the help...can you please do me one last favour ...actually i have been struggling with this issue from so many days...can you please answer this question(https://stackoverflow.com/questions/51858339/why-directionallight-is-not-casting-shadow) that would have been a great help for me...thanks in advance – Shubham Tripathi Aug 15 '18 at 14:31

1 Answers1

0

Attaching a Light to a body will cause the light to ignore any angle offsets set to the light.

In order to add an angle offset when attaching to a body use

light.attach(body, x, y, degrees);
dfour
  • 1,376
  • 1
  • 12
  • 16