Search code examples
libgdxbox2dbox2dlights

Cone light direction Degree parameter doing nothing what ever value i give?


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)?


Solution

  • 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);