Merge branch 'master' of https://github.com/highfidelity/hifi into blue

This commit is contained in:
Sam Gateau 2017-09-28 19:31:20 -07:00
commit 3562a4be96
5 changed files with 24 additions and 12 deletions

View file

@ -278,9 +278,10 @@ Transform Line3DOverlay::evalRenderTransform() {
auto endPos = getEnd();
auto vec = endPos - transform.getTranslation();
auto scale = glm::length(vec);
const float MIN_LINE_LENGTH = 0.0001f;
auto scale = glm::max(glm::length(vec), MIN_LINE_LENGTH);
auto dir = vec / scale;
auto orientation = glm::rotation(glm::vec3(0,0,-1), dir);
auto orientation = glm::rotation(glm::vec3(0.0f, 0.0f, -1.0f), dir);
transform.setRotation(orientation);
transform.setScale(scale);

View file

@ -45,7 +45,19 @@ void Volume3DOverlay::setProperties(const QVariantMap& properties) {
}
if (dimensions.isValid()) {
setDimensions(vec3FromVariant(dimensions));
glm::vec3 scale = vec3FromVariant(dimensions);
// don't allow a zero or negative dimension component to reach the renderTransform
const float MIN_DIMENSION = 0.0001f;
if (scale.x < MIN_DIMENSION) {
scale.x = MIN_DIMENSION;
}
if (scale.y < MIN_DIMENSION) {
scale.y = MIN_DIMENSION;
}
if (scale.z < MIN_DIMENSION) {
scale.z = MIN_DIMENSION;
}
setDimensions(scale);
}
}

View file

@ -1148,11 +1148,8 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
} else if (!senderNode->getCanRez() && !senderNode->getCanRezTmp()) {
failedAdd = true;
qCDebug(entities) << "User without 'rez rights' [" << senderNode->getUUID()
<< "] attempted to add an entity ID:" << entityItemID;
// FIXME after Cert ID property integrated
} else if (/*!properties.getCertificateID().isNull() && */!senderNode->getCanRezCertified() && !senderNode->getCanRezTmpCertified()) {
qCDebug(entities) << "User without 'certified rez rights' [" << senderNode->getUUID()
<< "] attempted to add a certified entity with ID:" << entityItemID;
<< "] attempted to add an entity ID:" << entityItemID;
} else {
// this is a new entity... assign a new entityID
properties.setCreated(properties.getLastEdited());

View file

@ -306,7 +306,7 @@ Grabber.prototype.computeNewGrabPlane = function() {
};
Grabber.prototype.pressEvent = function(event) {
if (isInEditMode()) {
if (isInEditMode() || HMD.active) {
return;
}
@ -401,7 +401,7 @@ Grabber.prototype.pressEvent = function(event) {
};
Grabber.prototype.releaseEvent = function(event) {
if (event.isLeftButton!==true || event.isRightButton===true || event.isMiddleButton===true) {
if ((event.isLeftButton!==true || event.isRightButton===true || event.isMiddleButton===true) && !HMD.active) {
return;
}
@ -447,7 +447,7 @@ Grabber.prototype.moveEvent = function(event) {
// during the handling of the event, do as little as possible. We save the updated mouse position,
// and start a timer to react to the change. If more changes arrive before the timer fires, only
// the last update will be considered. This is done to avoid backing-up Qt's event queue.
if (!this.isGrabbing) {
if (!this.isGrabbing || HMD.active) {
return;
}
mouse.updateDrag(event);
@ -458,7 +458,7 @@ Grabber.prototype.moveEventProcess = function() {
this.moveEventTimer = null;
// see if something added/restored gravity
var entityProperties = Entities.getEntityProperties(this.entityID);
if (!entityProperties || !entityProperties.gravity) {
if (!entityProperties || !entityProperties.gravity || HMD.active) {
return;
}

View file

@ -1474,6 +1474,8 @@ function onFileSaveChanged(filename) {
}
function onFileOpenChanged(filename) {
// disconnect the event, otherwise the requests will stack up
Window.openFileChanged.disconnect(onFileOpenChanged);
var importURL = null;
if (filename !== "") {
importURL = "file:///" + filename;