Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 100 files). Show all
Unified · Split
| @@ -819,13 +819,12 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 818 unmodified lines | ||
| 819 | 819 | RayToEntityIntersectionResult result; |
| 820 | 820 | if (_entityTree) { |
| 821 | 821 | OctreeElementPointer element; |
| 822 | − EntityItemPointer intersectedEntity = NULL; | |
| 823 | − result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, | |
| 822 | + result.entityID = _entityTree->findRayIntersection(ray.origin, ray.direction, | |
| 824 | 823 | entityIdsToInclude, entityIdsToDiscard, visibleOnly, collidableOnly, precisionPicking, |
| 825 | 824 | element, result.distance, result.face, result.surfaceNormal, |
| 826 | − (void**)&intersectedEntity, lockType, &result.accurate); | |
| 827 | − if (result.intersects && intersectedEntity) { | |
| 828 | − result.entityID = intersectedEntity->getEntityItemID(); | |
| 825 | + result.extraInfo, lockType, &result.accurate); | |
| 826 | + result.intersects = !result.entityID.isNull(); | |
| 827 | + if (result.intersects) { | |
| 829 | 828 | result.intersection = ray.origin + (ray.direction * result.distance); |
| 830 | 829 | } |
| 831 | 830 | } |
| @@ -991,8 +990,7 @@ RayToEntityIntersectionResult::RayToEntityIntersectionResult() : · 159 unmodified lines | ||
| 991 | 990 | accurate(true), // assume it's accurate |
| 992 | 991 | entityID(), |
| 993 | 992 | distance(0), |
| 994 | − face(), | |
| 995 | − entity(NULL) | |
| 993 | + face() | |
| 996 | 994 | { |
| 997 | 995 | } |
| 998 | 996 | |
| @@ -1039,6 +1037,7 @@ QScriptValue RayToEntityIntersectionResultToScriptValue(QScriptEngine* engine, c · 40 unmodified lines | ||
| 1039 | 1037 | |
| 1040 | 1038 | QScriptValue surfaceNormal = vec3toScriptValue(engine, value.surfaceNormal); |
| 1041 | 1039 | obj.setProperty("surfaceNormal", surfaceNormal); |
| 1040 | + obj.setProperty("extraInfo", engine->toScriptValue(value.extraInfo)); | |
| 1042 | 1041 | return obj; |
| 1043 | 1042 | } |
| 1044 | 1043 | |
| @@ -1074,6 +1073,7 @@ void RayToEntityIntersectionResultFromScriptValue(const QScriptValue& object, Ra · 29 unmodified lines | ||
| 1074 | 1073 | if (surfaceNormal.isValid()) { |
| 1075 | 1074 | vec3FromScriptValue(surfaceNormal, value.surfaceNormal); |
| 1076 | 1075 | } |
| 1076 | + value.extraInfo = object.property("extraInfo").toVariant().toMap(); | |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | bool EntityScriptingInterface::polyVoxWorker(QUuid entityID, std::function<bool(PolyVoxEntityItem&)> actor) { |