diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 568b492b46..be5256f95a 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -3889,7 +3889,8 @@ bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& bette // See https://highfidelity.fogbugz.com/f/cases/5003/findRayIntersection-has-option-to-use-collidableOnly-but-doesn-t-actually-use-colliders QVariantMap extraInfo; EntityItemID entityID = entityTree->evalRayIntersection(startPointIn, directionIn, include, ignore, - PickFilter(PickFilter::getBitMask(PickFilter::FlagBit::COLLIDABLE) | PickFilter::getBitMask(PickFilter::FlagBit::PRECISE)), + PickFilter(PickFilter::getBitMask(PickFilter::FlagBit::COLLIDABLE) | PickFilter::getBitMask(PickFilter::FlagBit::PRECISE) + | PickFilter::getBitMask(PickFilter::FlagBit::DOMAIN_ENTITIES) | PickFilter::getBitMask(PickFilter::FlagBit::AVATAR_ENTITIES)), // exclude Local entities element, distance, face, normalOut, extraInfo, lockType, accurateResult); if (entityID.isNull()) { return false; diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index aab98adb52..60eaafc0dd 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -148,9 +148,13 @@ bool EntityTreeElement::checkFilterSettings(const EntityItemPointer& entity, Pic (!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); + // We only check the collidable filters for non-local entities, because local entities are always collisionless, + // but picks always include COLLIDABLE (see PickScriptingInterface::getPickFilter()), so if we were to respect + // the getCollisionless() property of Local entities then we would *never* intersect them in a pick. + // An unfortunate side effect of the following code is that Local entities are intersected even if the + // pick explicitly requested only COLLIDABLE entities (but, again, Local entities are always collisionless). if (hostType != entity::HostType::LOCAL) { + bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE); if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) { return false; }