overte/interface/resources/qml/AnimStats.qml
Anthony Thibault ac8869eb61 Bug fix for head trackers in desktop mode
Sitting and standing modes work even in desktop mode.
We were inadvertently checking for HMD Mode instead of if the head was valid.
* A change was made to the ViveControllerManager to return head poses in the correct standing universe when in desktop mode.
* The default sensorToWorld matrix in desktop mode is similar to the one returned by the system for Vive and Oculus sensor frame; y = 0 is at floor level.
* Sitting mode, walking mode and recentering flags are now visible in the AnimStats.
2018-11-05 16:21:19 -08:00

174 lines
5.8 KiB
QML

import Hifi 1.0 as Hifi
import QtQuick 2.3
import '.'
Item {
id: animStats
anchors.leftMargin: 300
objectName: "StatsItem"
property int modality: Qt.NonModal
implicitHeight: row.height
implicitWidth: row.width
Component.onCompleted: {
animStats.parentChanged.connect(fill);
fill();
}
Component.onDestruction: {
animStats.parentChanged.disconnect(fill);
}
function fill() {
// This will cause a warning at shutdown, need to find another way to remove
// the warning other than filling the anchors to the parent
anchors.horizontalCenter = parent.horizontalCenter
}
Hifi.AnimStats {
id: root
objectName: "AnimStats"
implicitHeight: row.height
implicitWidth: row.width
anchors.horizontalCenter: parent.horizontalCenter
readonly property string bgColor: "#AA111111"
Row {
id: row
spacing: 8
Rectangle {
width: firstCol.width + 8;
height: firstCol.height + 8;
color: root.bgColor;
Column {
id: firstCol
spacing: 4; x: 4; y: 4;
StatText {
text: root.positionText
}
StatText {
text: root.recenterText
}
StatText {
text: "Anim Vars:--------------------------------------------------------------------------------"
}
ListView {
width: secondCol.width
height: root.animVars.length * 15
visible: root.animVars.length > 0;
model: root.animVars
delegate: StatText {
text: {
var actualText = modelData.split("|")[1];
if (actualText) {
return actualText;
} else {
return modelData;
}
}
color: {
var grayScale = parseFloat(modelData.split("|")[0]);
return Qt.rgba(1.0, 1.0, 1.0, grayScale);
}
styleColor: {
var grayScale = parseFloat(modelData.split("|")[0]);
return Qt.rgba(0.0, 0.0, 0.0, grayScale);
}
}
}
}
}
Rectangle {
width: secondCol.width + 8
height: secondCol.height + 8
color: root.bgColor;
Column {
id: secondCol
spacing: 4; x: 4; y: 4;
StatText {
text: root.rotationText
}
StatText {
text: root.sittingText
}
StatText {
text: "State Machines:---------------------------------------------------------------------------"
}
ListView {
width: firstCol.width
height: root.animStateMachines.length * 15
visible: root.animStateMachines.length > 0;
model: root.animStateMachines
delegate: StatText {
text: {
return modelData;
}
}
}
}
}
Rectangle {
width: thirdCol.width + 8
height: thirdCol.height + 8
color: root.bgColor;
Column {
id: thirdCol
spacing: 4; x: 4; y: 4;
StatText {
text: root.velocityText
}
StatText {
text: root.walkingText
}
StatText {
text: "Alpha Values:--------------------------------------------------------------------------"
}
ListView {
width: thirdCol.width
height: root.animAlphaValues.length * 15
visible: root.animAlphaValues.length > 0;
model: root.animAlphaValues
delegate: StatText {
text: {
var actualText = modelData.split("|")[1];
if (actualText) {
return actualText;
} else {
return modelData;
}
}
color: {
var grayScale = parseFloat(modelData.split("|")[0]);
return Qt.rgba(1.0, 1.0, 1.0, grayScale);
}
styleColor: {
var grayScale = parseFloat(modelData.split("|")[0]);
return Qt.rgba(0.0, 0.0, 0.0, grayScale);
}
}
}
}
}
}
Connections {
target: root.parent
onWidthChanged: {
root.x = root.parent.width - root.width;
}
}
}
}