Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 107 files). Show all
Unified · Split
| @@ -383,19 +383,21 @@ QVector<QUuid> EntityScriptingInterface::findEntitiesInBox(const glm::vec3& corn · 382 unmodified lines | |||
| 383 | return result; | 383 | return result; |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, const QScriptValue& entityIdsToInclude) { | 386 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, const QScriptValue& entityIdsToInclude, const QScriptValue& entityIdsToDiscard) { |
| 387 | QVector<EntityItemID> entities = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); | 387 | QVector<EntityItemID> entitiesToInclude = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); |
| 388 | return findRayIntersectionWorker(ray, Octree::TryLock, precisionPicking, entities); | 388 | QVector<EntityItemID> entitiesToDiscard = qVectorEntityItemIDFromScriptValue(entityIdsToDiscard); |
| 389 | return findRayIntersectionWorker(ray, Octree::TryLock, precisionPicking, entitiesToInclude, entitiesToDiscard); | ||
| 389 | } | 390 | } |
| 390 | 391 | ||
| 391 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking, const QScriptValue& entityIdsToInclude) { | 392 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking, const QScriptValue& entityIdsToInclude, const QScriptValue& entityIdsToDiscard) { |
| 392 | const QVector<EntityItemID>& entities = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); | 393 | const QVector<EntityItemID>& entitiesToInclude = qVectorEntityItemIDFromScriptValue(entityIdsToInclude); |
| 393 | return findRayIntersectionWorker(ray, Octree::Lock, precisionPicking, entities); | 394 | const QVector<EntityItemID> entitiesToDiscard = qVectorEntityItemIDFromScriptValue(entityIdsToDiscard); |
| 395 | return findRayIntersectionWorker(ray, Octree::Lock, precisionPicking, entitiesToInclude, entitiesToDiscard); | ||
| 394 | } | 396 | } |
| 395 | 397 | ||
| 396 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorker(const PickRay& ray, | 398 | RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorker(const PickRay& ray, |
| 397 | Octree::lockType lockType, | 399 | Octree::lockType lockType, |
| 398 | bool precisionPicking, const QVector<EntityItemID>& entityIdsToInclude) { | 400 | bool precisionPicking, const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIdsToDiscard) { |
| 399 | 401 | ||
| 400 | 402 | ||
| 401 | RayToEntityIntersectionResult result; | 403 | RayToEntityIntersectionResult result; |
| @@ -403,7 +405,7 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 1 unmodified line | |||
| 403 | OctreeElementPointer element; | 405 | OctreeElementPointer element; |
| 404 | EntityItemPointer intersectedEntity = NULL; | 406 | EntityItemPointer intersectedEntity = NULL; |
| 405 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, | 407 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, |
| 406 | result.surfaceNormal, entityIdsToInclude, (void**)&intersectedEntity, lockType, &result.accurate, | 408 | result.surfaceNormal, entityIdsToInclude, entityIdsToDiscard, (void**)&intersectedEntity, lockType, &result.accurate, |
| 407 | precisionPicking); | 409 | precisionPicking); |
| 408 | if (result.intersects && intersectedEntity) { | 410 | if (result.intersects && intersectedEntity) { |
| 409 | result.entityID = intersectedEntity->getEntityItemID(); | 411 | result.entityID = intersectedEntity->getEntityItemID(); |