Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 44 files). Show all
Unified · Split
| @@ -778,13 +778,12 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 777 unmodified lines | ||
| 778 | 778 | RayToEntityIntersectionResult result; |
| 779 | 779 | if (_entityTree) { |
| 780 | 780 | OctreeElementPointer element; |
| 781 | − EntityItemPointer intersectedEntity = NULL; | |
| 782 | − result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, | |
| 781 | + result.entityID = _entityTree->findRayIntersection(ray.origin, ray.direction, | |
| 783 | 782 | entityIdsToInclude, entityIdsToDiscard, visibleOnly, collidableOnly, precisionPicking, |
| 784 | 783 | element, result.distance, result.face, result.surfaceNormal, |
| 785 | − (void**)&intersectedEntity, lockType, &result.accurate); | |
| 786 | − if (result.intersects && intersectedEntity) { | |
| 787 | − result.entityID = intersectedEntity->getEntityItemID(); | |
| 784 | + result.extraInfo, lockType, &result.accurate); | |
| 785 | + result.intersects = !result.entityID.isNull(); | |
| 786 | + if (result.intersects) { | |
| 788 | 787 | result.intersection = ray.origin + (ray.direction * result.distance); |
| 789 | 788 | } |
| 790 | 789 | } |
| @@ -950,8 +949,7 @@ RayToEntityIntersectionResult::RayToEntityIntersectionResult() : · 159 unmodified lines | ||
| 950 | 949 | accurate(true), // assume it's accurate |
| 951 | 950 | entityID(), |
| 952 | 951 | distance(0), |
| 953 | − face(), | |
| 954 | − entity(NULL) | |
| 952 | + face() | |
| 955 | 953 | { |
| 956 | 954 | } |
| 957 | 955 | |
| @@ -998,6 +996,7 @@ QScriptValue RayToEntityIntersectionResultToScriptValue(QScriptEngine* engine, c · 40 unmodified lines | ||
| 998 | 996 | |
| 999 | 997 | QScriptValue surfaceNormal = vec3toScriptValue(engine, value.surfaceNormal); |
| 1000 | 998 | obj.setProperty("surfaceNormal", surfaceNormal); |
| 999 | + obj.setProperty("extraInfo", engine->toScriptValue(value.extraInfo)); | |
| 1001 | 1000 | return obj; |
| 1002 | 1001 | } |
| 1003 | 1002 | |
| @@ -1033,6 +1032,7 @@ void RayToEntityIntersectionResultFromScriptValue(const QScriptValue& object, Ra · 29 unmodified lines | ||
| 1033 | 1032 | if (surfaceNormal.isValid()) { |
| 1034 | 1033 | vec3FromScriptValue(surfaceNormal, value.surfaceNormal); |
| 1035 | 1034 | } |
| 1035 | + value.extraInfo = object.property("extraInfo").toVariant().toMap(); | |
| 1036 | 1036 | } |
| 1037 | 1037 | |
| 1038 | 1038 | bool EntityScriptingInterface::polyVoxWorker(QUuid entityID, std::function<bool(PolyVoxEntityItem&)> actor) { |