Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 12 files). Show all
Unified · Split
| @@ -610,11 +610,11 @@ QVector<QUuid> EntityScriptingInterface::findEntitiesInFrustum(QVariantMap frust · 609 unmodified lines | |||
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, | 612 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, |
| 613 | const QScriptValue& entityIdsToInclude, const QScriptValue& entityIdsToDiscard) { | 613 | const QScriptValue& entityIdsToInclude, const QScriptValue& entityIdsToDiscard, bool visibleOnly) { |
| 614 | 614 | ||
| 615 | QVector<EntityItemID> entitiesToInclude = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); | 615 | QVector<EntityItemID> entitiesToInclude = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); |
| 616 | QVector<EntityItemID> entitiesToDiscard = qVectorEntityItemIDFromScriptValue(entityIdsToDiscard); | 616 | QVector<EntityItemID> entitiesToDiscard = qVectorEntityItemIDFromScriptValue(entityIdsToDiscard); |
| 617 | return findRayIntersectionWorker(ray, Octree::Lock, precisionPicking, entitiesToInclude, entitiesToDiscard); | 617 | return findRayIntersectionWorker(ray, Octree::Lock, precisionPicking, entitiesToInclude, entitiesToDiscard, visibleOnly); |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | // FIXME - we should remove this API and encourage all users to use findRayIntersection() instead. We've changed | 620 | // FIXME - we should remove this API and encourage all users to use findRayIntersection() instead. We've changed |
| @@ -630,7 +630,7 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionBlock · 9 unmodified lines | |||
| 630 | 630 | ||
| 631 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorker(const PickRay& ray, | 631 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorker(const PickRay& ray, |
| 632 | Octree::lockType lockType, | 632 | Octree::lockType lockType, |
| 633 | bool precisionPicking, const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIdsToDiscard) { | 633 | bool precisionPicking, const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly) { |
| 634 | 634 | ||
| 635 | 635 | ||
| 636 | RayToEntityIntersectionResult result; | 636 | RayToEntityIntersectionResult result; |
| @@ -638,7 +638,7 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 1 unmodified line | |||
| 638 | OctreeElementPointer element; | 638 | OctreeElementPointer element; |
| 639 | EntityItemPointer intersectedEntity = NULL; | 639 | EntityItemPointer intersectedEntity = NULL; |
| 640 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, | 640 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, |
| 641 | result.surfaceNormal, entityIdsToInclude, entityIdsToDiscard, (void**)&intersectedEntity, lockType, &result.accurate, | 641 | result.surfaceNormal, entityIdsToInclude, entityIdsToDiscard, visibleOnly, (void**)&intersectedEntity, lockType, &result.accurate, |
| 642 | precisionPicking); | 642 | precisionPicking); |
| 643 | if (result.intersects && intersectedEntity) { | 643 | if (result.intersects && intersectedEntity) { |
| 644 | result.entityID = intersectedEntity->getEntityItemID(); | 644 | result.entityID = intersectedEntity->getEntityItemID(); |