Closed ghost closed 9 years ago
Ohh... The Directional light is not a positional light type and thus doesn't support the attaching to the bodies. The methods you have used on DirectionalLight are marked as deprecated with comment that they are not applicable to that light type, so it's not the issue that they are not working...
I don't want to modify them to allow such behavior cause it could be a mess of the same methods doing quite different things. However, I'll think about adding the other specific for DirectionalLight method to make the setIgnoreAttachedBody() work...
Currently, you can achieve the same effect by setting the filters to ignore the ground body using the following method:
dirLight.setContactFilter(...)
Yeah I figured out that it wasn't supported, apologies. But yes would certainly like to request that something similar for them is implemented.
Should be available in next releases :)
/** To disable the body shadow **/
DirectionalLight sun = new DirectionalLight (...);
sun.setIgnoreBody(someBodyToIgnore);
/** To get the ignored body **/
Body ignored = sun.getBody();
/** To disable **/
sun.setIgnoreBody(null);
Thanks a lot!
I have been trying to use the new setIgnoreAttachedBody() in the 1.4 snapshot and unfortunately it is not working.
This is returning false and shadows are still being cast on the ground body. I have tried putting setIgnoreAttachedBody() before attachToBody() as well. It appears it will work with a ConeLight but not a DirectionalLight.