mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
Completely remove dynamic lights
This commit is contained in:
parent
2b8a26d4d7
commit
d2fbcccd01
10 changed files with 9 additions and 264 deletions
28
vendor/librw/src/world.cpp
vendored
28
vendor/librw/src/world.cpp
vendored
|
|
@ -144,9 +144,6 @@ World::enumerateLights(Atomic *atomic, WorldLights *lightData)
|
|||
{
|
||||
int32 maxDirectionals, maxLocals;
|
||||
|
||||
maxDirectionals = lightData->numDirectionals;
|
||||
maxLocals = lightData->numLocals;
|
||||
|
||||
lightData->numDirectionals = 0;
|
||||
lightData->numLocals = 0;
|
||||
lightData->numAmbients = 0;
|
||||
|
|
@ -166,33 +163,8 @@ World::enumerateLights(Atomic *atomic, WorldLights *lightData)
|
|||
lightData->ambient.green += l->color.green;
|
||||
lightData->ambient.blue += l->color.blue;
|
||||
lightData->numAmbients++;
|
||||
}else if(normals && l->getType() == Light::DIRECTIONAL){
|
||||
if(lightData->numDirectionals < maxDirectionals)
|
||||
lightData->directionals[lightData->numDirectionals++] = l;
|
||||
}
|
||||
}
|
||||
|
||||
if(atomic->world != this)
|
||||
return;
|
||||
|
||||
if(!normals)
|
||||
return;
|
||||
|
||||
Sphere *atomsphere = atomic->getWorldBoundingSphere();
|
||||
// TODO: for this we would use an atomic's world sectors, but we don't have those yet
|
||||
FORLIST(lnk, this->localLights){
|
||||
if(lightData->numLocals >= maxLocals)
|
||||
return;
|
||||
|
||||
Light *l = Light::fromWorld(lnk);
|
||||
if((l->getFlags() & Light::LIGHTATOMICS) == 0)
|
||||
continue;
|
||||
|
||||
// check if spheres are intersecting
|
||||
V3d dist = sub(l->getFrame()->getLTM()->pos, atomsphere->center);
|
||||
if(length(dist) < atomsphere->radius + l->radius)
|
||||
lightData->locals[lightData->numLocals++] = l;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue