add _nofill key, which causes an entity to not count as an entity for the purposes of occupancy (for lights in walls, etc)
add _nonudge key, to disabling nudging of lights "stuck" inside walls
This commit is contained in:
parent
6451a3f2aa
commit
d5e29a1c90
|
|
@ -101,6 +101,7 @@ public:
|
||||||
settings::setting_int32 surflight_group;
|
settings::setting_int32 surflight_group;
|
||||||
settings::setting_int32 light_channel_mask;
|
settings::setting_int32 light_channel_mask;
|
||||||
settings::setting_int32 shadow_channel_mask;
|
settings::setting_int32 shadow_channel_mask;
|
||||||
|
settings::setting_bool nonudge;
|
||||||
|
|
||||||
light_t();
|
light_t();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,8 @@ light_t::light_t() :
|
||||||
nostaticlight{this, "nostaticlight", false},
|
nostaticlight{this, "nostaticlight", false},
|
||||||
surflight_group{this, "surflight_group", 0},
|
surflight_group{this, "surflight_group", 0},
|
||||||
light_channel_mask{this, "light_channel_mask", CHANNEL_MASK_DEFAULT},
|
light_channel_mask{this, "light_channel_mask", CHANNEL_MASK_DEFAULT},
|
||||||
shadow_channel_mask{this, "shadow_channel_mask", CHANNEL_MASK_DEFAULT}
|
shadow_channel_mask{this, "shadow_channel_mask", CHANNEL_MASK_DEFAULT},
|
||||||
|
nonudge{this, "nonudge", false}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::string light_t::classname() const
|
std::string light_t::classname() const
|
||||||
|
|
@ -1021,7 +1022,7 @@ static qvec3d FixLightOnFace(const mbsp_t *bsp, const qvec3d &point)
|
||||||
void FixLightsOnFaces(const mbsp_t *bsp)
|
void FixLightsOnFaces(const mbsp_t *bsp)
|
||||||
{
|
{
|
||||||
for (auto &entity : all_lights) {
|
for (auto &entity : all_lights) {
|
||||||
if (entity->light.value() != 0) {
|
if (entity->light.value() != 0 && !entity->nonudge.value()) {
|
||||||
entity->origin.setValue(FixLightOnFace(bsp, entity->origin.value()), settings::source::MAP);
|
entity->origin.setValue(FixLightOnFace(bsp, entity->origin.value()), settings::source::MAP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -322,11 +322,10 @@ static void MarkOccupiedClusters(node_t *headnode)
|
||||||
if (qv::epsilonEmpty(entity.origin, QBSP_EQUAL_EPSILON))
|
if (qv::epsilonEmpty(entity.origin, QBSP_EQUAL_EPSILON))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if 0
|
// skip nofill entities
|
||||||
/* skip lights */
|
if (entity.epairs.has("_nofill") && entity.epairs.get_int("_nofill")) {
|
||||||
if (strcmp(ValueForKey(entity, "classname"), "light") == 0)
|
|
||||||
continue;
|
continue;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* find the leaf it's in. Skip opqaue leafs */
|
/* find the leaf it's in. Skip opqaue leafs */
|
||||||
node_t *cluster = PointInLeaf(headnode, entity.origin);
|
node_t *cluster = PointInLeaf(headnode, entity.origin);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue