mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 17:23:29 +02:00
fix picks vs. local entities
This commit is contained in:
parent
834e44dd3a
commit
57ee9786af
1 changed files with 11 additions and 5 deletions
|
@ -141,14 +141,20 @@ bool EntityTreeElement::bestFitBounds(const glm::vec3& minPoint, const glm::vec3
|
||||||
|
|
||||||
bool checkFilterSettings(const EntityItemPointer& entity, PickFilter searchFilter) {
|
bool checkFilterSettings(const EntityItemPointer& entity, PickFilter searchFilter) {
|
||||||
bool visible = entity->isVisible();
|
bool visible = entity->isVisible();
|
||||||
bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
|
entity::HostType hostType = entity->getEntityHostType();
|
||||||
if ((!searchFilter.doesPickVisible() && visible) || (!searchFilter.doesPickInvisible() && !visible) ||
|
if ((!searchFilter.doesPickVisible() && visible) || (!searchFilter.doesPickInvisible() && !visible) ||
|
||||||
(!searchFilter.doesPickCollidable() && collidable) || (!searchFilter.doesPickNonCollidable() && !collidable) ||
|
(!searchFilter.doesPickDomainEntities() && hostType == entity::HostType::DOMAIN) ||
|
||||||
(!searchFilter.doesPickDomainEntities() && entity->isDomainEntity()) ||
|
(!searchFilter.doesPickAvatarEntities() && hostType == entity::HostType::AVATAR) ||
|
||||||
(!searchFilter.doesPickAvatarEntities() && entity->isAvatarEntity()) ||
|
(!searchFilter.doesPickLocalEntities() && hostType == entity::HostType::LOCAL)) {
|
||||||
(!searchFilter.doesPickLocalEntities() && entity->isLocalEntity())) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// We only check the collidable filters for non-local entities, because local entities are always collisionless
|
||||||
|
bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
|
||||||
|
if (hostType != entity::HostType::LOCAL) {
|
||||||
|
if ((!searchFilter.doesPickCollidable() && collidable) || (!searchFilter.doesPickNonCollidable() && !collidable)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue