From dde7fbdfce1cfbf74494773652fbea0db260b1b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Dec 2018 19:58:35 -0800 Subject: [PATCH] how did these happen --- .../entities/src/EntityItemProperties.cpp | 14 ++++---- .../entities/src/EntityScriptingInterface.cpp | 31 ------------------ .../entities/src/EntityScriptingInterface.h | 32 ++----------------- 3 files changed, 10 insertions(+), 67 deletions(-) diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 5616d04ea4..229e5068d0 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -2436,19 +2436,19 @@ bool EntityItemProperties::getPropertyInfo(const QString& propertyName, EntityPr ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_TRIGGERABLE, Grab, grab, Triggerable, triggerable); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_EQUIPPABLE, Grab, grab, Equippable, equippable); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_LEFT_EQUIPPABLE_POSITION_OFFSET, Grab, grab, - EquippableLeftPosition, equippableLeftPosition); + EquippableLeftPosition, equippableLeftPosition); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_LEFT_EQUIPPABLE_ROTATION_OFFSET, Grab, grab, - EquippableLeftRotation, equippableLeftRotation); + EquippableLeftRotation, equippableLeftRotation); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_RIGHT_EQUIPPABLE_POSITION_OFFSET, Grab, grab, - EquippableRightPosition, equippableRightPosition); + EquippableRightPosition, equippableRightPosition); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_RIGHT_EQUIPPABLE_ROTATION_OFFSET, Grab, grab, - EquippableRightRotation, equippableRightRotation); + EquippableRightRotation, equippableRightRotation); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_EQUIPPABLE_INDICATOR_URL, Grab, grab, - EquippableIndicatorURL, equippableIndicatorURL); + EquippableIndicatorURL, equippableIndicatorURL); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_EQUIPPABLE_INDICATOR_SCALE, Grab, grab, - EquippableIndicatorScale, equippableIndicatorScale); + EquippableIndicatorScale, equippableIndicatorScale); ADD_GROUP_PROPERTY_TO_MAP(PROP_GRAB_EQUIPPABLE_INDICATOR_OFFSET, Grab, grab, - EquippableIndicatorOffset, equippableIndicatorOffset); + EquippableIndicatorOffset, equippableIndicatorOffset); ADD_PROPERTY_TO_MAP(PROP_IMAGE_URL, ImageURL, imageURL, QString); ADD_PROPERTY_TO_MAP(PROP_EMISSIVE, Emissive, emissive, bool); diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index f9f1cb0a06..314604a9da 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -1193,12 +1193,6 @@ QVector EntityScriptingInterface::findEntitiesByType(const QString entity _entityTree->withReadLock([&] { _entityTree->evalEntitiesInSphereWithType(center, radius, type, PickFilter(searchFilter), result); }); - - foreach(EntityItemPointer entity, entities) { - if (entity->getType() == type) { - result << entity->getEntityItemID().toString(); - } - } } return result; } @@ -1210,24 +1204,6 @@ QVector EntityScriptingInterface::findEntitiesByName(const QString entity unsigned int searchFilter = PickFilter::getBitMask(PickFilter::FlagBit::DOMAIN_ENTITIES) | PickFilter::getBitMask(PickFilter::FlagBit::AVATAR_ENTITIES); _entityTree->evalEntitiesInSphereWithName(center, radius, entityName, caseSensitiveSearch, PickFilter(searchFilter), result); }); - - if (caseSensitiveSearch) { - foreach(EntityItemPointer entity, entities) { - if (entity->getName() == entityName) { - result << entity->getEntityItemID(); - } - } - - } else { - QString entityNameLowerCase = entityName.toLower(); - - foreach(EntityItemPointer entity, entities) { - QString entityItemLowerCase = entity->getName().toLower(); - if (entityItemLowerCase == entityNameLowerCase) { - result << entity->getEntityItemID(); - } - } - } } return result; } @@ -1262,13 +1238,6 @@ RayToEntityIntersectionResult EntityScriptingInterface::evalRayIntersectionVecto return evalRayIntersectionWorker(ray, Octree::Lock, searchFilter, entityIdsToInclude, entityIdsToDiscard); } -RayToEntityIntersectionResult EntityScriptingInterface::evalRayIntersectionVector(const PickRay& ray, PickFilter searchFilter, - const QVector& entityIdsToInclude, const QVector& entityIdsToDiscard) { - PROFILE_RANGE(script_entities, __FUNCTION__); - - return evalRayIntersectionWorker(ray, Octree::Lock, searchFilter, entityIdsToInclude, entityIdsToDiscard); -} - RayToEntityIntersectionResult EntityScriptingInterface::evalRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType, PickFilter searchFilter, const QVector& entityIdsToInclude, const QVector& entityIdsToDiscard) const { diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 389b5e629b..7b8378f6ce 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -427,7 +427,7 @@ public slots: * @function Entities.findEntitiesInBox * @param {Vec3} corner - The corner of the search AA box with minimum co-ordinate values. * @param {Vec3} dimensions - The dimensions of the search AA box. - * @returns {Uuid[]} An array of entity IDs whose AA boxes intersect the search AA box. The array is empty if no entities + * @returns {Uuid[]} An array of entity IDs whose AA boxes intersect the search AA box. The array is empty if no entities * could be found. */ /// this function will not find any models in script engine contexts which don't have access to models @@ -438,7 +438,7 @@ public slots: * @function Entities.findEntitiesInFrustum * @param {ViewFrustum} frustum - The frustum to search in. The position, orientation, * projection, and centerRadius properties must be specified. - * @returns {Uuid[]} An array of entity IDs axis-aligned boxes intersect the frustum. The array is empty if no entities + * @returns {Uuid[]} An array of entity IDs axis-aligned boxes intersect the frustum. The array is empty if no entities * could be found. * @example Report the number of entities in view. * var entityIDs = Entities.findEntitiesInFrustum(Camera.frustum); @@ -453,7 +453,7 @@ public slots: * @param {Entities.EntityType} entityType - The type of entity to search for. * @param {Vec3} center - The point about which to search. * @param {number} radius - The radius within which to search. - * @returns {Uuid[]} An array of entity IDs of the specified type that intersect the search sphere. The array is empty if + * @returns {Uuid[]} An array of entity IDs of the specified type that intersect the search sphere. The array is empty if * no entities could be found. * @example Report the number of Model entities within 10m of your avatar. * var entityIDs = Entities.findEntitiesByType("Model", MyAvatar.position, 10); @@ -513,32 +513,6 @@ public slots: const QScriptValue& entityIdsToInclude = QScriptValue(), const QScriptValue& entityIdsToDiscard = QScriptValue(), bool visibleOnly = false, bool collidableOnly = false) const; - /// Same as above but with QVectors - RayToEntityIntersectionResult findRayIntersectionVector(const PickRay& ray, bool precisionPicking, - const QVector& entityIdsToInclude, const QVector& entityIdsToDiscard, - bool visibleOnly, bool collidableOnly); - - /**jsdoc - * Find the first entity intersected by a {@link PickRay}. Light and Zone entities are not - * intersected unless they've been configured as pickable using {@link Entities.setLightsArePickable|setLightsArePickable} - * and {@link Entities.setZonesArePickable|setZonesArePickable}, respectively.
- * This is a synonym for {@link Entities.findRayIntersection|findRayIntersection}. - * @function Entities.findRayIntersectionBlocking - * @param {PickRay} pickRay - The PickRay to use for finding entities. - * @param {boolean} [precisionPicking=false] - If true and the intersected entity is a Model - * entity, the result's extraInfo property includes more information than it otherwise would. - * @param {Uuid[]} [entitiesToInclude=[]] - If not empty then the search is restricted to these entities. - * @param {Uuid[]} [entitiesToDiscard=[]] - Entities to ignore during the search. - * @deprecated This function is deprecated and will soon be removed. Use - * {@link Entities.findRayIntersection|findRayIntersection} instead; it blocks and performs the same function. - */ - /// If the scripting context has visible entities, this will determine a ray intersection, and will block in - /// order to return an accurate result - Q_INVOKABLE RayToEntityIntersectionResult findRayIntersectionBlocking(const PickRay& ray, bool precisionPicking = false, - const QScriptValue& entityIdsToInclude = QScriptValue(), const QScriptValue& entityIdsToDiscard = QScriptValue()); - ->>>>>>> property range audit - add range info via macros accessible via API, tweak min/max/steps in entityProperties - /**jsdoc * Reloads an entity's server entity script such that the latest version re-downloaded. * @function Entities.reloadServerScripts