mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- Fix wrong math for model/light distance check
This commit is contained in:
parent
ba298ccd6e
commit
bd08568b90
1 changed files with 2 additions and 2 deletions
|
@ -209,12 +209,12 @@ void gl_SetDynModelLight(AActor *self, bool hudmodel)
|
|||
{
|
||||
int group = subsector->sector->PortalGroup;
|
||||
DVector3 pos = light->PosRelative(group);
|
||||
float radius = light->GetRadius();
|
||||
float radius = light->GetRadius() + self->renderradius;
|
||||
double dx = pos.X - x;
|
||||
double dy = pos.Y - y;
|
||||
double dz = pos.Z - z;
|
||||
double distSquared = dx * dx + dy * dy + dz * dz;
|
||||
if (distSquared < radiusSquared + radius * radius) // Light and actor touches
|
||||
if (distSquared < radius * radius) // Light and actor touches
|
||||
{
|
||||
if (std::find(addedLights.begin(), addedLights.end(), light) == addedLights.end()) // Check if we already added this light from a different subsector
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue