History

Merge branch 'master' of https://github.com/highfidelity/hifi into certificate-properties

Howard Stearns committed 9 years ago

Commit 73c8da92 parents 58255ab fb5fd34348 files · +16454 −5861Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 348 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+28−16
@@ -47,6 +47,8 @@ EntityScriptingInterface::EntityScriptingInterface(bool bidOnSimulationOwnership · 46 unmodified lines
47 connect(nodeList.data(), &NodeList::isAllowedEditorChanged, this, &EntityScriptingInterface::canAdjustLocksChanged);47 connect(nodeList.data(), &NodeList::isAllowedEditorChanged, this, &EntityScriptingInterface::canAdjustLocksChanged);
48 connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptingInterface::canRezChanged);48 connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptingInterface::canRezChanged);
49 connect(nodeList.data(), &NodeList::canRezTmpChanged, this, &EntityScriptingInterface::canRezTmpChanged);49 connect(nodeList.data(), &NodeList::canRezTmpChanged, this, &EntityScriptingInterface::canRezTmpChanged);
50 connect(nodeList.data(), &NodeList::canRezCertifiedChanged, this, &EntityScriptingInterface::canRezCertifiedChanged);
51 connect(nodeList.data(), &NodeList::canRezTmpCertifiedChanged, this, &EntityScriptingInterface::canRezTmpCertifiedChanged);
50 connect(nodeList.data(), &NodeList::canWriteAssetsChanged, this, &EntityScriptingInterface::canWriteAssetsChanged);52 connect(nodeList.data(), &NodeList::canWriteAssetsChanged, this, &EntityScriptingInterface::canWriteAssetsChanged);
51}53}
52 54
@@ -76,6 +78,16 @@ bool EntityScriptingInterface::canRezTmp() { · 23 unmodified lines
76 return nodeList->getThisNodeCanRezTmp();78 return nodeList->getThisNodeCanRezTmp();
77}79}
78 80
81bool EntityScriptingInterface::canRezCertified() {
82 auto nodeList = DependencyManager::get<NodeList>();
83 return nodeList->getThisNodeCanRezCertified();
84}
85
86bool EntityScriptingInterface::canRezTmpCertified() {
87 auto nodeList = DependencyManager::get<NodeList>();
88 return nodeList->getThisNodeCanRezTmpCertified();
89}
90
79bool EntityScriptingInterface::canWriteAssets() {91bool EntityScriptingInterface::canWriteAssets() {
80 auto nodeList = DependencyManager::get<NodeList>();92 auto nodeList = DependencyManager::get<NodeList>();
81 return nodeList->getThisNodeCanWriteAssets();93 return nodeList->getThisNodeCanWriteAssets();
@@ -659,22 +671,22 @@ QVector<QUuid> EntityScriptingInterface::findEntitiesInFrustum(QVariantMap frust · 577 unmodified lines
659}671}
660 672
661QVector<QUuid> EntityScriptingInterface::findEntitiesByType(const QString entityType, const glm::vec3& center, float radius) const {673QVector<QUuid> EntityScriptingInterface::findEntitiesByType(const QString entityType, const glm::vec3& center, float radius) const {
662 EntityTypes::EntityType type = EntityTypes::getEntityTypeFromName(entityType);674 EntityTypes::EntityType type = EntityTypes::getEntityTypeFromName(entityType);
663 675
664 QVector<QUuid> result;676 QVector<QUuid> result;
665 if (_entityTree) {677 if (_entityTree) {
666 QVector<EntityItemPointer> entities;678 QVector<EntityItemPointer> entities;
667 _entityTree->withReadLock([&] {679 _entityTree->withReadLock([&] {
668 _entityTree->findEntities(center, radius, entities);680 _entityTree->findEntities(center, radius, entities);
669 });681 });
670 682
671 foreach(EntityItemPointer entity, entities) {683 foreach(EntityItemPointer entity, entities) {
672 if (entity->getType() == type) {684 if (entity->getType() == type) {
673 result << entity->getEntityItemID();685 result << entity->getEntityItemID();
674 }686 }
675 }687 }
676 }688 }
677 return result;689 return result;
678}690}
679 691
680RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking, 692RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersection(const PickRay& ray, bool precisionPicking,