mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 21:45:15 +02:00
Fixed ray intersections with Local entities.
Previously, rays *always* intersected with Local entities, regardless of whether the pick filter requested to hit on collidable or noncollidable entities. But Local entities are always collisionless, so a pick filter for collidable entities shouldn't intersect with Local entities.
This commit is contained in:
parent
8ff47659d3
commit
81f28b3b2c
1 changed files with 13 additions and 6 deletions
|
@ -148,13 +148,20 @@ 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);
|
||||
if (hostType != entity::HostType::LOCAL) {
|
||||
if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool collidable;
|
||||
if (hostType == entity::HostType::LOCAL) {
|
||||
// Local entities are always collisionless
|
||||
collidable = false;
|
||||
}
|
||||
else {
|
||||
collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
|
||||
}
|
||||
|
||||
if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue