mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:58:56 +02:00
Merge pull request #15282 from kitely/fix-ray-local-entities
Case 21883: Fix safe landing code improperly finding local entities
This commit is contained in:
commit
c33efdf9e0
2 changed files with 8 additions and 3 deletions
|
@ -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
|
// See https://highfidelity.fogbugz.com/f/cases/5003/findRayIntersection-has-option-to-use-collidableOnly-but-doesn-t-actually-use-colliders
|
||||||
QVariantMap extraInfo;
|
QVariantMap extraInfo;
|
||||||
EntityItemID entityID = entityTree->evalRayIntersection(startPointIn, directionIn, include, ignore,
|
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);
|
element, distance, face, normalOut, extraInfo, lockType, accurateResult);
|
||||||
if (entityID.isNull()) {
|
if (entityID.isNull()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -148,9 +148,13 @@ bool EntityTreeElement::checkFilterSettings(const EntityItemPointer& entity, Pic
|
||||||
(!searchFilter.doesPickLocalEntities() && hostType == entity::HostType::LOCAL)) {
|
(!searchFilter.doesPickLocalEntities() && hostType == entity::HostType::LOCAL)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// We only check the collidable filters for non-local entities, because local entities are always collisionless
|
// 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);
|
// 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) {
|
if (hostType != entity::HostType::LOCAL) {
|
||||||
|
bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
|
||||||
if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) {
|
if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue