Merge branch 'master' of github.com:highfidelity/hifi into fix-collision-mask-for-children

This commit is contained in:
Dante Ruiz 2017-12-04 09:08:11 -08:00
commit 03934549cc
24 changed files with 190 additions and 285 deletions

View file

@ -1,127 +0,0 @@
<!-- Copyright 2016 High Fidelity, Inc. -->
<html>
<head>
<meta charset="utf-8"/>
<input type="hidden" id="version" value="1"/>
<title>Welcome to Interface</title>
<style>
body {
background: black;
width: 100%;
overflow-x: hidden;
margin: 0;
padding: 0;
}
#kbm_button {
position: absolute;
left: 70;
top: 118;
width: 297;
height: 80;
}
#hand_controllers_button {
position: absolute;
left: 367;
top: 118;
width: 267;
height: 80;
}
#game_controller_button {
position: absolute;
left: 634;
top: 118;
width: 297;
height: 80;
}
#image_area {
width: 1024;
height: 720;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
</style>
<script>
var handControllerImageURL = null;
function showKbm() {
document.getElementById("main_image").setAttribute("src", "img/controls-help-keyboard.png");
}
function showHandControllers() {
document.getElementById("main_image").setAttribute("src", handControllerImageURL);
}
function showGamepad() {
document.getElementById("main_image").setAttribute("src", "img/controls-help-gamepad.png");
}
// This is not meant to be a complete or hardened query string parser - it only
// needs to handle the values we send in and have control over.
//
// queryString is a string of the form "key1=value1&key2=value2&key3&key4=value4"
function parseQueryString(queryString) {
var params = {};
var paramsParts = queryString.split("&");
for (var i = 0; i < paramsParts.length; ++i) {
var paramKeyValue = paramsParts[i].split("=");
if (paramKeyValue.length == 1) {
params[paramKeyValue[0]] = undefined;
} else if (paramKeyValue.length == 2) {
params[paramKeyValue[0]] = paramKeyValue[1];
} else {
console.error("Error parsing param keyvalue: ", paramParts);
}
}
return params;
}
function load() {
var parts = window.location.href.split("?");
var params = {};
if (parts.length > 0) {
params = parseQueryString(parts[1]);
}
switch (params.handControllerName) {
case "oculus":
handControllerImageURL = "img/controls-help-oculus.png";
break;
case "vive":
default:
handControllerImageURL = "img/controls-help-vive.png";
}
switch (params.defaultTab) {
case "gamepad":
showGamepad();
break;
case "handControllers":
showHandControllers();
break;
case "kbm":
default:
showKbm();
}
}
</script>
</head>
<body onload="load()">
<div id="image_area">
<img id="main_image" src="img/controls-help-keyboard.png" width="1024px" height="720px"></img>
<a href="#" id="kbm_button" onmousedown="showKbm()"></a>
<a href="#" id="hand_controllers_button" onmousedown="showHandControllers()"></a>
<a href="#" id="game_controller_button" onmousedown="showGamepad()"></a>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 KiB

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 KiB

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 KiB

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View file

@ -11,6 +11,7 @@
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.2 as QQC2
import "../styles-uit" import "../styles-uit"
@ -24,6 +25,45 @@ TableView {
model: ListModel { } model: ListModel { }
Component.onCompleted: {
if (flickableItem !== null && flickableItem !== undefined) {
tableView.flickableItem.QQC2.ScrollBar.vertical = scrollbar
}
}
QQC2.ScrollBar {
id: scrollbar
parent: tableView.flickableItem
policy: QQC2.ScrollBar.AsNeeded
orientation: Qt.Vertical
visible: size < 1.0
topPadding: tableView.headerVisible ? hifi.dimensions.tableHeaderHeight + 1 : 1
anchors.top: tableView.top
anchors.left: tableView.right
anchors.bottom: tableView.bottom
background: Item {
implicitWidth: hifi.dimensions.scrollbarBackgroundWidth
Rectangle {
anchors {
fill: parent;
topMargin: tableView.headerVisible ? hifi.dimensions.tableHeaderHeight : 0
}
color: isLightColorScheme ? hifi.colors.tableScrollBackgroundLight
: hifi.colors.tableScrollBackgroundDark
}
}
contentItem: Item {
implicitWidth: hifi.dimensions.scrollbarHandleWidth
Rectangle {
anchors.fill: parent
radius: (width - 4)/2
color: isLightColorScheme ? hifi.colors.tableScrollHandleLight : hifi.colors.tableScrollHandleDark
}
}
}
headerVisible: false headerVisible: false
headerDelegate: Rectangle { headerDelegate: Rectangle {
height: hifi.dimensions.tableHeaderHeight height: hifi.dimensions.tableHeaderHeight
@ -98,74 +138,13 @@ TableView {
backgroundVisible: true backgroundVisible: true
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff
style: TableViewStyle { style: TableViewStyle {
// Needed in order for rows to keep displaying rows after end of table entries. // Needed in order for rows to keep displaying rows after end of table entries.
backgroundColor: tableView.isLightColorScheme ? hifi.colors.tableBackgroundLight : hifi.colors.tableBackgroundDark backgroundColor: tableView.isLightColorScheme ? hifi.colors.tableBackgroundLight : hifi.colors.tableBackgroundDark
alternateBackgroundColor: tableView.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd alternateBackgroundColor: tableView.isLightColorScheme ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd
padding.top: headerVisible ? hifi.dimensions.tableHeaderHeight: 0 padding.top: headerVisible ? hifi.dimensions.tableHeaderHeight: 0
handle: Item {
id: scrollbarHandle
implicitWidth: hifi.dimensions.scrollbarHandleWidth
Rectangle {
anchors {
fill: parent
topMargin: 3
bottomMargin: 3 // ""
leftMargin: 1 // Move it right
rightMargin: -1 // ""
}
radius: hifi.dimensions.scrollbarHandleWidth/2
color: isLightColorScheme ? hifi.colors.tableScrollHandleLight : hifi.colors.tableScrollHandleDark
}
}
scrollBarBackground: Item {
implicitWidth: hifi.dimensions.scrollbarBackgroundWidth
Rectangle {
anchors {
fill: parent
margins: -1 // Expand
topMargin: -1
}
color: isLightColorScheme ? hifi.colors.tableScrollBackgroundLight : hifi.colors.tableScrollBackgroundDark
// Extend header color above scrollbar background
Rectangle {
anchors {
top: parent.top
topMargin: -hifi.dimensions.tableHeaderHeight
left: parent.left
right: parent.right
}
height: hifi.dimensions.tableHeaderHeight
color: tableView.isLightColorScheme ? hifi.colors.tableBackgroundLight : hifi.colors.tableBackgroundDark
visible: headerVisible
}
Rectangle {
// Extend header bottom border
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: 1
color: isLightColorScheme ? hifi.colors.lightGrayText : hifi.colors.baseGrayHighlight
visible: headerVisible
}
}
}
incrementControl: Item {
visible: false
}
decrementControl: Item {
visible: false
}
} }
rowDelegate: Rectangle { rowDelegate: Rectangle {

View file

@ -9,9 +9,11 @@
// //
import QtQml.Models 2.2 import QtQml.Models 2.2
import QtQuick 2.5 import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.2 as QQC2
import "../styles-uit" import "../styles-uit"
@ -35,6 +37,45 @@ TreeView {
headerVisible: false headerVisible: false
Component.onCompleted: {
if (flickableItem !== null && flickableItem !== undefined) {
treeView.flickableItem.QQC2.ScrollBar.vertical = scrollbar
}
}
QQC2.ScrollBar {
id: scrollbar
parent: treeView.flickableItem
policy: QQC2.ScrollBar.AsNeeded
orientation: Qt.Vertical
visible: size < 1.0
topPadding: treeView.headerVisible ? hifi.dimensions.tableHeaderHeight + 1 : 1
anchors.top: treeView.top
anchors.left: treeView.right
anchors.bottom: treeView.bottom
background: Item {
implicitWidth: hifi.dimensions.scrollbarBackgroundWidth
Rectangle {
anchors {
fill: parent;
topMargin: treeView.headerVisible ? hifi.dimensions.tableHeaderHeight: 0
}
color: isLightColorScheme ? hifi.colors.tableScrollBackgroundLight
: hifi.colors.tableScrollBackgroundDark
}
}
contentItem: Item {
implicitWidth: hifi.dimensions.scrollbarHandleWidth
Rectangle {
anchors.fill: parent
radius: (width - 4)/2
color: isLightColorScheme ? hifi.colors.tableScrollHandleLight : hifi.colors.tableScrollHandleDark
}
}
}
// Use rectangle to draw border with rounded corners. // Use rectangle to draw border with rounded corners.
frameVisible: false frameVisible: false
Rectangle { Rectangle {
@ -50,7 +91,7 @@ TreeView {
backgroundVisible: true backgroundVisible: true
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff
style: TreeViewStyle { style: TreeViewStyle {
// Needed in order for rows to keep displaying rows after end of table entries. // Needed in order for rows to keep displaying rows after end of table entries.
@ -126,66 +167,6 @@ TreeView {
leftMargin: hifi.dimensions.tablePadding / 2 leftMargin: hifi.dimensions.tablePadding / 2
} }
} }
handle: Item {
id: scrollbarHandle
implicitWidth: hifi.dimensions.scrollbarHandleWidth
Rectangle {
anchors {
fill: parent
topMargin: treeView.headerVisible ? hifi.dimensions.tableHeaderHeight + 3 : 3
bottomMargin: 3 // ""
leftMargin: 1 // Move it right
rightMargin: -1 // ""
}
radius: hifi.dimensions.scrollbarHandleWidth / 2
color: treeView.isLightColorScheme ? hifi.colors.tableScrollHandleLight : hifi.colors.tableScrollHandleDark
}
}
scrollBarBackground: Item {
implicitWidth: hifi.dimensions.scrollbarBackgroundWidth
Rectangle {
anchors {
fill: parent
topMargin: treeView.headerVisible ? hifi.dimensions.tableHeaderHeight - 1 : -1
margins: -1 // Expand
}
color: treeView.isLightColorScheme ? hifi.colors.tableScrollBackgroundLight : hifi.colors.tableScrollBackgroundDark
// Extend header color above scrollbar background
Rectangle {
anchors {
top: parent.top
topMargin: -hifi.dimensions.tableHeaderHeight
left: parent.left
right: parent.right
}
height: hifi.dimensions.tableHeaderHeight
color: treeView.isLightColorScheme ? hifi.colors.tableBackgroundLight : hifi.colors.tableBackgroundDark
visible: treeView.headerVisible
}
Rectangle {
// Extend header bottom border
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: 1
color: treeView.isLightColorScheme ? hifi.colors.lightGrayText : hifi.colors.baseGrayHighlight
visible: treeView.headerVisible
}
}
}
incrementControl: Item {
visible: false
}
decrementControl: Item {
visible: false
}
} }
rowDelegate: Rectangle { rowDelegate: Rectangle {
@ -193,8 +174,8 @@ TreeView {
color: styleData.selected color: styleData.selected
? hifi.colors.primaryHighlight ? hifi.colors.primaryHighlight
: treeView.isLightColorScheme : treeView.isLightColorScheme
? (styleData.alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd) ? (styleData.alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd)
: (styleData.alternate ? hifi.colors.tableRowDarkEven : hifi.colors.tableRowDarkOdd) : (styleData.alternate ? hifi.colors.tableRowDarkEven : hifi.colors.tableRowDarkOdd)
} }
itemDelegate: FiraSansSemiBold { itemDelegate: FiraSansSemiBold {
@ -209,9 +190,9 @@ TreeView {
text: styleData.value text: styleData.value
size: hifi.fontSizes.tableText size: hifi.fontSizes.tableText
color: colorScheme == hifi.colorSchemes.light color: colorScheme == hifi.colorSchemes.light
? (styleData.selected ? hifi.colors.black : hifi.colors.baseGrayHighlight) ? (styleData.selected ? hifi.colors.black : hifi.colors.baseGrayHighlight)
: (styleData.selected ? hifi.colors.black : hifi.colors.lightGrayText) : (styleData.selected ? hifi.colors.black : hifi.colors.lightGrayText)
elide: Text.ElideRight elide: Text.ElideRight
} }

View file

@ -430,7 +430,7 @@ Rectangle {
var a = new Date(timestamp); var a = new Date(timestamp);
var year = a.getFullYear(); var year = a.getFullYear();
var month = addLeadingZero(a.getMonth()); var month = addLeadingZero(a.getMonth() + 1);
var day = addLeadingZero(a.getDate()); var day = addLeadingZero(a.getDate());
var hour = a.getHours(); var hour = a.getHours();
var drawnHour = hour; var drawnHour = hour;

View file

@ -343,6 +343,9 @@ Rectangle {
ListModel { ListModel {
id: previousPurchasesModel; id: previousPurchasesModel;
} }
HifiCommerceCommon.SortableListModel {
id: tempPurchasesModel;
}
HifiCommerceCommon.SortableListModel { HifiCommerceCommon.SortableListModel {
id: filteredPurchasesModel; id: filteredPurchasesModel;
} }
@ -635,20 +638,40 @@ Rectangle {
} }
function buildFilteredPurchasesModel() { function buildFilteredPurchasesModel() {
filteredPurchasesModel.clear(); var sameItemCount = 0;
tempPurchasesModel.clear();
for (var i = 0; i < purchasesModel.count; i++) { for (var i = 0; i < purchasesModel.count; i++) {
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) { if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) { if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) {
filteredPurchasesModel.insert(0, purchasesModel.get(i)); tempPurchasesModel.insert(0, purchasesModel.get(i));
} else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === "0") || } else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === "0") ||
(!root.isShowingMyItems && purchasesModel.get(i).edition_number !== "0")) { (!root.isShowingMyItems && purchasesModel.get(i).edition_number !== "0")) {
filteredPurchasesModel.append(purchasesModel.get(i)); tempPurchasesModel.append(purchasesModel.get(i));
} }
} }
} }
for (var i = 0; i < tempPurchasesModel.count; i++) {
if (!filteredPurchasesModel.get(i)) {
sameItemCount = -1;
break;
} else if (tempPurchasesModel.get(i).itemId === filteredPurchasesModel.get(i).itemId &&
tempPurchasesModel.get(i).edition_number === filteredPurchasesModel.get(i).edition_number &&
tempPurchasesModel.get(i).status === filteredPurchasesModel.get(i).status) {
sameItemCount++;
}
}
populateDisplayedItemCounts(); if (sameItemCount !== tempPurchasesModel.count) {
sortByDate(); filteredPurchasesModel.clear();
for (var i = 0; i < tempPurchasesModel.count; i++) {
filteredPurchasesModel.append(tempPurchasesModel.get(i));
}
populateDisplayedItemCounts();
sortByDate();
}
} }
function checkIfAnyItemStatusChanged() { function checkIfAnyItemStatusChanged() {

View file

@ -38,10 +38,28 @@ Item {
onHistoryResult : { onHistoryResult : {
historyReceived = true; historyReceived = true;
if (result.status === 'success') { if (result.status === 'success') {
transactionHistoryModel.clear(); var sameItemCount = 0;
transactionHistoryModel.append(result.data.history); tempTransactionHistoryModel.clear();
tempTransactionHistoryModel.append(result.data.history);
for (var i = 0; i < tempTransactionHistoryModel.count; i++) {
if (!transactionHistoryModel.get(i)) {
sameItemCount = -1;
break;
} else if (tempTransactionHistoryModel.get(i).transaction_type === transactionHistoryModel.get(i).transaction_type &&
tempTransactionHistoryModel.get(i).text === transactionHistoryModel.get(i).text) {
sameItemCount++;
}
}
calculatePendingAndInvalidated(); if (sameItemCount !== tempTransactionHistoryModel.count) {
transactionHistoryModel.clear();
for (var i = 0; i < tempTransactionHistoryModel.count; i++) {
transactionHistoryModel.append(tempTransactionHistoryModel.get(i));
}
calculatePendingAndInvalidated();
}
} }
refreshTimer.start(); refreshTimer.start();
} }
@ -143,10 +161,9 @@ Item {
Timer { Timer {
id: refreshTimer; id: refreshTimer;
interval: 4000; // Remove this after demo? interval: 4000;
onTriggered: { onTriggered: {
console.log("Refreshing Wallet Home..."); console.log("Refreshing Wallet Home...");
historyReceived = false;
commerce.balance(); commerce.balance();
commerce.history(); commerce.history();
} }
@ -187,6 +204,9 @@ Item {
// Style // Style
color: hifi.colors.baseGrayHighlight; color: hifi.colors.baseGrayHighlight;
} }
ListModel {
id: tempTransactionHistoryModel;
}
ListModel { ListModel {
id: transactionHistoryModel; id: transactionHistoryModel;
} }
@ -339,7 +359,7 @@ Item {
var a = new Date(timestamp); var a = new Date(timestamp);
var year = a.getFullYear(); var year = a.getFullYear();
var month = addLeadingZero(a.getMonth()); var month = addLeadingZero(a.getMonth() + 1);
var day = addLeadingZero(a.getDate()); var day = addLeadingZero(a.getDate());
var hour = a.getHours(); var hour = a.getHours();
var drawnHour = hour; var drawnHour = hour;

View file

@ -78,6 +78,7 @@ Overlay {
case "imageURL": image.source = value; break; case "imageURL": image.source = value; break;
case "subImage": updateSubImage(value); break; case "subImage": updateSubImage(value); break;
case "color": color.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, root.opacity); break; case "color": color.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, root.opacity); break;
case "bounds": break; // The bounds property is handled in C++.
default: console.log("OVERLAY Unhandled image property " + key); default: console.log("OVERLAY Unhandled image property " + key);
} }
} }

View file

@ -29,6 +29,7 @@ Overlay {
case "borderColor": rectangle.border.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, rectangle.border.color.a); break; case "borderColor": rectangle.border.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, rectangle.border.color.a); break;
case "borderWidth": rectangle.border.width = value; break; case "borderWidth": rectangle.border.width = value; break;
case "radius": rectangle.radius = value; break; case "radius": rectangle.radius = value; break;
case "bounds": break; // The bounds property is handled in C++.
default: console.warn("OVERLAY Unhandled rectangle property " + key); default: console.warn("OVERLAY Unhandled rectangle property " + key);
} }
} }

View file

@ -46,6 +46,7 @@ Overlay {
case "backgroundColor": background.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, background.color.a); break; case "backgroundColor": background.color = Qt.rgba(value.red / 255, value.green / 255, value.blue / 255, background.color.a); break;
case "font": textField.font.pixelSize = value.size; break; case "font": textField.font.pixelSize = value.size; break;
case "lineHeight": textField.lineHeight = value; break; case "lineHeight": textField.lineHeight = value; break;
case "bounds": break; // The bounds property is handled in C++.
default: console.warn("OVERLAY text unhandled property " + key); default: console.warn("OVERLAY text unhandled property " + key);
} }
} }

View file

@ -162,7 +162,7 @@ Item {
readonly property real controlLineHeight: 28 // Height of spinbox control on 1920 x 1080 monitor readonly property real controlLineHeight: 28 // Height of spinbox control on 1920 x 1080 monitor
readonly property real controlInterlineHeight: 21 // 75% of controlLineHeight readonly property real controlInterlineHeight: 21 // 75% of controlLineHeight
readonly property vector2d menuPadding: Qt.vector2d(14, 102) readonly property vector2d menuPadding: Qt.vector2d(14, 102)
readonly property real scrollbarBackgroundWidth: 18 readonly property real scrollbarBackgroundWidth: 20
readonly property real scrollbarHandleWidth: scrollbarBackgroundWidth - 2 readonly property real scrollbarHandleWidth: scrollbarBackgroundWidth - 2
readonly property real tabletMenuHeader: 90 readonly property real tabletMenuHeader: 90
} }

View file

@ -166,26 +166,36 @@ void Line3DOverlay::setProperties(const QVariantMap& originalProperties) {
bool newEndSet { false }; bool newEndSet { false };
auto start = properties["start"]; auto start = properties["start"];
// if "start" property was not there, check to see if they included aliases: startPoint // If "start" property was not there, check to see if they included aliases: startPoint, p1
if (!start.isValid()) { if (!start.isValid()) {
start = properties["startPoint"]; start = properties["startPoint"];
} }
if (!start.isValid()) {
start = properties["p1"];
}
if (start.isValid()) { if (start.isValid()) {
newStart = vec3FromVariant(start); newStart = vec3FromVariant(start);
newStartSet = true; newStartSet = true;
} }
properties.remove("start"); // so that Base3DOverlay doesn't respond to it properties.remove("start"); // so that Base3DOverlay doesn't respond to it
properties.remove("startPoint");
properties.remove("p1");
auto end = properties["end"]; auto end = properties["end"];
// if "end" property was not there, check to see if they included aliases: endPoint // If "end" property was not there, check to see if they included aliases: endPoint, p2
if (!end.isValid()) { if (!end.isValid()) {
end = properties["endPoint"]; end = properties["endPoint"];
} }
if (!end.isValid()) {
end = properties["p2"];
}
if (end.isValid()) { if (end.isValid()) {
newEnd = vec3FromVariant(end); newEnd = vec3FromVariant(end);
newEndSet = true; newEndSet = true;
} }
properties.remove("end"); // so that Base3DOverlay doesn't respond to it properties.remove("end"); // so that Base3DOverlay doesn't respond to it
properties.remove("endPoint");
properties.remove("p2");
auto length = properties["length"]; auto length = properties["length"];
if (length.isValid()) { if (length.isValid()) {
@ -252,14 +262,23 @@ QVariant Line3DOverlay::getProperty(const QString& property) {
if (property == "end" || property == "endPoint" || property == "p2") { if (property == "end" || property == "endPoint" || property == "p2") {
return vec3toVariant(getEnd()); return vec3toVariant(getEnd());
} }
if (property == "length") {
return QVariant(getLength());
}
if (property == "endParentID") {
return _endParentID;
}
if (property == "endParentJointIndex") {
return _endParentJointIndex;
}
if (property == "localStart") { if (property == "localStart") {
return vec3toVariant(getLocalStart()); return vec3toVariant(getLocalStart());
} }
if (property == "localEnd") { if (property == "localEnd") {
return vec3toVariant(getLocalEnd()); return vec3toVariant(getLocalEnd());
} }
if (property == "length") { if (property == "glow") {
return QVariant(getLength()); return getGlow();
} }
if (property == "lineWidth") { if (property == "lineWidth") {
return _lineWidth; return _lineWidth;

View file

@ -134,6 +134,9 @@ void ModelOverlay::setProperties(const QVariantMap& properties) {
} }
auto dimensions = properties["dimensions"]; auto dimensions = properties["dimensions"];
if (!dimensions.isValid()) {
dimensions = properties["size"];
}
if (dimensions.isValid()) { if (dimensions.isValid()) {
_scaleToFit = true; _scaleToFit = true;
setDimensions(vec3FromVariant(dimensions)); setDimensions(vec3FromVariant(dimensions));

View file

@ -75,8 +75,11 @@ RenderableModelEntityItem::RenderableModelEntityItem(const EntityItemID& entityI
RenderableModelEntityItem::~RenderableModelEntityItem() { } RenderableModelEntityItem::~RenderableModelEntityItem() { }
void RenderableModelEntityItem::setDimensions(const glm::vec3& value) { void RenderableModelEntityItem::setDimensions(const glm::vec3& value) {
_dimensionsInitialized = true; glm::vec3 newDimensions = glm::max(value, glm::vec3(0.0f)); // can never have negative dimensions
ModelEntityItem::setDimensions(value); if (getDimensions() != newDimensions) {
_dimensionsInitialized = true;
ModelEntityItem::setDimensions(value);
}
} }
QVariantMap parseTexturesToMap(QString textures, const QVariantMap& defaultTextures) { QVariantMap parseTexturesToMap(QString textures, const QVariantMap& defaultTextures) {
@ -1160,7 +1163,6 @@ bool ModelEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPoin
return true; return true;
} }
if (model->getScaleToFitDimensions() != entity->getDimensions() || if (model->getScaleToFitDimensions() != entity->getDimensions() ||
model->getRegistrationPoint() != entity->getRegistrationPoint()) { model->getRegistrationPoint() != entity->getRegistrationPoint()) {
return true; return true;

View file

@ -1622,11 +1622,13 @@ void EntityItem::setDimensions(const glm::vec3& value) {
if (getDimensions() != newDimensions) { if (getDimensions() != newDimensions) {
withWriteLock([&] { withWriteLock([&] {
_dimensions = newDimensions; _dimensions = newDimensions;
_dirtyFlags |= (Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
_queryAACubeSet = false;
}); });
locationChanged(); locationChanged();
dimensionsChanged(); dimensionsChanged();
withWriteLock([&] {
_dirtyFlags |= (Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
_queryAACubeSet = false;
});
} }
} }

View file

@ -337,6 +337,7 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle
_poseStateMap.clear(); _poseStateMap.clear();
_buttonPressedMap.clear(); _buttonPressedMap.clear();
_validTrackedObjects.clear(); _validTrackedObjects.clear();
_trackedControllers = 0;
// While the keyboard is open, we defer strictly to the keyboard values // While the keyboard is open, we defer strictly to the keyboard values
if (isOpenVrKeyboardShown()) { if (isOpenVrKeyboardShown()) {
@ -369,14 +370,12 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle
} }
} }
int numTrackedControllers = 0;
if (leftHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) { if (leftHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) {
numTrackedControllers++; _trackedControllers++;
} }
if (rightHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) { if (rightHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) {
numTrackedControllers++; _trackedControllers++;
} }
_trackedControllers = numTrackedControllers;
calibrateFromHandController(inputCalibrationData); calibrateFromHandController(inputCalibrationData);
calibrateFromUI(inputCalibrationData); calibrateFromUI(inputCalibrationData);
@ -527,6 +526,7 @@ void ViveControllerManager::InputDevice::handleTrackedObject(uint32_t deviceInde
// but _validTrackedObjects remain in sensor frame // but _validTrackedObjects remain in sensor frame
_validTrackedObjects.push_back(std::make_pair(poseIndex, pose)); _validTrackedObjects.push_back(std::make_pair(poseIndex, pose));
_trackedControllers++;
} else { } else {
controller::Pose invalidPose; controller::Pose invalidPose;
_poseStateMap[poseIndex] = invalidPose; _poseStateMap[poseIndex] = invalidPose;
@ -758,9 +758,9 @@ void ViveControllerManager::InputDevice::handleHmd(uint32_t deviceIndex, const c
} else { } else {
const mat4& mat = mat4(); const mat4& mat = mat4();
const vec3 zero = vec3(); const vec3 zero = vec3();
handleHeadPoseEvent(inputCalibrationData, mat, zero, zero); handleHeadPoseEvent(inputCalibrationData, mat, zero, zero);
} }
_trackedControllers++;
} }
} }

View file

@ -112,8 +112,8 @@ var DEFAULT_LIGHT_DIMENSIONS = Vec3.multiply(20, DEFAULT_DIMENSIONS);
var MENU_AUTO_FOCUS_ON_SELECT = "Auto Focus on Select"; var MENU_AUTO_FOCUS_ON_SELECT = "Auto Focus on Select";
var MENU_EASE_ON_FOCUS = "Ease Orientation on Focus"; var MENU_EASE_ON_FOCUS = "Ease Orientation on Focus";
var MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE = "Show Lights and Particle Systems in Edit Mode"; var MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE = "Show Lights and Particle Systems in Create Mode";
var MENU_SHOW_ZONES_IN_EDIT_MODE = "Show Zones in Edit Mode"; var MENU_SHOW_ZONES_IN_EDIT_MODE = "Show Zones in Create Mode";
var SETTING_AUTO_FOCUS_ON_SELECT = "autoFocusOnSelect"; var SETTING_AUTO_FOCUS_ON_SELECT = "autoFocusOnSelect";
var SETTING_EASE_ON_FOCUS = "cameraEaseOnFocus"; var SETTING_EASE_ON_FOCUS = "cameraEaseOnFocus";