mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +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 visible = entity->isVisible();
|
||||
bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
|
||||
entity::HostType hostType = entity->getEntityHostType();
|
||||
if ((!searchFilter.doesPickVisible() && visible) || (!searchFilter.doesPickInvisible() && !visible) ||
|
||||
(!searchFilter.doesPickCollidable() && collidable) || (!searchFilter.doesPickNonCollidable() && !collidable) ||
|
||||
(!searchFilter.doesPickDomainEntities() && entity->isDomainEntity()) ||
|
||||
(!searchFilter.doesPickAvatarEntities() && entity->isAvatarEntity()) ||
|
||||
(!searchFilter.doesPickLocalEntities() && entity->isLocalEntity())) {
|
||||
(!searchFilter.doesPickDomainEntities() && hostType == entity::HostType::DOMAIN) ||
|
||||
(!searchFilter.doesPickAvatarEntities() && hostType == entity::HostType::AVATAR) ||
|
||||
(!searchFilter.doesPickLocalEntities() && hostType == entity::HostType::LOCAL)) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue