@@ -197,6 +197,13 @@ EntityItemID EntityTreeElement::evalDetailedRayIntersection(const glm::vec3& ori
197197 // only called if we do intersect our bounding cube, but find if we actually intersect with entities...
198198 EntityItemID entityID;
199199 forEachEntity ([&](EntityItemPointer entity) {
200+ EntityTypes::EntityType type = entity->getType ();
201+ if (type == EntityTypes::ParticleEffect || type == EntityTypes::ProceduralParticleEffect || type == EntityTypes::Line ||
202+ type == EntityTypes::PolyLine || type == EntityTypes::Sound || type == EntityTypes::Script || type == EntityTypes::Empty ||
203+ (type == EntityTypes::Material && !entity->getParentID ().isNull ())) {
204+ return ;
205+ }
206+
200207 if (entity->getIgnorePickIntersection () && !searchFilter.bypassIgnore ()) {
201208 return ;
202209 }
@@ -257,9 +264,7 @@ EntityItemID EntityTreeElement::evalDetailedRayIntersection(const glm::vec3& ori
257264 }
258265 } else {
259266 // if the entity type doesn't support a detailed intersection, then just return the non-AABox results
260- // Never intersect with particle or sound entities
261- if (localDistance < distance && (entity->getType () != EntityTypes::ParticleEffect && entity->getType () != EntityTypes::ProceduralParticleEffect &&
262- entity->getType () != EntityTypes::Sound && entity->getType () != EntityTypes::Script)) {
267+ if (localDistance < distance) {
263268 distance = localDistance;
264269 face = localFace;
265270 surfaceNormal = glm::vec3 (rotation * glm::vec4 (localSurfaceNormal, 0 .0f ));
@@ -344,6 +349,13 @@ EntityItemID EntityTreeElement::evalDetailedParabolaIntersection(const glm::vec3
344349 // only called if we do intersect our bounding cube, but find if we actually intersect with entities...
345350 EntityItemID entityID;
346351 forEachEntity ([&](EntityItemPointer entity) {
352+ EntityTypes::EntityType type = entity->getType ();
353+ if (type == EntityTypes::ParticleEffect || type == EntityTypes::ProceduralParticleEffect || type == EntityTypes::Line ||
354+ type == EntityTypes::PolyLine || type == EntityTypes::Sound || type == EntityTypes::Script ||
355+ type == EntityTypes::Empty || (type == EntityTypes::Material && !entity->getParentID ().isNull ())) {
356+ return ;
357+ }
358+
347359 if (entity->getIgnorePickIntersection () && !searchFilter.bypassIgnore ()) {
348360 return ;
349361 }
@@ -410,9 +422,7 @@ EntityItemID EntityTreeElement::evalDetailedParabolaIntersection(const glm::vec3
410422 }
411423 } else {
412424 // if the entity type doesn't support a detailed intersection, then just return the non-AABox results
413- // Never intersect with particle or sound entities
414- if (localDistance < parabolicDistance && (entity->getType () != EntityTypes::ParticleEffect && entity->getType () != EntityTypes::ProceduralParticleEffect &&
415- entity->getType () != EntityTypes::Sound && entity->getType () != EntityTypes::Script)) {
425+ if (localDistance < parabolicDistance) {
416426 parabolicDistance = localDistance;
417427 face = localFace;
418428 surfaceNormal = glm::vec3 (rotation * glm::vec4 (localSurfaceNormal, 0 .0f ));
0 commit comments