libgdx / box2dlights

Fork of box2dlights by Kalle Hamalainen
Apache License 2.0
256 stars 81 forks source link

Camera rotation can break lighting #55

Closed thebnich closed 9 years ago

thebnich commented 9 years ago

Whenever the camera is rotated >90 degrees in either direction, the lighting suddenly breaks (i.e., the screen goes black). Simple test case here.

rinold commented 9 years ago

Have you tried the

   rayHandler.setCombinedMatrix(viewport.getCamera());

instead of

   rayHandler.setCombinedMatrix(viewport.getCamera().combined);

And also could you check if the issue relates to the custom viewport?

thebnich commented 9 years ago
rayHandler.setCombinedMatrix(viewport.getCamera());

Interesting, that does work. Thanks!

rinold commented 9 years ago

As it works only for simple scenarios and sometimes such questions are raised I will keep it open to not to forget to deprecate (and possibly remove) the usage of:

rayHandler.setCombinedMatrix(viewport.getCamera().combined);