Added pseudo3d functionality from pseudo3d branch for directional light. #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added (mainly for myself) the pseudo3d functionality for the directional light. Also tested it for my game i make. Would fix #68 and #40 i guess? Took some code from @rinold (good work tho) and altered it for my needs.
I saw in the pseudo3d branch that there are extra classes for handling pseudo3d but for my case i only needed the directional light and at the moment i guess this is the only light that really needs pseudo3d in my opinion. Dunno if pointlight or conelight needs this functionality (of course nice to have) cause in my top down shooter i use cone light only for flashlights and pointlights for street lamps, so they do not shine over the entire scene and therefore are finite and do not throw infinite shadows.
So i make this PR for discussion. Sorry for the whitespace issue, my IDE Netbeans auto formatted a lot of code. But you can compare the code with the
w=1
switch in the URL.Thanks for reviewing and hopefully i do not waste someones time. If you wanna see the sun cyclus you can run the DesktopLauncher from the test package and press F4 for directional light, but i guess you have to alter the path in the Box2DLightTest class to the resources cause Netbeans uses per default other path for resources.