CR and fix deadlock

This commit is contained in:
SamGondelman 2019-02-13 16:19:39 -08:00
parent b418e43ef2
commit 3f8bfc5475
6 changed files with 8 additions and 12 deletions

View file

@ -1900,11 +1900,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(pointerManager.data(), &PointerManager::triggerBeginOverlay, keyboardFocusOperator);
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
connect(entityScriptingInterface.data(), &EntityScriptingInterface::deletingEntity, [this](const EntityItemID& entityItemID) {
connect(entityScriptingInterface.data(), &EntityScriptingInterface::deletingEntity, this, [this](const EntityItemID& entityItemID) {
if (entityItemID == _keyboardFocusedEntity.get()) {
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
}
});
}, Qt::QueuedConnection);
EntityTree::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
if (_aboutToQuit) {

View file

@ -310,7 +310,7 @@ void StartEndRenderState::update(const glm::vec3& origin, const glm::vec3& end,
EntityItemProperties properties;
EntityPropertyFlags desiredProperties;
desiredProperties += PROP_DIMENSIONS;
glm::vec3 dim = entityScriptingInterface->getEntityProperties(getEndID(), desiredProperties).getDimensions();
glm::vec3 dim;
if (distanceScaleEnd) {
dim = getEndDim() * glm::distance(origin, end);
} else {

View file

@ -242,7 +242,7 @@ void PolyLineEntityRenderer::updateGeometry() {
binormal = glm::normalize(glm::cross(tangent, normal));
// Check to make sure binormal is not a NAN. If it is, don't add to vertices vector
if (binormal.x != binormal.x) {
if (glm::any(glm::isnan(binormal))) {
continue;
}
}

View file

@ -1927,7 +1927,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
properties.setProperty("localEntity", convertScriptValue(engine, getEntityHostType() == entity::HostType::LOCAL));
}
if ((!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::FaceCamera)) && _type != EntityTypes::PolyLine) {
if (_type != EntityTypes::PolyLine && (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::FaceCamera))) {
properties.setProperty("faceCamera", convertScriptValue(engine, getBillboardMode() == BillboardMode::YAW));
}
if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::IsFacingAvatar)) {

View file

@ -151,7 +151,7 @@ bool EntityTreeElement::checkFilterSettings(const EntityItemPointer& entity, Pic
// We only check the collidable filters for non-local entities, because local entities are always collisionless
bool collidable = !entity->getCollisionless() && (entity->getShapeType() != SHAPE_TYPE_NONE);
if (hostType != entity::HostType::LOCAL) {
if ((!searchFilter.doesPickCollidable() && collidable) || (!searchFilter.doesPickNonCollidable() && !collidable)) {
if ((collidable && !searchFilter.doesPickCollidable()) || (!collidable && !searchFilter.doesPickNonCollidable())) {
return false;
}
}

View file

@ -304,15 +304,11 @@ WebInputMode WebEntityItem::getInputMode() const {
}
void WebEntityItem::setShowKeyboardFocusHighlight(bool value) {
withWriteLock([&] {
_showKeyboardFocusHighlight = value;
});
_showKeyboardFocusHighlight = value;
}
bool WebEntityItem::getShowKeyboardFocusHighlight() const {
return resultWithReadLock<bool>([&] {
return _showKeyboardFocusHighlight;
});
return _showKeyboardFocusHighlight;
}
PulsePropertyGroup WebEntityItem::getPulseProperties() const {