box2dlights

why DirectionalLight is not casting shadow?

元气小坏坏 提交于 2020-01-06 05:34:35
问题 Code: Color color = new Color(1f,1f,1f,0.9f); DirectionalLight directionalLight = new DirectionalLight(rayHandler,200,color,-90f); directionalLight.setSoftnessLength(0); Result: When light falls directly from above, why it is not casting shadows from boxes? 回答1: This could be caused by a few things. Some things to check: Check if your RayHandler is set to blur. Blurring with small objects can hide shadows. Check the Shadows are enabled in the ray handler. Check the ambient light is off or

how I check collision with box2dlights in libgdx?

落爺英雄遲暮 提交于 2019-12-11 22:01:55
问题 It is possible to detect when a body is under light? ( Collision with the light and a body ) How I check this with libgdx? Sorry for my english... 回答1: It could be easy to implements with raycasting : With a point light, you have to perform a raycast from your body object to the light object, if the first returned body is the light then your object is under light. With a directional (infinite) light you have to raycast from your object body toward light direction opposite, if raycast not

Libgdx light without box2d

落花浮王杯 提交于 2019-11-28 09:26:22
I just started creating a game using libgdx. It is a top down 2d shooter using scene2d ui. Now i thought, that i could add darkness and light to some levels, but i don't want to rewrite everything using box2d. I don't need realistic shadows just some kind of ambient light and a lightcircle arround my character, which is not affected by walls and other obstacles arround him. So i wanted to know if there is any kind of lightsystem in libgdx? Or can i use box2dlights without using box2d bodies/world...? Thanks Unfortunately there is nothing like this already provided by LibGDX. But you can easily

Libgdx light without box2d

蹲街弑〆低调 提交于 2019-11-27 02:53:03
问题 I just started creating a game using libgdx. It is a top down 2d shooter using scene2d ui. Now i thought, that i could add darkness and light to some levels, but i don't want to rewrite everything using box2d. I don't need realistic shadows just some kind of ambient light and a lightcircle arround my character, which is not affected by walls and other obstacles arround him. So i wanted to know if there is any kind of lightsystem in libgdx? Or can i use box2dlights without using box2d bodies