Merge remote-tracking branch 'upstream/master' into android_hifi_audio_codec
|
@ -19,9 +19,9 @@
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:screenOrientation="unspecified"
|
android:screenOrientation="unspecified"
|
||||||
android:theme="@style/NoSystemUI"
|
android:theme="@style/NoSystemUI"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round">
|
android:roundIcon="@drawable/ic_launcher">
|
||||||
<activity android:name="io.highfidelity.hifiinterface.PermissionChecker">
|
<activity android:name="io.highfidelity.hifiinterface.PermissionChecker">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
17
android/app/src/main/res/drawable/ic_launcher.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--suppress AndroidUnknownAttribute -->
|
||||||
|
<vector xmlns:api24="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:viewportWidth="192"
|
||||||
|
android:viewportHeight="192"
|
||||||
|
android:width="192dp"
|
||||||
|
android:height="192dp">
|
||||||
|
<path
|
||||||
|
android:pathData="M189.5 96.5A93.5 93.5 0 0 1 96 190 93.5 93.5 0 0 1 2.5 96.5 93.5 93.5 0 0 1 96 3 93.5 93.5 0 0 1 189.5 96.5Z"
|
||||||
|
android:fillColor="#333333" />
|
||||||
|
<path
|
||||||
|
android:pathData="M96.2 173.1c-10.3 0 -20.4 -2.1 -29.8 -6 -9.2 -3.8 -17.3 -9.4 -24.3 -16.4 -7 -7 -12.6 -15.2 -16.4 -24.3 -4.1 -9.6 -6.2 -19.6 -6.2 -30 0 -10.3 2.1 -20.4 6 -29.8 3.8 -9.2 9.4 -17.3 16.4 -24.3 7 -7 15.2 -12.6 24.3 -16.4 9.5 -4 19.5 -6 29.8 -6 10.3 0 20.4 2.1 29.8 6 9.2 3.8 17.3 9.4 24.3 16.4 7 7 12.6 15.2 16.4 24.3 4 9.5 6 19.5 6 29.8 0 10.3 -2.1 20.4 -6 29.8 -3.8 9.2 -9.4 17.3 -16.4 24.3 -7 7 -15.2 12.6 -24.3 16.4 -9.2 4.1 -19.3 6.2 -29.6 6.2zm0 -145.3c-37.8 0 -68.6 30.8 -68.6 68.6 0 37.8 30.8 68.6 68.6 68.6 37.8 0 68.6 -30.8 68.6 -68.6 0 -37.8 -30.8 -68.6 -68.6 -68.6z"
|
||||||
|
android:fillColor="#00b4f0" />
|
||||||
|
<path
|
||||||
|
android:pathData="M119.6 129l0 -53.8c3.4 -1.1 5.8 -4.3 5.8 -8 0 -4.6 -3.8 -8.4 -8.4 -8.4 -4.6 0 -8.4 3.8 -8.4 8.4 0 3.6 2.2 6.6 5.4 7.9l0 25L79 83.8 79 64c3.4 -1.1 5.8 -4.3 5.8 -8 0 -4.6 -3.8 -8.4 -8.4 -8.4 -4.6 0 -8.4 3.8 -8.4 8.4 0 3.6 2.2 6.6 5.4 7.9l0 54.1c-3.1 1.2 -5.4 4.3 -5.4 7.9 0 4.6 3.8 8.4 8.4 8.4 4.6 0 8.4 -3.8 8.4 -8.4 0 -3.7 -2.4 -6.9 -5.8 -8l0 -27.3 35 16.3 0 22.2c-3.1 1.2 -5.4 4.3 -5.4 7.9 0 4.6 3.8 8.4 8.4 8.4 4.6 0 8.4 -3.8 8.4 -8.4 0 -3.8 -2.4 -6.9 -5.8 -8z"
|
||||||
|
android:fillColor="#00b4f0" />
|
||||||
|
</vector>
|
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 8.2 KiB |
|
@ -1937,9 +1937,11 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
|
|
||||||
const QString UUID_REGEX_STRING = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
const QString UUID_REGEX_STRING = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
||||||
|
|
||||||
|
QPointer<HTTPConnection> connectionPtr { connection };
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
|
|
||||||
auto getSetting = [this](QString keyPath, QVariant value) -> bool {
|
auto getSetting = [this](QString keyPath, QVariant& value) -> bool {
|
||||||
|
|
||||||
value = _settingsManager.valueForKeyPath(keyPath);
|
value = _settingsManager.valueForKeyPath(keyPath);
|
||||||
if (!value.isValid()) {
|
if (!value.isValid()) {
|
||||||
|
@ -2120,30 +2122,38 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
return true;
|
return true;
|
||||||
} else if (url.path() == URI_API_BACKUPS) {
|
} else if (url.path() == URI_API_BACKUPS) {
|
||||||
auto deferred = makePromise("getAllBackupsAndStatus");
|
auto deferred = makePromise("getAllBackupsAndStatus");
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonDocument docJSON(QJsonObject::fromVariantMap(result));
|
QJsonDocument docJSON(QJsonObject::fromVariantMap(result));
|
||||||
|
|
||||||
connection->respond(HTTPConnection::StatusCode200, docJSON.toJson(), JSON_MIME_TYPE.toUtf8());
|
connectionPtr->respond(HTTPConnection::StatusCode200, docJSON.toJson(), JSON_MIME_TYPE.toUtf8());
|
||||||
});
|
});
|
||||||
_contentManager->getAllBackupsAndStatus(deferred);
|
_contentManager->getAllBackupsAndStatus(deferred);
|
||||||
return true;
|
return true;
|
||||||
} else if (url.path().startsWith(URI_API_BACKUPS_ID)) {
|
} else if (url.path().startsWith(URI_API_BACKUPS_ID)) {
|
||||||
auto id = url.path().mid(QString(URI_API_BACKUPS_ID).length());
|
auto id = url.path().mid(QString(URI_API_BACKUPS_ID).length());
|
||||||
auto deferred = makePromise("consolidateBackup");
|
auto deferred = makePromise("consolidateBackup");
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootJSON;
|
QJsonObject rootJSON;
|
||||||
auto success = result["success"].toBool();
|
auto success = result["success"].toBool();
|
||||||
if (success) {
|
if (success) {
|
||||||
auto path = result["backupFilePath"].toString();
|
auto path = result["backupFilePath"].toString();
|
||||||
auto file { std::unique_ptr<QFile>(new QFile(path)) };
|
auto file { std::unique_ptr<QFile>(new QFile(path)) };
|
||||||
if (file->open(QIODevice::ReadOnly)) {
|
if (file->open(QIODevice::ReadOnly)) {
|
||||||
connection->respond(HTTPConnection::StatusCode200, std::move(file));
|
connectionPtr->respond(HTTPConnection::StatusCode200, std::move(file));
|
||||||
} else {
|
} else {
|
||||||
qCritical(domain_server) << "Unable to load consolidated backup at:" << path << result;
|
qCritical(domain_server) << "Unable to load consolidated backup at:" << path << result;
|
||||||
connection->respond(HTTPConnection::StatusCode500, "Error opening backup");
|
connectionPtr->respond(HTTPConnection::StatusCode500, "Error opening backup");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
connection->respond(HTTPConnection::StatusCode400);
|
connectionPtr->respond(HTTPConnection::StatusCode400);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_contentManager->consolidateBackup(deferred, id);
|
_contentManager->consolidateBackup(deferred, id);
|
||||||
|
@ -2264,12 +2274,16 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
} else if (uploadedFilename.endsWith(".zip", Qt::CaseInsensitive)) {
|
} else if (uploadedFilename.endsWith(".zip", Qt::CaseInsensitive)) {
|
||||||
auto deferred = makePromise("recoverFromUploadedBackup");
|
auto deferred = makePromise("recoverFromUploadedBackup");
|
||||||
|
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootJSON;
|
QJsonObject rootJSON;
|
||||||
auto success = result["success"].toBool();
|
auto success = result["success"].toBool();
|
||||||
rootJSON["success"] = success;
|
rootJSON["success"] = success;
|
||||||
QJsonDocument docJSON(rootJSON);
|
QJsonDocument docJSON(rootJSON);
|
||||||
connection->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
connectionPtr->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
||||||
JSON_MIME_TYPE.toUtf8());
|
JSON_MIME_TYPE.toUtf8());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2297,12 +2311,16 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
}
|
}
|
||||||
|
|
||||||
auto deferred = makePromise("createManualBackup");
|
auto deferred = makePromise("createManualBackup");
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootJSON;
|
QJsonObject rootJSON;
|
||||||
auto success = result["success"].toBool();
|
auto success = result["success"].toBool();
|
||||||
rootJSON["success"] = success;
|
rootJSON["success"] = success;
|
||||||
QJsonDocument docJSON(rootJSON);
|
QJsonDocument docJSON(rootJSON);
|
||||||
connection->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
connectionPtr->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
||||||
JSON_MIME_TYPE.toUtf8());
|
JSON_MIME_TYPE.toUtf8());
|
||||||
});
|
});
|
||||||
_contentManager->createManualBackup(deferred, it.value());
|
_contentManager->createManualBackup(deferred, it.value());
|
||||||
|
@ -2322,12 +2340,16 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
} else if (url.path().startsWith(URI_API_BACKUPS_RECOVER)) {
|
} else if (url.path().startsWith(URI_API_BACKUPS_RECOVER)) {
|
||||||
auto id = url.path().mid(QString(URI_API_BACKUPS_RECOVER).length());
|
auto id = url.path().mid(QString(URI_API_BACKUPS_RECOVER).length());
|
||||||
auto deferred = makePromise("recoverFromBackup");
|
auto deferred = makePromise("recoverFromBackup");
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootJSON;
|
QJsonObject rootJSON;
|
||||||
auto success = result["success"].toBool();
|
auto success = result["success"].toBool();
|
||||||
rootJSON["success"] = success;
|
rootJSON["success"] = success;
|
||||||
QJsonDocument docJSON(rootJSON);
|
QJsonDocument docJSON(rootJSON);
|
||||||
connection->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
connectionPtr->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
||||||
JSON_MIME_TYPE.toUtf8());
|
JSON_MIME_TYPE.toUtf8());
|
||||||
});
|
});
|
||||||
_contentManager->recoverFromBackup(deferred, id);
|
_contentManager->recoverFromBackup(deferred, id);
|
||||||
|
@ -2423,12 +2445,16 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
if (url.path().startsWith(URI_API_BACKUPS_ID)) {
|
if (url.path().startsWith(URI_API_BACKUPS_ID)) {
|
||||||
auto id = url.path().mid(QString(URI_API_BACKUPS_ID).length());
|
auto id = url.path().mid(QString(URI_API_BACKUPS_ID).length());
|
||||||
auto deferred = makePromise("deleteBackup");
|
auto deferred = makePromise("deleteBackup");
|
||||||
deferred->then([connection, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
deferred->then([connectionPtr, JSON_MIME_TYPE](QString error, QVariantMap result) {
|
||||||
|
if (!connectionPtr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QJsonObject rootJSON;
|
QJsonObject rootJSON;
|
||||||
auto success = result["success"].toBool();
|
auto success = result["success"].toBool();
|
||||||
rootJSON["success"] = success;
|
rootJSON["success"] = success;
|
||||||
QJsonDocument docJSON(rootJSON);
|
QJsonDocument docJSON(rootJSON);
|
||||||
connection->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
connectionPtr->respond(success ? HTTPConnection::StatusCode200 : HTTPConnection::StatusCode400, docJSON.toJson(),
|
||||||
JSON_MIME_TYPE.toUtf8());
|
JSON_MIME_TYPE.toUtf8());
|
||||||
});
|
});
|
||||||
_contentManager->deleteBackup(deferred, id);
|
_contentManager->deleteBackup(deferred, id);
|
||||||
|
|
|
@ -34,8 +34,6 @@ Item {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
}
|
}
|
||||||
|
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: updateList
|
id: updateList
|
||||||
interval: 200
|
interval: 200
|
||||||
|
|
|
@ -257,11 +257,7 @@ Item {
|
||||||
id: octreeCol
|
id: octreeCol
|
||||||
spacing: 4; x: 4; y: 4;
|
spacing: 4; x: 4; y: 4;
|
||||||
StatText {
|
StatText {
|
||||||
text: "Render Engine: " + root.engineFrameTime.toFixed(1) + " ms"
|
text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms"
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: root.renderEngineStats
|
|
||||||
}
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
|
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
|
||||||
|
|
|
@ -109,9 +109,9 @@ CheckBox {
|
||||||
|
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
|
||||||
font.pixelSize: hifi.fontSizes.inputLabel
|
font.pixelSize: hifi.fontSizes.inputLabel
|
||||||
font.family: ralewaySemiBold.name
|
font.family: "Raleway"
|
||||||
|
font.weight: Font.DemiBold
|
||||||
text: checkBox.text
|
text: checkBox.text
|
||||||
color: checkBox.color
|
color: checkBox.color
|
||||||
x: 2
|
x: 2
|
||||||
|
|
|
@ -125,8 +125,7 @@ Rectangle {
|
||||||
TextInput {
|
TextInput {
|
||||||
id: mirrorText
|
id: mirrorText
|
||||||
visible: showMirrorText
|
visible: showMirrorText
|
||||||
FontLoader { id: font; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
font.family: "Fira Sans"
|
||||||
font.family: font.name
|
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
@ -165,8 +164,6 @@ Rectangle {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 0
|
anchors.bottomMargin: 0
|
||||||
|
|
||||||
FontLoader { id: hiFiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: columnAlpha
|
id: columnAlpha
|
||||||
width: keyboardWidth
|
width: keyboardWidth
|
||||||
|
@ -250,7 +247,7 @@ Rectangle {
|
||||||
Key { width: 43; glyph: ","; }
|
Key { width: 43; glyph: ","; }
|
||||||
Key { width: 43; glyph: "."; }
|
Key { width: 43; glyph: "."; }
|
||||||
Key {
|
Key {
|
||||||
fontFamily: hiFiGlyphs.name;
|
fontFamily: "hifi-glyphs";
|
||||||
fontPixelSize: 48;
|
fontPixelSize: 48;
|
||||||
letterAnchors.topMargin: -4;
|
letterAnchors.topMargin: -4;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
@ -343,7 +340,7 @@ Rectangle {
|
||||||
Key { width: 43; glyph: ","; }
|
Key { width: 43; glyph: ","; }
|
||||||
Key { width: 43; glyph: "."; }
|
Key { width: 43; glyph: "."; }
|
||||||
Key {
|
Key {
|
||||||
fontFamily: hiFiGlyphs.name;
|
fontFamily: "hifi-glyphs";
|
||||||
fontPixelSize: 48;
|
fontPixelSize: 48;
|
||||||
letterAnchors.topMargin: -4;
|
letterAnchors.topMargin: -4;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
|
|
@ -25,8 +25,7 @@ SpinBox {
|
||||||
property color colorLabelInside: hifi.colors.white
|
property color colorLabelInside: hifi.colors.white
|
||||||
property real controlHeight: height + (spinBoxLabel.visible ? spinBoxLabel.height + spinBoxLabel.anchors.bottomMargin : 0)
|
property real controlHeight: height + (spinBoxLabel.visible ? spinBoxLabel.height + spinBoxLabel.anchors.bottomMargin : 0)
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
font.family: "Fira Sans SemiBold"
|
||||||
font.family: firaSansSemiBold.name
|
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
height: hifi.fontSizes.textFieldInput + 13 // Match height of TextField control.
|
height: hifi.fontSizes.textFieldInput + 13 // Match height of TextField control.
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ TextEdit {
|
||||||
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
|
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
font.family: "Raleway"
|
||||||
font.family: ralewaySemiBold.name
|
font.weight: Font.DemiBold
|
||||||
font.pointSize: size
|
font.pointSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
|
|
@ -34,9 +34,7 @@ TextField {
|
||||||
|
|
||||||
placeholderText: textField.placeholderText
|
placeholderText: textField.placeholderText
|
||||||
|
|
||||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
font.family: "Fira Sans"
|
||||||
FontLoader { id: hifiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
|
||||||
font.family: firaSansRegular.name
|
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered.
|
height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered.
|
||||||
property alias textFieldLabel: textFieldLabel
|
property alias textFieldLabel: textFieldLabel
|
||||||
|
|
|
@ -4,13 +4,12 @@ import QtQuick.Controls.Styles 1.3
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: iconFont; source: "qrc:/fonts/fontawesome-webfont.ttf"; }
|
|
||||||
property int size: 32
|
property int size: 32
|
||||||
width: size
|
width: size
|
||||||
height: size
|
height: size
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: iconFont.name
|
font.family: "FontAwesome"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -532,9 +532,6 @@ ModalWindow {
|
||||||
itemDelegate: Item {
|
itemDelegate: Item {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
|
||||||
|
|
||||||
FiraSansSemiBold {
|
FiraSansSemiBold {
|
||||||
text: getText();
|
text: getText();
|
||||||
elide: styleData.elideMode
|
elide: styleData.elideMode
|
||||||
|
@ -548,7 +545,7 @@ ModalWindow {
|
||||||
size: hifi.fontSizes.tableText
|
size: hifi.fontSizes.tableText
|
||||||
color: hifi.colors.baseGrayHighlight
|
color: hifi.colors.baseGrayHighlight
|
||||||
font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||||
? firaSansSemiBold.name : firaSansRegular.name
|
? "Fira Sans SemiBold" : "Fira Sans"
|
||||||
|
|
||||||
function getText() {
|
function getText() {
|
||||||
if (styleData.row === -1) {
|
if (styleData.row === -1) {
|
||||||
|
|
|
@ -496,9 +496,6 @@ TabletModalWindow {
|
||||||
itemDelegate: Item {
|
itemDelegate: Item {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
//FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
//FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
|
||||||
|
|
||||||
FiraSansSemiBold {
|
FiraSansSemiBold {
|
||||||
text: getText();
|
text: getText();
|
||||||
elide: styleData.elideMode
|
elide: styleData.elideMode
|
||||||
|
@ -512,7 +509,7 @@ TabletModalWindow {
|
||||||
size: hifi.fontSizes.tableText
|
size: hifi.fontSizes.tableText
|
||||||
color: hifi.colors.baseGrayHighlight
|
color: hifi.colors.baseGrayHighlight
|
||||||
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||||
//? firaSansSemiBold.name : firaSansRegular.name
|
//? "Fira Sans SemiBold" : "Fira Sans"
|
||||||
|
|
||||||
function getText() {
|
function getText() {
|
||||||
if (styleData.row === -1) {
|
if (styleData.row === -1) {
|
||||||
|
|
|
@ -345,9 +345,6 @@ Item {
|
||||||
itemDelegate: Item {
|
itemDelegate: Item {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
|
||||||
|
|
||||||
FiraSansSemiBold {
|
FiraSansSemiBold {
|
||||||
text: styleData.value
|
text: styleData.value
|
||||||
elide: styleData.elideMode
|
elide: styleData.elideMode
|
||||||
|
@ -361,7 +358,7 @@ Item {
|
||||||
size: hifi.fontSizes.tableText
|
size: hifi.fontSizes.tableText
|
||||||
color: hifi.colors.baseGrayHighlight
|
color: hifi.colors.baseGrayHighlight
|
||||||
font.family: (styleData.row !== -1 && assetTableView.model.get(styleData.row).fileIsDir)
|
font.family: (styleData.row !== -1 && assetTableView.model.get(styleData.row).fileIsDir)
|
||||||
? firaSansSemiBold.name : firaSansRegular.name
|
? "Fira Sans SemiBold" : "Fira Sans"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -660,8 +660,7 @@ Windows.ScrollingWindow {
|
||||||
|
|
||||||
text: styleData.value
|
text: styleData.value
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
font.family: "Fira Sans SemiBold"
|
||||||
font.family: firaSansSemiBold.name
|
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
height: hifi.dimensions.tableRowHeight
|
height: hifi.dimensions.tableRowHeight
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ Item {
|
||||||
property int dialogHeight;
|
property int dialogHeight;
|
||||||
property int comboOptionTextSize: 16;
|
property int comboOptionTextSize: 16;
|
||||||
property int comboBodyTextSize: 16;
|
property int comboBodyTextSize: 16;
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
|
||||||
visible: false;
|
visible: false;
|
||||||
id: combo;
|
id: combo;
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
|
|
|
@ -24,8 +24,6 @@ Item {
|
||||||
property real headerTextMargin: -5
|
property real headerTextMargin: -5
|
||||||
property real headerGlyphMargin: -15
|
property real headerGlyphMargin: -15
|
||||||
property bool isDesktop: false
|
property bool isDesktop: false
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
|
||||||
visible: false
|
visible: false
|
||||||
id: letterbox
|
id: letterbox
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -78,7 +76,8 @@ Item {
|
||||||
// Text Size
|
// Text Size
|
||||||
font.pixelSize: headerTextPixelSize
|
font.pixelSize: headerTextPixelSize
|
||||||
// Style
|
// Style
|
||||||
font.family: ralewaySemiBold.name
|
font.family: "Raleway"
|
||||||
|
font.weight: Font.DemiBold
|
||||||
color: hifi.colors.darkGray
|
color: hifi.colors.darkGray
|
||||||
horizontalAlignment: Text.AlignHLeft
|
horizontalAlignment: Text.AlignHLeft
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
@ -101,7 +100,7 @@ Item {
|
||||||
horizontalAlignment: Text.AlignHLeft
|
horizontalAlignment: Text.AlignHLeft
|
||||||
// Style
|
// Style
|
||||||
font.pixelSize: popupTextPixelSize
|
font.pixelSize: popupTextPixelSize
|
||||||
font.family: ralewayRegular.name
|
font.family: "Raleway"
|
||||||
color: hifi.colors.darkGray
|
color: hifi.colors.darkGray
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
|
|
|
@ -23,8 +23,6 @@ Item {
|
||||||
property real popupTextPixelSize: 16
|
property real popupTextPixelSize: 16
|
||||||
property real headerTextMargin: -5
|
property real headerTextMargin: -5
|
||||||
property real headerGlyphMargin: -15
|
property real headerGlyphMargin: -15
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
|
||||||
visible: false
|
visible: false
|
||||||
id: letterbox
|
id: letterbox
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -82,7 +80,8 @@ Item {
|
||||||
// Text Size
|
// Text Size
|
||||||
font.pixelSize: headerTextPixelSize
|
font.pixelSize: headerTextPixelSize
|
||||||
// Style
|
// Style
|
||||||
font.family: ralewaySemiBold.name
|
font.family: "Raleway"
|
||||||
|
font.weight: Font.DemiBold
|
||||||
color: hifi.colors.darkGray
|
color: hifi.colors.darkGray
|
||||||
horizontalAlignment: Text.AlignHLeft
|
horizontalAlignment: Text.AlignHLeft
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
@ -127,7 +126,7 @@ Item {
|
||||||
horizontalAlignment: Text.AlignHLeft
|
horizontalAlignment: Text.AlignHLeft
|
||||||
// Style
|
// Style
|
||||||
font.pixelSize: popupTextPixelSize
|
font.pixelSize: popupTextPixelSize
|
||||||
font.family: ralewayRegular.name
|
font.family: "Raleway"
|
||||||
color: hifi.colors.darkGray
|
color: hifi.colors.darkGray
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
|
|
|
@ -177,8 +177,7 @@ Item {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: editGlyph.width + editGlyph.anchors.rightMargin
|
anchors.rightMargin: editGlyph.width + editGlyph.anchors.rightMargin
|
||||||
// Style
|
// Style
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
font.family: "Fira Sans SemiBold"
|
||||||
font.family: firaSansSemiBold.name
|
|
||||||
font.pixelSize: displayNameTextPixelSize
|
font.pixelSize: displayNameTextPixelSize
|
||||||
selectionColor: hifi.colors.blueAccent
|
selectionColor: hifi.colors.blueAccent
|
||||||
selectedTextColor: "black"
|
selectedTextColor: "black"
|
||||||
|
|
|
@ -908,7 +908,6 @@ Rectangle {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter;
|
anchors.horizontalCenter: parent.horizontalCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
Text {
|
Text {
|
||||||
id: connectionHelpText;
|
id: connectionHelpText;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -923,7 +922,7 @@ Rectangle {
|
||||||
horizontalAlignment: Text.AlignHLeft
|
horizontalAlignment: Text.AlignHLeft
|
||||||
// Style
|
// Style
|
||||||
font.pixelSize: 18;
|
font.pixelSize: 18;
|
||||||
font.family: ralewayRegular.name
|
font.family: "Raleway"
|
||||||
color: hifi.colors.darkGray
|
color: hifi.colors.darkGray
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
textFormat: Text.StyledText;
|
textFormat: Text.StyledText;
|
||||||
|
|
|
@ -112,6 +112,7 @@ Rectangle {
|
||||||
|
|
||||||
// mute is in its own row
|
// mute is in its own row
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
spacing: (margins.sizeCheckBox - 10.5) * 3;
|
||||||
AudioControls.CheckBox {
|
AudioControls.CheckBox {
|
||||||
id: muteMic
|
id: muteMic
|
||||||
text: qsTr("Mute microphone");
|
text: qsTr("Mute microphone");
|
||||||
|
@ -123,6 +124,19 @@ Rectangle {
|
||||||
checked = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
|
checked = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioControls.CheckBox {
|
||||||
|
id: stereoMic
|
||||||
|
spacing: muteMic.spacing;
|
||||||
|
text: qsTr("Enable stereo input");
|
||||||
|
checked: AudioScriptingInterface.isStereoInput();
|
||||||
|
onClicked: {
|
||||||
|
var success = AudioScriptingInterface.setStereoInput(checked);
|
||||||
|
if (!success) {
|
||||||
|
checked = !checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
@ -204,6 +218,8 @@ Rectangle {
|
||||||
text: devicename
|
text: devicename
|
||||||
onPressed: {
|
onPressed: {
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
|
stereoMic.checked = false;
|
||||||
|
AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo
|
||||||
AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1);
|
AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,8 +147,7 @@ Rectangle {
|
||||||
} else if (root.itemHref.indexOf('.json') > -1) {
|
} else if (root.itemHref.indexOf('.json') > -1) {
|
||||||
root.itemType = "entity"; // "wearable" type handled later
|
root.itemType = "entity"; // "wearable" type handled later
|
||||||
} else {
|
} else {
|
||||||
console.log("WARNING - Item type is UNKNOWN!");
|
root.itemType = "unknown";
|
||||||
root.itemType = "entity";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,10 +141,9 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
id: textMetrics;
|
id: textMetrics;
|
||||||
font.family: ralewayRegular.name
|
font.family: "Raleway"
|
||||||
text: usernameText.text;
|
text: usernameText.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,10 @@ Item {
|
||||||
hoverEnabled: true;
|
hoverEnabled: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
sendSignalToParent({method: 'maybeEnableHmdPreview'});
|
||||||
|
}
|
||||||
|
|
||||||
// This will cause a bug -- if you bring up passphrase selection in HUD mode while
|
// This will cause a bug -- if you bring up passphrase selection in HUD mode while
|
||||||
// in HMD while having HMD preview enabled, then move, then finish passphrase selection,
|
// in HMD while having HMD preview enabled, then move, then finish passphrase selection,
|
||||||
// HMD preview will stay off.
|
// HMD preview will stay off.
|
||||||
|
|
|
@ -174,11 +174,12 @@ Rectangle {
|
||||||
WalletChoice {
|
WalletChoice {
|
||||||
id: walletChoice;
|
id: walletChoice;
|
||||||
proceedFunction: function (isReset) {
|
proceedFunction: function (isReset) {
|
||||||
console.log(isReset ? "Reset wallet." : "Trying again with new wallet.");
|
console.log("WalletChoice", isReset ? "Reset wallet." : "Trying again with new wallet.");
|
||||||
Commerce.setSoftReset();
|
Commerce.setSoftReset();
|
||||||
if (isReset) {
|
if (isReset) {
|
||||||
walletResetSetup();
|
walletResetSetup();
|
||||||
} else {
|
} else {
|
||||||
|
Commerce.clearWallet();
|
||||||
var msg = { referrer: walletChoice.referrer }
|
var msg = { referrer: walletChoice.referrer }
|
||||||
followReferrer(msg);
|
followReferrer(msg);
|
||||||
}
|
}
|
||||||
|
@ -236,6 +237,8 @@ Rectangle {
|
||||||
} else {
|
} else {
|
||||||
sendToScript(msg);
|
sendToScript(msg);
|
||||||
}
|
}
|
||||||
|
} else if (msg.method === 'maybeEnableHmdPreview') {
|
||||||
|
sendToScript(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -398,6 +398,7 @@ Item {
|
||||||
//
|
//
|
||||||
Item {
|
Item {
|
||||||
id: filterBarContainer;
|
id: filterBarContainer;
|
||||||
|
visible: !connectionInstructions.visible;
|
||||||
// Size
|
// Size
|
||||||
height: 40;
|
height: 40;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -495,6 +496,78 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "Make a Connection" instructions
|
||||||
|
Rectangle {
|
||||||
|
id: connectionInstructions;
|
||||||
|
visible: connectionsModel.count === 0 && !connectionsLoading.visible;
|
||||||
|
anchors.fill: parent;
|
||||||
|
color: "white";
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
id: makeAConnectionText;
|
||||||
|
// Properties
|
||||||
|
text: "Make a Connection";
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 20;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
// Text Size
|
||||||
|
size: 24;
|
||||||
|
// Text Positioning
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.darkGray;
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: connectionImage;
|
||||||
|
source: "qrc:/icons/connection.svg";
|
||||||
|
width: 150;
|
||||||
|
height: 150;
|
||||||
|
mipmap: true;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: makeAConnectionText.bottom;
|
||||||
|
anchors.topMargin: 15;
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter;
|
||||||
|
}
|
||||||
|
|
||||||
|
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||||
|
Text {
|
||||||
|
id: connectionHelpText;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: connectionImage.bottom;
|
||||||
|
anchors.topMargin: 15;
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 40;
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 40;
|
||||||
|
// Text alignment
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHLeft
|
||||||
|
// Style
|
||||||
|
font.pixelSize: 18;
|
||||||
|
font.family: ralewayRegular.name
|
||||||
|
color: hifi.colors.darkGray
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
textFormat: Text.StyledText;
|
||||||
|
property string instructions:
|
||||||
|
"<b>When you meet someone you want to remember later, you can <font color='purple'>connect</font> with a handshake:</b><br><br>"
|
||||||
|
property string hmdMountedInstructions:
|
||||||
|
"1. Put your hand out onto their hand and squeeze your controller's grip button on its side.<br>" +
|
||||||
|
"2. Once the other person puts their hand onto yours, you'll see your connection form.<br>" +
|
||||||
|
"3. After about 3 seconds, you're connected!"
|
||||||
|
property string hmdNotMountedInstructions:
|
||||||
|
"1. Press and hold the 'x' key to extend your arm.<br>" +
|
||||||
|
"2. Once the other person puts their hand onto yours, you'll see your connection form.<br>" +
|
||||||
|
"3. After about 3 seconds, you're connected!";
|
||||||
|
// Text
|
||||||
|
text:
|
||||||
|
HMD.mounted ? instructions + hmdMountedInstructions : instructions + hmdNotMountedInstructions
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -925,13 +998,12 @@ Item {
|
||||||
anchors.rightMargin: 20;
|
anchors.rightMargin: 20;
|
||||||
height: 95;
|
height: 95;
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
TextArea {
|
TextArea {
|
||||||
id: optionalMessage;
|
id: optionalMessage;
|
||||||
property int maximumLength: 72;
|
property int maximumLength: 72;
|
||||||
property string previousText: text;
|
property string previousText: text;
|
||||||
placeholderText: "<i>Optional Public Message (" + maximumLength + " character limit)</i>";
|
placeholderText: "<i>Optional Public Message (" + maximumLength + " character limit)</i>";
|
||||||
font.family: firaSansSemiBold.name;
|
font.family: "Fira Sans SemiBold";
|
||||||
font.pixelSize: 20;
|
font.pixelSize: 20;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import QtQuick 2.5
|
|
||||||
import Qt.labs.settings 1.0
|
|
||||||
|
|
||||||
import "../../dialogs"
|
|
||||||
|
|
||||||
PreferencesDialog {
|
|
||||||
id: root
|
|
||||||
objectName: "GraphicsPreferencesDialog"
|
|
||||||
title: "Graphics Settings"
|
|
||||||
showCategories: ["Graphics"]
|
|
||||||
property var settings: Settings {
|
|
||||||
category: root.objectName
|
|
||||||
property alias x: root.x
|
|
||||||
property alias y: root.y
|
|
||||||
property alias width: root.width
|
|
||||||
property alias height: root.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -659,8 +659,7 @@ Rectangle {
|
||||||
|
|
||||||
text: styleData.value
|
text: styleData.value
|
||||||
|
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
font.family: "Fira Sans SemiBold"
|
||||||
font.family: firaSansSemiBold.name
|
|
||||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||||
height: hifi.dimensions.tableRowHeight
|
height: hifi.dimensions.tableRowHeight
|
||||||
|
|
||||||
|
|
|
@ -478,9 +478,6 @@ Rectangle {
|
||||||
itemDelegate: Item {
|
itemDelegate: Item {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
//FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
//FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
|
||||||
|
|
||||||
FiraSansSemiBold {
|
FiraSansSemiBold {
|
||||||
text: getText();
|
text: getText();
|
||||||
elide: styleData.elideMode
|
elide: styleData.elideMode
|
||||||
|
@ -494,7 +491,7 @@ Rectangle {
|
||||||
size: hifi.fontSizes.tableText
|
size: hifi.fontSizes.tableText
|
||||||
color: hifi.colors.baseGrayHighlight
|
color: hifi.colors.baseGrayHighlight
|
||||||
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||||
//? firaSansSemiBold.name : firaSansRegular.name
|
//? "Fira Sans SemiBold" : "Fira Sans"
|
||||||
|
|
||||||
function getText() {
|
function getText() {
|
||||||
if (styleData.row === -1) {
|
if (styleData.row === -1) {
|
||||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: anonymousProRegular; source: "qrc:/fonts/AnonymousPro-Regular.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: anonymousProRegular.name
|
font.family: "Anonymous Pro"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: firaSansRegular.name
|
font.family: "Fira Sans"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: firaSansSemiBold.name
|
font.family: "Fira Sans SemiBold"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,11 @@ import QtQuick 2.5
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: hiFiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
|
||||||
property int size: 32
|
property int size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
width: size
|
width: size
|
||||||
height: size
|
height: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: hiFiGlyphs.name
|
font.family: "hifi-glyphs"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,10 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: ralewayBold; source: "qrc:/fonts/Raleway-Bold.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: ralewayBold.name
|
font.family: "Raleway"
|
||||||
font.bold: true // Font seems to need this in order to display bold.
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: ralewayLight; source: "qrc:/fonts/Raleway-Light.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: ralewayLight.name
|
font.family: "Raleway Light"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: ralewayRegular.name
|
font.family: "Raleway"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,10 @@ import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: root
|
id: root
|
||||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
|
||||||
property real size: 32
|
property real size: 32
|
||||||
font.pixelSize: size
|
font.pixelSize: size
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.family: ralewaySemiBold.name
|
font.family: "Raleway"
|
||||||
|
font.weight: Font.DemiBold
|
||||||
}
|
}
|
||||||
|
|
|
@ -891,7 +891,7 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
|
||||||
|
|
||||||
Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
|
Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
|
||||||
|
|
||||||
const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 100.0f;
|
const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 70.0f;
|
||||||
const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
|
const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
|
||||||
const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
|
const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
|
||||||
const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
|
const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
|
||||||
|
@ -981,6 +981,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
qInstallMessageHandler(messageHandler);
|
qInstallMessageHandler(messageHandler);
|
||||||
|
|
||||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/fontawesome-webfont.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/hifi-glyphs.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/AnonymousPro-Regular.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-Regular.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-SemiBold.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Light.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Regular.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Bold.ttf");
|
||||||
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-SemiBold.ttf");
|
||||||
_window->setWindowTitle("High Fidelity Interface");
|
_window->setWindowTitle("High Fidelity Interface");
|
||||||
|
|
||||||
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
||||||
|
@ -6636,17 +6645,17 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo
|
||||||
|
|
||||||
addAssetToWorldInfo(filename, "Adding " + mapping.mid(1) + " to the Asset Server.");
|
addAssetToWorldInfo(filename, "Adding " + mapping.mid(1) + " to the Asset Server.");
|
||||||
|
|
||||||
addAssetToWorldWithNewMapping(path, mapping, 0);
|
addAssetToWorldWithNewMapping(path, mapping, 0, isZip, isBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy) {
|
void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip, bool isBlocks) {
|
||||||
auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(mapping);
|
auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(mapping);
|
||||||
|
|
||||||
QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
|
QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
|
||||||
const int MAX_COPY_COUNT = 100; // Limit number of duplicate assets; recursion guard.
|
const int MAX_COPY_COUNT = 100; // Limit number of duplicate assets; recursion guard.
|
||||||
auto result = request->getError();
|
auto result = request->getError();
|
||||||
if (result == GetMappingRequest::NotFound) {
|
if (result == GetMappingRequest::NotFound) {
|
||||||
addAssetToWorldUpload(filePath, mapping);
|
addAssetToWorldUpload(filePath, mapping, isZip, isBlocks);
|
||||||
} else if (result != GetMappingRequest::NoError) {
|
} else if (result != GetMappingRequest::NoError) {
|
||||||
QString errorInfo = "Could not map asset name: "
|
QString errorInfo = "Could not map asset name: "
|
||||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||||
|
@ -6658,7 +6667,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin
|
||||||
}
|
}
|
||||||
copy++;
|
copy++;
|
||||||
mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
|
mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
|
||||||
addAssetToWorldWithNewMapping(filePath, mapping, copy);
|
addAssetToWorldWithNewMapping(filePath, mapping, copy, isZip, isBlocks);
|
||||||
} else {
|
} else {
|
||||||
QString errorInfo = "Too many copies of asset name: "
|
QString errorInfo = "Too many copies of asset name: "
|
||||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||||
|
@ -6671,7 +6680,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin
|
||||||
request->start();
|
request->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
void Application::addAssetToWorldUpload(QString filePath, QString mapping, bool isZip, bool isBlocks) {
|
||||||
qInfo(interfaceapp) << "Uploading" << filePath << "to Asset Server as" << mapping;
|
qInfo(interfaceapp) << "Uploading" << filePath << "to Asset Server as" << mapping;
|
||||||
auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
|
auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
|
||||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||||
|
@ -6680,7 +6689,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
||||||
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
||||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||||
} else {
|
} else {
|
||||||
addAssetToWorldSetMapping(filePath, mapping, hash);
|
addAssetToWorldSetMapping(filePath, mapping, hash, isZip, isBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove temporary directory created by Clara.io market place download.
|
// Remove temporary directory created by Clara.io market place download.
|
||||||
|
@ -6697,7 +6706,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
||||||
upload->start();
|
upload->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash) {
|
void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip, bool isBlocks) {
|
||||||
auto request = DependencyManager::get<AssetClient>()->createSetMappingRequest(mapping, hash);
|
auto request = DependencyManager::get<AssetClient>()->createSetMappingRequest(mapping, hash);
|
||||||
connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
|
connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
|
||||||
if (request->getError() != SetMappingRequest::NoError) {
|
if (request->getError() != SetMappingRequest::NoError) {
|
||||||
|
@ -6705,9 +6714,10 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q
|
||||||
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
||||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||||
} else {
|
} else {
|
||||||
// to prevent files that aren't models from being loaded into world automatically
|
// to prevent files that aren't models or texture files from being loaded into world automatically
|
||||||
if (filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION) ||
|
if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
|
||||||
filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) {
|
((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
|
||||||
|
((!isBlocks) && (!isZip)))) {
|
||||||
addAssetToWorldAddEntity(filePath, mapping);
|
addAssetToWorldAddEntity(filePath, mapping);
|
||||||
} else {
|
} else {
|
||||||
qCDebug(interfaceapp) << "Zipped contents are not supported entity files";
|
qCDebug(interfaceapp) << "Zipped contents are not supported entity files";
|
||||||
|
|
|
@ -321,11 +321,11 @@ public slots:
|
||||||
// FIXME: Move addAssetToWorld* methods to own class?
|
// FIXME: Move addAssetToWorld* methods to own class?
|
||||||
void addAssetToWorldFromURL(QString url);
|
void addAssetToWorldFromURL(QString url);
|
||||||
void addAssetToWorldFromURLRequestFinished();
|
void addAssetToWorldFromURLRequestFinished();
|
||||||
void addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks);
|
void addAssetToWorld(QString filePath, QString zipFile, bool isZip = false, bool isBlocks = false);
|
||||||
void addAssetToWorldUnzipFailure(QString filePath);
|
void addAssetToWorldUnzipFailure(QString filePath);
|
||||||
void addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy);
|
void addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip = false, bool isBlocks = false);
|
||||||
void addAssetToWorldUpload(QString filePath, QString mapping);
|
void addAssetToWorldUpload(QString filePath, QString mapping, bool isZip = false, bool isBlocks = false);
|
||||||
void addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash);
|
void addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip = false, bool isBlocks = false);
|
||||||
void addAssetToWorldAddEntity(QString filePath, QString mapping);
|
void addAssetToWorldAddEntity(QString filePath, QString mapping);
|
||||||
|
|
||||||
void handleUnzip(QString sourceFile, QStringList destinationFile, bool autoAdd, bool isZip, bool isBlocks);
|
void handleUnzip(QString sourceFile, QStringList destinationFile, bool autoAdd, bool isZip, bool isBlocks);
|
||||||
|
|
|
@ -43,6 +43,10 @@
|
||||||
#include "ui/StandAloneJSConsole.h"
|
#include "ui/StandAloneJSConsole.h"
|
||||||
#include "InterfaceLogging.h"
|
#include "InterfaceLogging.h"
|
||||||
#include "LocationBookmarks.h"
|
#include "LocationBookmarks.h"
|
||||||
|
#include "DeferredLightingEffect.h"
|
||||||
|
|
||||||
|
#include "AmbientOcclusionEffect.h"
|
||||||
|
#include "RenderShadowTask.h"
|
||||||
|
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
#include "SpeechRecognizer.h"
|
#include "SpeechRecognizer.h"
|
||||||
|
@ -360,13 +364,6 @@ Menu::Menu() {
|
||||||
// Developer menu ----------------------------------
|
// Developer menu ----------------------------------
|
||||||
MenuWrapper* developerMenu = addMenu("Developer", "Developer");
|
MenuWrapper* developerMenu = addMenu("Developer", "Developer");
|
||||||
|
|
||||||
// Developer > Graphics...
|
|
||||||
action = addActionToQMenuAndActionHash(developerMenu, "Graphics...");
|
|
||||||
connect(action, &QAction::triggered, [] {
|
|
||||||
qApp->showDialog(QString("hifi/dialogs/GraphicsPreferencesDialog.qml"),
|
|
||||||
QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");
|
|
||||||
});
|
|
||||||
|
|
||||||
// Developer > UI >>>
|
// Developer > UI >>>
|
||||||
MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
|
MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
|
||||||
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
|
action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
|
||||||
|
@ -383,6 +380,36 @@ Menu::Menu() {
|
||||||
|
|
||||||
// Developer > Render >>>
|
// Developer > Render >>>
|
||||||
MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
|
MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
|
||||||
|
action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, true);
|
||||||
|
connect(action, &QAction::triggered, [action] {
|
||||||
|
auto renderConfig = qApp->getRenderEngine()->getConfiguration();
|
||||||
|
if (renderConfig) {
|
||||||
|
auto mainViewShadowTaskConfig = renderConfig->getConfig<RenderShadowTask>("RenderMainView.RenderShadowTask");
|
||||||
|
if (mainViewShadowTaskConfig) {
|
||||||
|
if (action->isChecked()) {
|
||||||
|
mainViewShadowTaskConfig->setPreset("Enabled");
|
||||||
|
} else {
|
||||||
|
mainViewShadowTaskConfig->setPreset("None");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion, 0, false);
|
||||||
|
connect(action, &QAction::triggered, [action] {
|
||||||
|
auto renderConfig = qApp->getRenderEngine()->getConfiguration();
|
||||||
|
if (renderConfig) {
|
||||||
|
auto mainViewAmbientOcclusionConfig = renderConfig->getConfig<AmbientOcclusionEffect>("RenderMainView.AmbientOcclusion");
|
||||||
|
if (mainViewAmbientOcclusionConfig) {
|
||||||
|
if (action->isChecked()) {
|
||||||
|
mainViewAmbientOcclusionConfig->setPreset("Enabled");
|
||||||
|
} else {
|
||||||
|
mainViewAmbientOcclusionConfig->setPreset("None");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::WorldAxes);
|
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::WorldAxes);
|
||||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DefaultSkybox, 0, true);
|
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DefaultSkybox, 0, true);
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,8 @@ namespace MenuOption {
|
||||||
const QString WorldAxes = "World Axes";
|
const QString WorldAxes = "World Axes";
|
||||||
const QString DesktopTabletToToolbar = "Desktop Tablet Becomes Toolbar";
|
const QString DesktopTabletToToolbar = "Desktop Tablet Becomes Toolbar";
|
||||||
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
||||||
|
const QString Shadows = "Shadows";
|
||||||
|
const QString AmbientOcclusion = "Ambient Occlusion";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // hifi_Menu_h
|
#endif // hifi_Menu_h
|
||||||
|
|
|
@ -1848,12 +1848,6 @@ void MyAvatar::attach(const QString& modelURL, const QString& jointName,
|
||||||
Avatar::attach(modelURL, jointName, translation, rotation, scale, isSoft, allowDuplicates, useSaved);
|
Avatar::attach(modelURL, jointName, translation, rotation, scale, isSoft, allowDuplicates, useSaved);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setVisibleInSceneIfReady(Model* model, const render::ScenePointer& scene, bool visible) {
|
|
||||||
if (model->isActive() && model->isRenderable()) {
|
|
||||||
model->setVisibleInScene(visible, scene, render::ItemKey::TAG_BITS_NONE, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyAvatar::initHeadBones() {
|
void MyAvatar::initHeadBones() {
|
||||||
int neckJointIndex = -1;
|
int neckJointIndex = -1;
|
||||||
if (_skeletonModel->isLoaded()) {
|
if (_skeletonModel->isLoaded()) {
|
||||||
|
@ -2043,8 +2037,12 @@ void MyAvatar::preDisplaySide(RenderArgs* renderArgs) {
|
||||||
_attachmentData[i].jointName.compare("RightEye", Qt::CaseInsensitive) == 0 ||
|
_attachmentData[i].jointName.compare("RightEye", Qt::CaseInsensitive) == 0 ||
|
||||||
_attachmentData[i].jointName.compare("HeadTop_End", Qt::CaseInsensitive) == 0 ||
|
_attachmentData[i].jointName.compare("HeadTop_End", Qt::CaseInsensitive) == 0 ||
|
||||||
_attachmentData[i].jointName.compare("Face", Qt::CaseInsensitive) == 0) {
|
_attachmentData[i].jointName.compare("Face", Qt::CaseInsensitive) == 0) {
|
||||||
|
|
||||||
_attachmentModels[i]->setVisibleInScene(shouldDrawHead, qApp->getMain3DScene(),
|
_attachmentModels[i]->setVisibleInScene(shouldDrawHead, qApp->getMain3DScene(),
|
||||||
render::ItemKey::TAG_BITS_NONE, true);
|
render::ItemKey::TAG_BITS_NONE, true);
|
||||||
|
|
||||||
|
_attachmentModels[i]->setCanCastShadow(shouldDrawHead, qApp->getMain3DScene(),
|
||||||
|
render::ItemKey::TAG_BITS_NONE, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,7 +346,7 @@ public:
|
||||||
* restoreRoleAnimation() is used to restore a specified animation role's default animation clip. If you have not specified an override animation
|
* restoreRoleAnimation() is used to restore a specified animation role's default animation clip. If you have not specified an override animation
|
||||||
* for the specified role, this function will have no effect.
|
* for the specified role, this function will have no effect.
|
||||||
* @function MyAvatar.restoreRoleAnimation
|
* @function MyAvatar.restoreRoleAnimation
|
||||||
* @param rule {string} The animation role clip to restore
|
* @param role {string} The animation role clip to restore
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void restoreRoleAnimation(const QString& role);
|
Q_INVOKABLE void restoreRoleAnimation(const QString& role);
|
||||||
|
|
||||||
|
@ -681,8 +681,6 @@ private:
|
||||||
// These are made private for MyAvatar so that you will use the "use" methods instead
|
// These are made private for MyAvatar so that you will use the "use" methods instead
|
||||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
||||||
|
|
||||||
void setVisibleInSceneIfReady(Model* model, const render::ScenePointer& scene, bool visiblity);
|
|
||||||
|
|
||||||
virtual void updatePalms() override {}
|
virtual void updatePalms() override {}
|
||||||
void lateUpdatePalms();
|
void lateUpdatePalms();
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,13 @@ void Ledger::signedSend(const QString& propertyName, const QByteArray& text, con
|
||||||
|
|
||||||
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail, QJsonObject& requestParams) {
|
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail, QJsonObject& requestParams) {
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
requestParams["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||||
|
if (!cachedPublicKeys.isEmpty()) {
|
||||||
send(endpoint, success, fail, QNetworkAccessManager::PostOperation, AccountManagerAuth::Required, requestParams);
|
requestParams["public_keys"] = QJsonArray::fromStringList(cachedPublicKeys);
|
||||||
|
send(endpoint, success, fail, QNetworkAccessManager::PostOperation, AccountManagerAuth::Required, requestParams);
|
||||||
|
} else {
|
||||||
|
qDebug(commerce) << "User attempted to call keysQuery, but cachedPublicKeys was empty!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail) {
|
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail) {
|
||||||
|
@ -296,14 +300,18 @@ void Ledger::updateLocation(const QString& asset_id, const QString location, con
|
||||||
emit walletScriptingInterface->walletNotSetup();
|
emit walletScriptingInterface->walletNotSetup();
|
||||||
qDebug(commerce) << "User attempted to update the location of a certificate, but their wallet wasn't ready. Status:" << walletStatus;
|
qDebug(commerce) << "User attempted to update the location of a certificate, but their wallet wasn't ready. Status:" << walletStatus;
|
||||||
} else {
|
} else {
|
||||||
QStringList keys = wallet->listPublicKeys();
|
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||||
QString key = keys[0];
|
if (!cachedPublicKeys.isEmpty()) {
|
||||||
QJsonObject transaction;
|
QString key = cachedPublicKeys[0];
|
||||||
transaction["certificate_id"] = asset_id;
|
QJsonObject transaction;
|
||||||
transaction["place_name"] = location;
|
transaction["certificate_id"] = asset_id;
|
||||||
QJsonDocument transactionDoc{ transaction };
|
transaction["place_name"] = location;
|
||||||
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
|
QJsonDocument transactionDoc{ transaction };
|
||||||
signedSend("transaction", transactionString, key, "location", "updateLocationSuccess", "updateLocationFailure", controlledFailure);
|
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
|
||||||
|
signedSend("transaction", transactionString, key, "location", "updateLocationSuccess", "updateLocationFailure", controlledFailure);
|
||||||
|
} else {
|
||||||
|
qDebug(commerce) << "User attempted to update the location of a certificate, but cachedPublicKeys was empty!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +367,12 @@ void Ledger::alreadyOwned(const QString& marketplaceId) {
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
QString endpoint = "already_owned";
|
QString endpoint = "already_owned";
|
||||||
QJsonObject request;
|
QJsonObject request;
|
||||||
request["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||||
request["marketplace_item_id"] = marketplaceId;
|
if (!cachedPublicKeys.isEmpty()) {
|
||||||
send(endpoint, "alreadyOwnedSuccess", "alreadyOwnedFailure", QNetworkAccessManager::PutOperation, AccountManagerAuth::Required, request);
|
request["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
||||||
|
request["marketplace_item_id"] = marketplaceId;
|
||||||
|
send(endpoint, "alreadyOwnedSuccess", "alreadyOwnedFailure", QNetworkAccessManager::PutOperation, AccountManagerAuth::Required, request);
|
||||||
|
} else {
|
||||||
|
qDebug(commerce) << "User attempted to use the alreadyOwned endpoint, but cachedPublicKeys was empty!";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,11 @@ void QmlCommerce::setSoftReset() {
|
||||||
wallet->setSoftReset();
|
wallet->setSoftReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlCommerce::clearWallet() {
|
||||||
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
|
wallet->clear();
|
||||||
|
}
|
||||||
|
|
||||||
void QmlCommerce::setPassphrase(const QString& passphrase) {
|
void QmlCommerce::setPassphrase(const QString& passphrase) {
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
wallet->setPassphrase(passphrase);
|
wallet->setPassphrase(passphrase);
|
||||||
|
|
|
@ -67,6 +67,7 @@ protected:
|
||||||
Q_INVOKABLE void setPassphrase(const QString& passphrase);
|
Q_INVOKABLE void setPassphrase(const QString& passphrase);
|
||||||
Q_INVOKABLE void changePassphrase(const QString& oldPassphrase, const QString& newPassphrase);
|
Q_INVOKABLE void changePassphrase(const QString& oldPassphrase, const QString& newPassphrase);
|
||||||
Q_INVOKABLE void setSoftReset();
|
Q_INVOKABLE void setSoftReset();
|
||||||
|
Q_INVOKABLE void clearWallet();
|
||||||
|
|
||||||
Q_INVOKABLE void buy(const QString& assetId, int cost, const bool controlledFailure = false);
|
Q_INVOKABLE void buy(const QString& assetId, int cost, const bool controlledFailure = false);
|
||||||
Q_INVOKABLE void balance();
|
Q_INVOKABLE void balance();
|
||||||
|
|
|
@ -343,19 +343,23 @@ Wallet::Wallet() {
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
connect(accountManager.data(), &AccountManager::usernameChanged, this, [&]() {
|
connect(accountManager.data(), &AccountManager::usernameChanged, this, [&]() {
|
||||||
getWalletStatus();
|
getWalletStatus();
|
||||||
_publicKeys.clear();
|
clear();
|
||||||
|
|
||||||
if (_securityImage) {
|
|
||||||
delete _securityImage;
|
|
||||||
}
|
|
||||||
_securityImage = nullptr;
|
|
||||||
|
|
||||||
// tell the provider we got nothing
|
|
||||||
updateImageProvider();
|
|
||||||
_passphrase->clear();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Wallet::clear() {
|
||||||
|
_publicKeys.clear();
|
||||||
|
|
||||||
|
if (_securityImage) {
|
||||||
|
delete _securityImage;
|
||||||
|
}
|
||||||
|
_securityImage = nullptr;
|
||||||
|
|
||||||
|
// tell the provider we got nothing
|
||||||
|
updateImageProvider();
|
||||||
|
_passphrase->clear();
|
||||||
|
}
|
||||||
|
|
||||||
Wallet::~Wallet() {
|
Wallet::~Wallet() {
|
||||||
if (_securityImage) {
|
if (_securityImage) {
|
||||||
delete _securityImage;
|
delete _securityImage;
|
||||||
|
|
|
@ -49,8 +49,9 @@ public:
|
||||||
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
||||||
bool walletIsAuthenticatedWithPassphrase();
|
bool walletIsAuthenticatedWithPassphrase();
|
||||||
bool changePassphrase(const QString& newPassphrase);
|
bool changePassphrase(const QString& newPassphrase);
|
||||||
void setSoftReset() { _isOverridingServer = true; }
|
void setSoftReset() { _isOverridingServer = true; }
|
||||||
bool wasSoftReset() { bool was = _isOverridingServer; _isOverridingServer = false; return was; }
|
bool wasSoftReset() { bool was = _isOverridingServer; _isOverridingServer = false; return was; }
|
||||||
|
void clear();
|
||||||
|
|
||||||
void getWalletStatus();
|
void getWalletStatus();
|
||||||
enum WalletStatus {
|
enum WalletStatus {
|
||||||
|
|
|
@ -175,3 +175,11 @@ void PickScriptingInterface::registerMetaTypes(QScriptEngine* engine) {
|
||||||
|
|
||||||
qScriptRegisterMetaType(engine, pickTypesToScriptValue, pickTypesFromScriptValue);
|
qScriptRegisterMetaType(engine, pickTypesToScriptValue, pickTypesFromScriptValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int PickScriptingInterface::getPerFrameTimeBudget() const {
|
||||||
|
return DependencyManager::get<PickManager>()->getPerFrameTimeBudget();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PickScriptingInterface::setPerFrameTimeBudget(unsigned int numUsecs) {
|
||||||
|
DependencyManager::get<PickManager>()->setPerFrameTimeBudget(numUsecs);
|
||||||
|
}
|
||||||
|
|
|
@ -185,6 +185,14 @@ public:
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool isMouse(unsigned int uid);
|
Q_INVOKABLE bool isMouse(unsigned int uid);
|
||||||
|
|
||||||
|
Q_PROPERTY(unsigned int perFrameTimeBudget READ getPerFrameTimeBudget WRITE setPerFrameTimeBudget)
|
||||||
|
/**jsdoc
|
||||||
|
* The max number of usec to spend per frame updating Pick results.
|
||||||
|
* @typedef {number} Picks.perFrameTimeBudget
|
||||||
|
*/
|
||||||
|
unsigned int getPerFrameTimeBudget() const;
|
||||||
|
void setPerFrameTimeBudget(unsigned int numUsecs);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static constexpr unsigned int PICK_NOTHING() { return 0; }
|
static constexpr unsigned int PICK_NOTHING() { return 0; }
|
||||||
static constexpr unsigned int PICK_ENTITIES() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ENTITIES); }
|
static constexpr unsigned int PICK_ENTITIES() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ENTITIES); }
|
||||||
|
|
|
@ -259,7 +259,6 @@ void WindowScriptingInterface::browseAsync(const QString& title, const QString&
|
||||||
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
||||||
}
|
}
|
||||||
emit browseChanged(result);
|
emit browseChanged(result);
|
||||||
emit openFileChanged(result); // Deprecated signal; to be removed in due course.
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,6 @@ public slots:
|
||||||
* Prompt the user to choose a file. Displays a non-modal dialog that navigates the directory tree. A
|
* Prompt the user to choose a file. Displays a non-modal dialog that navigates the directory tree. A
|
||||||
* {@link Window.browseChanged|browseChanged} signal is emitted when a file is chosen; no signal is emitted if the user
|
* {@link Window.browseChanged|browseChanged} signal is emitted when a file is chosen; no signal is emitted if the user
|
||||||
* cancels the dialog.
|
* cancels the dialog.
|
||||||
* @deprecated A deprecated {@link Window.openFileChanged|openFileChanged} signal is also emitted when a file is chosen.
|
|
||||||
* @function Window.browseAsync
|
* @function Window.browseAsync
|
||||||
* @param {string} title="" - The title to display at the top of the dialog.
|
* @param {string} title="" - The title to display at the top of the dialog.
|
||||||
* @param {string} directory="" - The initial directory to start browsing at.
|
* @param {string} directory="" - The initial directory to start browsing at.
|
||||||
|
@ -660,15 +659,6 @@ signals:
|
||||||
*/
|
*/
|
||||||
void browseChanged(QString filename);
|
void browseChanged(QString filename);
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* Triggered when the user chooses a file in a {@link Window.browseAsync|browseAsync} dialog.
|
|
||||||
* @function Window.openFileChanged
|
|
||||||
* @deprecated This signal is being replaced with {@link Window.browseChanged|browseChanged} and will be removed.
|
|
||||||
* @param {string} filename - The path and name of the file the user chose in the dialog.
|
|
||||||
* @returns {Signal}
|
|
||||||
*/
|
|
||||||
void openFileChanged(QString filename);
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the user OKs a {@link Window.promptAsync|promptAsync} dialog.
|
* Triggered when the user OKs a {@link Window.promptAsync|promptAsync} dialog.
|
||||||
* @function Window.promptTextChanged
|
* @function Window.promptTextChanged
|
||||||
|
|
|
@ -24,10 +24,6 @@
|
||||||
#include "SnapshotAnimated.h"
|
#include "SnapshotAnimated.h"
|
||||||
#include "UserActivityLogger.h"
|
#include "UserActivityLogger.h"
|
||||||
|
|
||||||
#include "AmbientOcclusionEffect.h"
|
|
||||||
#include "AntialiasingEffect.h"
|
|
||||||
#include "RenderShadowTask.h"
|
|
||||||
|
|
||||||
void setupPreferences() {
|
void setupPreferences() {
|
||||||
auto preferences = DependencyManager::get<Preferences>();
|
auto preferences = DependencyManager::get<Preferences>();
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
@ -295,30 +291,6 @@ void setupPreferences() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
static const QString RENDER("Graphics");
|
|
||||||
auto renderConfig = qApp->getRenderEngine()->getConfiguration();
|
|
||||||
if (renderConfig) {
|
|
||||||
auto mainViewAmbientOcclusionConfig = renderConfig->getConfig<AmbientOcclusionEffect>("RenderMainView.AmbientOcclusion");
|
|
||||||
if (mainViewAmbientOcclusionConfig) {
|
|
||||||
auto getter = [mainViewAmbientOcclusionConfig]()->QString { return mainViewAmbientOcclusionConfig->getPreset(); };
|
|
||||||
auto setter = [mainViewAmbientOcclusionConfig](QString preset) { mainViewAmbientOcclusionConfig->setPreset(preset); };
|
|
||||||
auto preference = new ComboBoxPreference(RENDER, "Ambient occlusion", getter, setter);
|
|
||||||
preference->setItems(mainViewAmbientOcclusionConfig->getPresetList());
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto mainViewShadowConfig = renderConfig->getConfig<RenderShadowTask>("RenderMainView.RenderShadowTask");
|
|
||||||
if (mainViewShadowConfig) {
|
|
||||||
auto getter = [mainViewShadowConfig]()->QString { return mainViewShadowConfig->getPreset(); };
|
|
||||||
auto setter = [mainViewShadowConfig](QString preset) { mainViewShadowConfig->setPreset(preset); };
|
|
||||||
auto preference = new ComboBoxPreference(RENDER, "Shadows", getter, setter);
|
|
||||||
preference->setItems(mainViewShadowConfig->getPresetList());
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
static const QString NETWORKING("Networking");
|
static const QString NETWORKING("Networking");
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ void Stats::updateStats(bool force) {
|
||||||
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||||
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
|
||||||
|
|
||||||
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "pickManager", "postUpdateLambdas", "misc" };
|
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" };
|
||||||
for (int32_t j = 0; j < categories.size(); ++j) {
|
for (int32_t j = 0; j < categories.size(); ++j) {
|
||||||
QString recordKey = "/idle/update/" + categories[j];
|
QString recordKey = "/idle/update/" + categories[j];
|
||||||
itr = allRecords.find(recordKey);
|
itr = allRecords.find(recordKey);
|
||||||
|
@ -499,39 +499,10 @@ void Stats::updateStats(bool force) {
|
||||||
_gameUpdateStats = "";
|
_gameUpdateStats = "";
|
||||||
emit gameUpdateStatsChanged();
|
emit gameUpdateStatsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
itr = allRecords.find("/paintGL/display/EngineRun/Engine");
|
|
||||||
std::priority_queue<SortableStat> renderEngineStats;
|
|
||||||
if (itr != allRecords.end()) {
|
|
||||||
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
|
||||||
_renderEngineStats = QString("/render = %1 ms").arg(dt);
|
|
||||||
|
|
||||||
QVector<QString> categories = { "RenderMainView", "SecondaryCameraJob", "UpdateScene"};
|
|
||||||
for (int32_t j = 0; j < categories.size(); ++j) {
|
|
||||||
QString recordKey = "/paintGL/display/EngineRun/Engine/" + categories[j];
|
|
||||||
itr = allRecords.find(recordKey);
|
|
||||||
if (itr != allRecords.end()) {
|
|
||||||
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
|
||||||
QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt);
|
|
||||||
renderEngineStats.push(SortableStat(message, dt));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (!renderEngineStats.empty()) {
|
|
||||||
SortableStat stat = renderEngineStats.top();
|
|
||||||
_renderEngineStats += stat.message;
|
|
||||||
renderEngineStats.pop();
|
|
||||||
}
|
|
||||||
emit renderEngineStatsChanged();
|
|
||||||
} else if (_renderEngineStats != "") {
|
|
||||||
_renderEngineStats = "";
|
|
||||||
emit renderEngineStatsChanged();
|
|
||||||
}
|
|
||||||
} else if (_showGameUpdateStats) {
|
} else if (_showGameUpdateStats) {
|
||||||
_showGameUpdateStats = false;
|
_showGameUpdateStats = false;
|
||||||
_gameUpdateStats = "";
|
_gameUpdateStats = "";
|
||||||
_renderEngineStats = "";
|
|
||||||
emit gameUpdateStatsChanged();
|
emit gameUpdateStatsChanged();
|
||||||
emit renderEngineStatsChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,6 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(QString, lodStatus, QString())
|
STATS_PROPERTY(QString, lodStatus, QString())
|
||||||
STATS_PROPERTY(QString, timingStats, QString())
|
STATS_PROPERTY(QString, timingStats, QString())
|
||||||
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
||||||
STATS_PROPERTY(QString, renderEngineStats, QString())
|
|
||||||
STATS_PROPERTY(int, serverElements, 0)
|
STATS_PROPERTY(int, serverElements, 0)
|
||||||
STATS_PROPERTY(int, serverInternal, 0)
|
STATS_PROPERTY(int, serverInternal, 0)
|
||||||
STATS_PROPERTY(int, serverLeaves, 0)
|
STATS_PROPERTY(int, serverLeaves, 0)
|
||||||
|
@ -240,7 +239,6 @@ signals:
|
||||||
void localLeavesChanged();
|
void localLeavesChanged();
|
||||||
void timingStatsChanged();
|
void timingStatsChanged();
|
||||||
void gameUpdateStatsChanged();
|
void gameUpdateStatsChanged();
|
||||||
void renderEngineStatsChanged();
|
|
||||||
void glContextSwapchainMemoryChanged();
|
void glContextSwapchainMemoryChanged();
|
||||||
void qmlTextureMemoryChanged();
|
void qmlTextureMemoryChanged();
|
||||||
void texturePendingTransfersChanged();
|
void texturePendingTransfersChanged();
|
||||||
|
|
|
@ -681,5 +681,9 @@ scriptable::ScriptableModelBase ModelOverlay::getScriptableModel() {
|
||||||
}
|
}
|
||||||
auto result = _model->getScriptableModel();
|
auto result = _model->getScriptableModel();
|
||||||
result.objectID = getID();
|
result.objectID = getID();
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
result.appendMaterials(_materials);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1397,9 +1397,11 @@ void AudioClient::setNoiseReduction(bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AudioClient::setIsStereoInput(bool isStereoInput) {
|
bool AudioClient::setIsStereoInput(bool isStereoInput) {
|
||||||
if (isStereoInput != _isStereoInput) {
|
bool stereoInputChanged = false;
|
||||||
|
if (isStereoInput != _isStereoInput && _inputDeviceInfo.supportedChannelCounts().contains(2)) {
|
||||||
_isStereoInput = isStereoInput;
|
_isStereoInput = isStereoInput;
|
||||||
|
stereoInputChanged = true;
|
||||||
|
|
||||||
if (_isStereoInput) {
|
if (_isStereoInput) {
|
||||||
_desiredInputFormat.setChannelCount(2);
|
_desiredInputFormat.setChannelCount(2);
|
||||||
|
@ -1419,6 +1421,8 @@ void AudioClient::setIsStereoInput(bool isStereoInput) {
|
||||||
// restart the input device
|
// restart the input device
|
||||||
switchInputToAudioDevice(_inputDeviceInfo);
|
switchInputToAudioDevice(_inputDeviceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return stereoInputChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioClient::outputLocalInjector(const AudioInjectorPointer& injector) {
|
bool AudioClient::outputLocalInjector(const AudioInjectorPointer& injector) {
|
||||||
|
|
|
@ -192,7 +192,8 @@ public slots:
|
||||||
void toggleMute();
|
void toggleMute();
|
||||||
bool isMuted() { return _muted; }
|
bool isMuted() { return _muted; }
|
||||||
|
|
||||||
virtual void setIsStereoInput(bool stereo) override;
|
virtual bool setIsStereoInput(bool stereo) override;
|
||||||
|
virtual bool isStereoInput() override { return _isStereoInput; }
|
||||||
|
|
||||||
void setNoiseReduction(bool isNoiseGateEnabled);
|
void setNoiseReduction(bool isNoiseGateEnabled);
|
||||||
bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; }
|
bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; }
|
||||||
|
|
|
@ -41,7 +41,9 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
virtual bool shouldLoopbackInjectors() { return false; }
|
virtual bool shouldLoopbackInjectors() { return false; }
|
||||||
|
|
||||||
virtual void setIsStereoInput(bool stereo) = 0;
|
virtual bool setIsStereoInput(bool stereo) = 0;
|
||||||
|
|
||||||
|
virtual bool isStereoInput() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(AbstractAudioInterface*)
|
Q_DECLARE_METATYPE(AbstractAudioInterface*)
|
||||||
|
|
|
@ -1801,5 +1801,9 @@ scriptable::ScriptableModelBase Avatar::getScriptableModel() {
|
||||||
}
|
}
|
||||||
auto result = _skeletonModel->getScriptableModel();
|
auto result = _skeletonModel->getScriptableModel();
|
||||||
result.objectID = getSessionUUID().isNull() ? AVATAR_SELF_ID : getSessionUUID();
|
result.objectID = getSessionUUID().isNull() ? AVATAR_SELF_ID : getSessionUUID();
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
result.appendMaterials(_materials);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
|
@ -33,6 +33,10 @@ SkeletonModel::SkeletonModel(Avatar* owningAvatar, QObject* parent) :
|
||||||
{
|
{
|
||||||
// SkeletonModels, and by extention Avatars, use Dual Quaternion skinning.
|
// SkeletonModels, and by extention Avatars, use Dual Quaternion skinning.
|
||||||
_useDualQuaternionSkinning = true;
|
_useDualQuaternionSkinning = true;
|
||||||
|
|
||||||
|
// Avatars all cast shadow
|
||||||
|
_canCastShadow = true;
|
||||||
|
|
||||||
assert(_owningAvatar);
|
assert(_owningAvatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,12 @@ ItemKey EntityRenderer::getKey() {
|
||||||
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
// This allows shapes to cast shadows
|
||||||
|
if (_canCastShadow) {
|
||||||
|
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1).withShadowCaster();
|
||||||
|
} else {
|
||||||
|
return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::ItemKey::TAG_BITS_0 | render::ItemKey::TAG_BITS_1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
uint32_t EntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
||||||
|
@ -377,6 +382,7 @@ void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transa
|
||||||
|
|
||||||
_moving = entity->isMovingRelativeToParent();
|
_moving = entity->isMovingRelativeToParent();
|
||||||
_visible = entity->getVisible();
|
_visible = entity->getVisible();
|
||||||
|
_canCastShadow = entity->getCanCastShadow();
|
||||||
_cauterized = entity->getCauterized();
|
_cauterized = entity->getCauterized();
|
||||||
_needsRenderUpdate = false;
|
_needsRenderUpdate = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -129,6 +129,7 @@ protected:
|
||||||
bool _isFading{ _entitiesShouldFadeFunction() };
|
bool _isFading{ _entitiesShouldFadeFunction() };
|
||||||
bool _prevIsTransparent { false };
|
bool _prevIsTransparent { false };
|
||||||
bool _visible { false };
|
bool _visible { false };
|
||||||
|
bool _canCastShadow { false };
|
||||||
bool _cauterized { false };
|
bool _cauterized { false };
|
||||||
bool _moving { false };
|
bool _moving { false };
|
||||||
bool _needsRenderUpdate { false };
|
bool _needsRenderUpdate { false };
|
||||||
|
|
|
@ -286,7 +286,7 @@ bool RenderableModelEntityItem::supportsDetailedRayIntersection() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderableModelEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool RenderableModelEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance, BoxFace& face,
|
OctreeElementPointer& element, float& distance, BoxFace& face,
|
||||||
glm::vec3& surfaceNormal, QVariantMap& extraInfo, bool precisionPicking) const {
|
glm::vec3& surfaceNormal, QVariantMap& extraInfo, bool precisionPicking) const {
|
||||||
auto model = getModel();
|
auto model = getModel();
|
||||||
if (!model) {
|
if (!model) {
|
||||||
|
@ -974,6 +974,10 @@ scriptable::ScriptableModelBase render::entities::ModelEntityRenderer::getScript
|
||||||
|
|
||||||
auto result = _model->getScriptableModel();
|
auto result = _model->getScriptableModel();
|
||||||
result.objectID = getEntity()->getID();
|
result.objectID = getEntity()->getID();
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
result.appendMaterials(_materials);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1395,6 +1399,10 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
}
|
}
|
||||||
// TODO? early exit here when not visible?
|
// TODO? early exit here when not visible?
|
||||||
|
|
||||||
|
if (model->canCastShadow() != _canCastShadow) {
|
||||||
|
model->setCanCastShadow(_canCastShadow, scene, viewTaskBits, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (_needsCollisionGeometryUpdate) {
|
if (_needsCollisionGeometryUpdate) {
|
||||||
setCollisionMeshKey(entity->getCollisionMeshKey());
|
setCollisionMeshKey(entity->getCollisionMeshKey());
|
||||||
_needsCollisionGeometryUpdate = false;
|
_needsCollisionGeometryUpdate = false;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
|
|
||||||
virtual bool supportsDetailedRayIntersection() const override;
|
virtual bool supportsDetailedRayIntersection() const override;
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override;
|
QVariantMap& extraInfo, bool precisionPicking) const override;
|
||||||
|
|
||||||
|
|
|
@ -565,7 +565,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool RenderablePolyVoxEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool RenderablePolyVoxEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element,
|
OctreeElementPointer& element,
|
||||||
float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const
|
QVariantMap& extraInfo, bool precisionPicking) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
|
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override;
|
QVariantMap& extraInfo, bool precisionPicking) const override;
|
||||||
|
|
||||||
|
|
|
@ -169,8 +169,12 @@ scriptable::ScriptableModelBase ShapeEntityRenderer::getScriptableModel() {
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
auto geometryShape = geometryCache->getShapeForEntityShape(_shape);
|
auto geometryShape = geometryCache->getShapeForEntityShape(_shape);
|
||||||
glm::vec3 vertexColor;
|
glm::vec3 vertexColor;
|
||||||
if (_materials["0"].top().material) {
|
{
|
||||||
vertexColor = _materials["0"].top().material->getAlbedo();
|
std::lock_guard<std::mutex> lock(_materialsLock);
|
||||||
|
result.appendMaterials(_materials);
|
||||||
|
if (_materials["0"].top().material) {
|
||||||
|
vertexColor = _materials["0"].top().material->getAlbedo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (auto mesh = geometryCache->meshFromShape(geometryShape, vertexColor)) {
|
if (auto mesh = geometryCache->meshFromShape(geometryShape, vertexColor)) {
|
||||||
result.objectID = getEntity()->getID();
|
result.objectID = getEntity()->getID();
|
||||||
|
|
|
@ -330,6 +330,7 @@ void ZoneEntityRenderer::updateKeySunFromEntity(const TypedEntityPointer& entity
|
||||||
sunLight->setColor(ColorUtils::toVec3(_keyLightProperties.getColor()));
|
sunLight->setColor(ColorUtils::toVec3(_keyLightProperties.getColor()));
|
||||||
sunLight->setIntensity(_keyLightProperties.getIntensity());
|
sunLight->setIntensity(_keyLightProperties.getIntensity());
|
||||||
sunLight->setDirection(entity->getTransform().getRotation() * _keyLightProperties.getDirection());
|
sunLight->setDirection(entity->getTransform().getRotation() * _keyLightProperties.getDirection());
|
||||||
|
sunLight->setCastShadows(_keyLightProperties.getCastShadows());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneEntityRenderer::updateAmbientLightFromEntity(const TypedEntityPointer& entity) {
|
void ZoneEntityRenderer::updateAmbientLightFromEntity(const TypedEntityPointer& entity) {
|
||||||
|
|
|
@ -91,6 +91,7 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
|
||||||
requestedProperties += PROP_REGISTRATION_POINT;
|
requestedProperties += PROP_REGISTRATION_POINT;
|
||||||
requestedProperties += PROP_ANGULAR_DAMPING;
|
requestedProperties += PROP_ANGULAR_DAMPING;
|
||||||
requestedProperties += PROP_VISIBLE;
|
requestedProperties += PROP_VISIBLE;
|
||||||
|
requestedProperties += PROP_CAN_CAST_SHADOW;
|
||||||
requestedProperties += PROP_COLLISIONLESS;
|
requestedProperties += PROP_COLLISIONLESS;
|
||||||
requestedProperties += PROP_COLLISION_MASK;
|
requestedProperties += PROP_COLLISION_MASK;
|
||||||
requestedProperties += PROP_DYNAMIC;
|
requestedProperties += PROP_DYNAMIC;
|
||||||
|
@ -249,6 +250,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
||||||
APPEND_ENTITY_PROPERTY(PROP_REGISTRATION_POINT, getRegistrationPoint());
|
APPEND_ENTITY_PROPERTY(PROP_REGISTRATION_POINT, getRegistrationPoint());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, getAngularDamping());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, getAngularDamping());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, getVisible());
|
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, getVisible());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_CAN_CAST_SHADOW, getCanCastShadow());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, getCollisionless());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, getCollisionless());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, getCollisionMask());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, getCollisionMask());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, getDynamic());
|
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, getDynamic());
|
||||||
|
@ -799,6 +801,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
|
|
||||||
READ_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
READ_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
||||||
READ_ENTITY_PROPERTY(PROP_VISIBLE, bool, setVisible);
|
READ_ENTITY_PROPERTY(PROP_VISIBLE, bool, setVisible);
|
||||||
|
READ_ENTITY_PROPERTY(PROP_CAN_CAST_SHADOW, bool, setCanCastShadow);
|
||||||
READ_ENTITY_PROPERTY(PROP_COLLISIONLESS, bool, setCollisionless);
|
READ_ENTITY_PROPERTY(PROP_COLLISIONLESS, bool, setCollisionless);
|
||||||
READ_ENTITY_PROPERTY(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
READ_ENTITY_PROPERTY(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
||||||
READ_ENTITY_PROPERTY(PROP_DYNAMIC, bool, setDynamic);
|
READ_ENTITY_PROPERTY(PROP_DYNAMIC, bool, setDynamic);
|
||||||
|
@ -1234,6 +1237,7 @@ EntityItemProperties EntityItem::getProperties(EntityPropertyFlags desiredProper
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(angularDamping, getAngularDamping);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(angularDamping, getAngularDamping);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRenderAlpha, getLocalRenderAlpha);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRenderAlpha, getLocalRenderAlpha);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(visible, getVisible);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(visible, getVisible);
|
||||||
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(canCastShadow, getCanCastShadow);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionless, getCollisionless);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionless, getCollisionless);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionMask, getCollisionMask);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(collisionMask, getCollisionMask);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dynamic, getDynamic);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(dynamic, getDynamic);
|
||||||
|
@ -1346,6 +1350,7 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(collisionSoundURL, setCollisionSoundURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(collisionSoundURL, setCollisionSoundURL);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(localRenderAlpha, setLocalRenderAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(localRenderAlpha, setLocalRenderAlpha);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(visible, setVisible);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(visible, setVisible);
|
||||||
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(canCastShadow, setCanCastShadow);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(userData, setUserData);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(userData, setUserData);
|
||||||
|
|
||||||
// Certifiable Properties
|
// Certifiable Properties
|
||||||
|
@ -2723,6 +2728,28 @@ void EntityItem::setVisible(bool value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EntityItem::getCanCastShadow() const {
|
||||||
|
bool result;
|
||||||
|
withReadLock([&] {
|
||||||
|
result = _canCastShadow;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EntityItem::setCanCastShadow(bool value) {
|
||||||
|
bool changed = false;
|
||||||
|
withWriteLock([&] {
|
||||||
|
if (_canCastShadow != value) {
|
||||||
|
changed = true;
|
||||||
|
_canCastShadow = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
emit requestRenderUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool EntityItem::isChildOfMyAvatar() const {
|
bool EntityItem::isChildOfMyAvatar() const {
|
||||||
QUuid ancestorID = findAncestorOfType(NestableType::Avatar);
|
QUuid ancestorID = findAncestorOfType(NestableType::Avatar);
|
||||||
return !ancestorID.isNull() && (ancestorID == Physics::getSessionUUID() || ancestorID == AVATAR_SELF_ID);
|
return !ancestorID.isNull() && (ancestorID == Physics::getSessionUUID() || ancestorID == AVATAR_SELF_ID);
|
||||||
|
|
|
@ -159,7 +159,7 @@ public:
|
||||||
|
|
||||||
virtual bool supportsDetailedRayIntersection() const { return false; }
|
virtual bool supportsDetailedRayIntersection() const { return false; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const { return true; }
|
QVariantMap& extraInfo, bool precisionPicking) const { return true; }
|
||||||
|
|
||||||
|
@ -274,6 +274,10 @@ public:
|
||||||
|
|
||||||
bool getVisible() const;
|
bool getVisible() const;
|
||||||
void setVisible(bool value);
|
void setVisible(bool value);
|
||||||
|
|
||||||
|
bool getCanCastShadow() const;
|
||||||
|
void setCanCastShadow(bool value);
|
||||||
|
|
||||||
inline bool isVisible() const { return getVisible(); }
|
inline bool isVisible() const { return getVisible(); }
|
||||||
inline bool isInvisible() const { return !getVisible(); }
|
inline bool isInvisible() const { return !getVisible(); }
|
||||||
|
|
||||||
|
@ -551,6 +555,7 @@ protected:
|
||||||
glm::vec3 _registrationPoint { ENTITY_ITEM_DEFAULT_REGISTRATION_POINT };
|
glm::vec3 _registrationPoint { ENTITY_ITEM_DEFAULT_REGISTRATION_POINT };
|
||||||
float _angularDamping { ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING };
|
float _angularDamping { ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING };
|
||||||
bool _visible { ENTITY_ITEM_DEFAULT_VISIBLE };
|
bool _visible { ENTITY_ITEM_DEFAULT_VISIBLE };
|
||||||
|
bool _canCastShadow{ ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW };
|
||||||
bool _collisionless { ENTITY_ITEM_DEFAULT_COLLISIONLESS };
|
bool _collisionless { ENTITY_ITEM_DEFAULT_COLLISIONLESS };
|
||||||
uint8_t _collisionMask { ENTITY_COLLISION_MASK_DEFAULT };
|
uint8_t _collisionMask { ENTITY_COLLISION_MASK_DEFAULT };
|
||||||
bool _dynamic { ENTITY_ITEM_DEFAULT_DYNAMIC };
|
bool _dynamic { ENTITY_ITEM_DEFAULT_DYNAMIC };
|
||||||
|
|
|
@ -316,6 +316,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
||||||
CHECK_PROPERTY_CHANGE(PROP_MODEL_URL, modelURL);
|
CHECK_PROPERTY_CHANGE(PROP_MODEL_URL, modelURL);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_COMPOUND_SHAPE_URL, compoundShapeURL);
|
CHECK_PROPERTY_CHANGE(PROP_COMPOUND_SHAPE_URL, compoundShapeURL);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_VISIBLE, visible);
|
CHECK_PROPERTY_CHANGE(PROP_VISIBLE, visible);
|
||||||
|
CHECK_PROPERTY_CHANGE(PROP_CAN_CAST_SHADOW, canCastShadow);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_REGISTRATION_POINT, registrationPoint);
|
CHECK_PROPERTY_CHANGE(PROP_REGISTRATION_POINT, registrationPoint);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_DAMPING, angularDamping);
|
CHECK_PROPERTY_CHANGE(PROP_ANGULAR_DAMPING, angularDamping);
|
||||||
|
@ -490,6 +491,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_VELOCITY, angularVelocity);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_DAMPING, angularDamping);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_ANGULAR_DAMPING, angularDamping);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_VISIBLE, visible);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_VISIBLE, visible);
|
||||||
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_CAN_CAST_SHADOW, canCastShadow);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_COLLISIONLESS, collisionless);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_COLLISIONLESS, collisionless);
|
||||||
COPY_PROXY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_COLLISIONLESS, collisionless, ignoreForCollisions, getCollisionless()); // legacy support
|
COPY_PROXY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_COLLISIONLESS, collisionless, ignoreForCollisions, getCollisionless()); // legacy support
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_COLLISION_MASK, collisionMask);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_COLLISION_MASK, collisionMask);
|
||||||
|
@ -751,6 +753,7 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(angularVelocity, glmVec3, setAngularVelocity);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(angularVelocity, glmVec3, setAngularVelocity);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(angularDamping, float, setAngularDamping);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(angularDamping, float, setAngularDamping);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(visible, bool, setVisible);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(visible, bool, setVisible);
|
||||||
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(canCastShadow, bool, setCanCastShadow);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(color, xColor, setColor);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(color, xColor, setColor);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(colorSpread, xColor, setColorSpread);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(colorSpread, xColor, setColorSpread);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(colorStart, xColor, setColorStart);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(colorStart, xColor, setColorStart);
|
||||||
|
@ -922,6 +925,7 @@ void EntityItemProperties::merge(const EntityItemProperties& other) {
|
||||||
COPY_PROPERTY_IF_CHANGED(angularVelocity);
|
COPY_PROPERTY_IF_CHANGED(angularVelocity);
|
||||||
COPY_PROPERTY_IF_CHANGED(angularDamping);
|
COPY_PROPERTY_IF_CHANGED(angularDamping);
|
||||||
COPY_PROPERTY_IF_CHANGED(visible);
|
COPY_PROPERTY_IF_CHANGED(visible);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(canCastShadow);
|
||||||
COPY_PROPERTY_IF_CHANGED(color);
|
COPY_PROPERTY_IF_CHANGED(color);
|
||||||
COPY_PROPERTY_IF_CHANGED(colorSpread);
|
COPY_PROPERTY_IF_CHANGED(colorSpread);
|
||||||
COPY_PROPERTY_IF_CHANGED(colorStart);
|
COPY_PROPERTY_IF_CHANGED(colorStart);
|
||||||
|
@ -1094,6 +1098,7 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
|
||||||
|
|
||||||
std::call_once(initMap, [](){
|
std::call_once(initMap, [](){
|
||||||
ADD_PROPERTY_TO_MAP(PROP_VISIBLE, Visible, visible, bool);
|
ADD_PROPERTY_TO_MAP(PROP_VISIBLE, Visible, visible, bool);
|
||||||
|
ADD_PROPERTY_TO_MAP(PROP_CAN_CAST_SHADOW, CanCastShadow, canCastShadow, bool);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_POSITION, Position, position, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_POSITION, Position, position, glm::vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_ROTATION, Rotation, rotation, glm::quat);
|
ADD_PROPERTY_TO_MAP(PROP_ROTATION, Rotation, rotation, glm::quat);
|
||||||
|
@ -1187,6 +1192,8 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
|
||||||
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_COLOR, KeyLightColor, keyLightColor, xColor);
|
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_COLOR, KeyLightColor, keyLightColor, xColor);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_INTENSITY, KeyLightIntensity, keyLightIntensity, float);
|
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_INTENSITY, KeyLightIntensity, keyLightIntensity, float);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_DIRECTION, KeyLightDirection, keyLightDirection, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_DIRECTION, KeyLightDirection, keyLightDirection, glm::vec3);
|
||||||
|
ADD_PROPERTY_TO_MAP(PROP_KEYLIGHT_CAST_SHADOW, KeyLightCastShadows, keyLightCastShadows, bool);
|
||||||
|
|
||||||
ADD_PROPERTY_TO_MAP(PROP_VOXEL_VOLUME_SIZE, VoxelVolumeSize, voxelVolumeSize, glm::vec3);
|
ADD_PROPERTY_TO_MAP(PROP_VOXEL_VOLUME_SIZE, VoxelVolumeSize, voxelVolumeSize, glm::vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_VOXEL_DATA, VoxelData, voxelData, QByteArray);
|
ADD_PROPERTY_TO_MAP(PROP_VOXEL_DATA, VoxelData, voxelData, QByteArray);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_VOXEL_SURFACE_STYLE, VoxelSurfaceStyle, voxelSurfaceStyle, uint16_t);
|
ADD_PROPERTY_TO_MAP(PROP_VOXEL_SURFACE_STYLE, VoxelSurfaceStyle, voxelSurfaceStyle, uint16_t);
|
||||||
|
@ -1412,6 +1419,7 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, properties.getAngularVelocity());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_VELOCITY, properties.getAngularVelocity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, properties.getAngularDamping());
|
APPEND_ENTITY_PROPERTY(PROP_ANGULAR_DAMPING, properties.getAngularDamping());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, properties.getVisible());
|
APPEND_ENTITY_PROPERTY(PROP_VISIBLE, properties.getVisible());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_CAN_CAST_SHADOW, properties.getCanCastShadow());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, properties.getCollisionless());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISIONLESS, properties.getCollisionless());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, properties.getCollisionMask());
|
APPEND_ENTITY_PROPERTY(PROP_COLLISION_MASK, properties.getCollisionMask());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, properties.getDynamic());
|
APPEND_ENTITY_PROPERTY(PROP_DYNAMIC, properties.getDynamic());
|
||||||
|
@ -1784,6 +1792,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_VELOCITY, glm::vec3, setAngularVelocity);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_VELOCITY, glm::vec3, setAngularVelocity);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_ANGULAR_DAMPING, float, setAngularDamping);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VISIBLE, bool, setVisible);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_VISIBLE, bool, setVisible);
|
||||||
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_CAN_CAST_SHADOW, bool, setCanCastShadow);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISIONLESS, bool, setCollisionless);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISIONLESS, bool, setCollisionless);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_COLLISION_MASK, uint8_t, setCollisionMask);
|
||||||
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DYNAMIC, bool, setDynamic);
|
READ_ENTITY_PROPERTY_TO_PROPERTIES(PROP_DYNAMIC, bool, setDynamic);
|
||||||
|
@ -2053,6 +2062,7 @@ void EntityItemProperties::markAllChanged() {
|
||||||
_angularDampingChanged = true;
|
_angularDampingChanged = true;
|
||||||
_nameChanged = true;
|
_nameChanged = true;
|
||||||
_visibleChanged = true;
|
_visibleChanged = true;
|
||||||
|
_canCastShadowChanged = true;
|
||||||
_colorChanged = true;
|
_colorChanged = true;
|
||||||
_alphaChanged = true;
|
_alphaChanged = true;
|
||||||
_modelURLChanged = true;
|
_modelURLChanged = true;
|
||||||
|
@ -2250,6 +2260,9 @@ QList<QString> EntityItemProperties::listChangedProperties() {
|
||||||
if (visibleChanged()) {
|
if (visibleChanged()) {
|
||||||
out += "visible";
|
out += "visible";
|
||||||
}
|
}
|
||||||
|
if (canCastShadowChanged()) {
|
||||||
|
out += "canCastShadow";
|
||||||
|
}
|
||||||
if (rotationChanged()) {
|
if (rotationChanged()) {
|
||||||
out += "rotation";
|
out += "rotation";
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,7 @@ public:
|
||||||
// bool _fooChanged { false };
|
// bool _fooChanged { false };
|
||||||
|
|
||||||
DEFINE_PROPERTY(PROP_VISIBLE, Visible, visible, bool, ENTITY_ITEM_DEFAULT_VISIBLE);
|
DEFINE_PROPERTY(PROP_VISIBLE, Visible, visible, bool, ENTITY_ITEM_DEFAULT_VISIBLE);
|
||||||
|
DEFINE_PROPERTY(PROP_CAN_CAST_SHADOW, CanCastShadow, canCastShadow, bool, ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW);
|
||||||
DEFINE_PROPERTY_REF_WITH_SETTER(PROP_POSITION, Position, position, glm::vec3, ENTITY_ITEM_ZERO_VEC3);
|
DEFINE_PROPERTY_REF_WITH_SETTER(PROP_POSITION, Position, position, glm::vec3, ENTITY_ITEM_ZERO_VEC3);
|
||||||
DEFINE_PROPERTY_REF(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3, ENTITY_ITEM_DEFAULT_DIMENSIONS);
|
DEFINE_PROPERTY_REF(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3, ENTITY_ITEM_DEFAULT_DIMENSIONS);
|
||||||
DEFINE_PROPERTY_REF(PROP_ROTATION, Rotation, rotation, glm::quat, ENTITY_ITEM_DEFAULT_ROTATION);
|
DEFINE_PROPERTY_REF(PROP_ROTATION, Rotation, rotation, glm::quat, ENTITY_ITEM_DEFAULT_ROTATION);
|
||||||
|
@ -426,6 +427,7 @@ inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Velocity, velocity, "in meters");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Velocity, velocity, "in meters");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Name, name, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Name, name, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Visible, visible, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Visible, visible, "");
|
||||||
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, CanCastShadow, canCastShadow, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Rotation, rotation, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Rotation, rotation, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Density, density, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Density, density, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Gravity, gravity, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Gravity, gravity, "");
|
||||||
|
|
|
@ -46,6 +46,7 @@ const quint32 ENTITY_ITEM_DEFAULT_STATIC_CERTIFICATE_VERSION = 0;
|
||||||
const float ENTITY_ITEM_DEFAULT_ALPHA = 1.0f;
|
const float ENTITY_ITEM_DEFAULT_ALPHA = 1.0f;
|
||||||
const float ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA = 1.0f;
|
const float ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA = 1.0f;
|
||||||
const bool ENTITY_ITEM_DEFAULT_VISIBLE = true;
|
const bool ENTITY_ITEM_DEFAULT_VISIBLE = true;
|
||||||
|
const bool ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW { true };
|
||||||
|
|
||||||
const QString ENTITY_ITEM_DEFAULT_SCRIPT = QString("");
|
const QString ENTITY_ITEM_DEFAULT_SCRIPT = QString("");
|
||||||
const quint64 ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP = 0;
|
const quint64 ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP = 0;
|
||||||
|
|
|
@ -20,6 +20,7 @@ enum EntityPropertyList {
|
||||||
|
|
||||||
// these properties are supported by the EntityItem base class
|
// these properties are supported by the EntityItem base class
|
||||||
PROP_VISIBLE,
|
PROP_VISIBLE,
|
||||||
|
PROP_CAN_CAST_SHADOW,
|
||||||
PROP_POSITION,
|
PROP_POSITION,
|
||||||
PROP_DIMENSIONS,
|
PROP_DIMENSIONS,
|
||||||
PROP_ROTATION,
|
PROP_ROTATION,
|
||||||
|
@ -205,6 +206,11 @@ enum EntityPropertyList {
|
||||||
|
|
||||||
PROP_HAZE_MODE,
|
PROP_HAZE_MODE,
|
||||||
|
|
||||||
|
PROP_KEYLIGHT_COLOR,
|
||||||
|
PROP_KEYLIGHT_INTENSITY,
|
||||||
|
PROP_KEYLIGHT_DIRECTION,
|
||||||
|
PROP_KEYLIGHT_CAST_SHADOW,
|
||||||
|
|
||||||
PROP_HAZE_RANGE,
|
PROP_HAZE_RANGE,
|
||||||
PROP_HAZE_COLOR,
|
PROP_HAZE_COLOR,
|
||||||
PROP_HAZE_GLARE_COLOR,
|
PROP_HAZE_GLARE_COLOR,
|
||||||
|
@ -254,10 +260,6 @@ enum EntityPropertyList {
|
||||||
// Aliases/Piggyback properties for Zones. These properties intentionally reuse the enum values for
|
// Aliases/Piggyback properties for Zones. These properties intentionally reuse the enum values for
|
||||||
// other properties which will never overlap with each other. We do this so that we don't have to expand
|
// other properties which will never overlap with each other. We do this so that we don't have to expand
|
||||||
// the size of the properties bitflags mask
|
// the size of the properties bitflags mask
|
||||||
PROP_KEYLIGHT_COLOR = PROP_COLOR,
|
|
||||||
PROP_KEYLIGHT_INTENSITY = PROP_INTENSITY,
|
|
||||||
PROP_KEYLIGHT_DIRECTION = PROP_EXPONENT,
|
|
||||||
|
|
||||||
PROP_SKYBOX_COLOR = PROP_ANIMATION_URL,
|
PROP_SKYBOX_COLOR = PROP_ANIMATION_URL,
|
||||||
PROP_SKYBOX_URL = PROP_ANIMATION_FPS,
|
PROP_SKYBOX_URL = PROP_ANIMATION_FPS,
|
||||||
|
|
||||||
|
|
|
@ -594,17 +594,15 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con
|
||||||
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) {
|
QVariantMap& extraInfo, bool precisionPicking) {
|
||||||
|
|
||||||
keepSearching = true; // assume that we will continue searching after this.
|
|
||||||
|
|
||||||
EntityItemID result;
|
EntityItemID result;
|
||||||
float distanceToElementCube = std::numeric_limits<float>::max();
|
float distanceToElementCube = std::numeric_limits<float>::max();
|
||||||
float distanceToElementDetails = distance;
|
|
||||||
BoxFace localFace;
|
BoxFace localFace;
|
||||||
glm::vec3 localSurfaceNormal;
|
glm::vec3 localSurfaceNormal;
|
||||||
QVariantMap localExtraInfo;
|
|
||||||
|
|
||||||
// if the ray doesn't intersect with our cube, we can stop searching!
|
// if the ray doesn't intersect with our cube OR the distance to element is less than current best distance
|
||||||
if (!_cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal)) {
|
// we can stop searching!
|
||||||
|
bool hit = _cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal);
|
||||||
|
if (!hit || (!_cube.contains(origin) && distanceToElementCube > distance)) {
|
||||||
keepSearching = false; // no point in continuing to search
|
keepSearching = false; // no point in continuing to search
|
||||||
return result; // we did not intersect
|
return result; // we did not intersect
|
||||||
}
|
}
|
||||||
|
@ -616,52 +614,46 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con
|
||||||
|
|
||||||
// if the distance to the element cube is not less than the current best distance, then it's not possible
|
// if the distance to the element cube is not less than the current best distance, then it's not possible
|
||||||
// for any details inside the cube to be closer so we don't need to consider them.
|
// for any details inside the cube to be closer so we don't need to consider them.
|
||||||
if (_cube.contains(origin) || distanceToElementCube < distance) {
|
QVariantMap localExtraInfo;
|
||||||
|
float distanceToElementDetails = distance;
|
||||||
EntityItemID entityID = findDetailedRayIntersection(origin, direction, keepSearching, element, distanceToElementDetails,
|
EntityItemID entityID = findDetailedRayIntersection(origin, direction, element, distanceToElementDetails,
|
||||||
face, localSurfaceNormal, entityIdsToInclude, entityIdsToDiscard, visibleOnly, collidableOnly,
|
face, localSurfaceNormal, entityIdsToInclude, entityIdsToDiscard, visibleOnly, collidableOnly,
|
||||||
localExtraInfo, precisionPicking, distanceToElementCube);
|
localExtraInfo, precisionPicking);
|
||||||
if (!entityID.isNull()) {
|
if (!entityID.isNull() && distanceToElementDetails < distance) {
|
||||||
if (distanceToElementDetails < distance) {
|
distance = distanceToElementDetails;
|
||||||
distance = distanceToElementDetails;
|
face = localFace;
|
||||||
face = localFace;
|
surfaceNormal = localSurfaceNormal;
|
||||||
surfaceNormal = localSurfaceNormal;
|
extraInfo = localExtraInfo;
|
||||||
extraInfo = localExtraInfo;
|
result = entityID;
|
||||||
result = entityID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemID EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, bool& keepSearching,
|
EntityItemID EntityTreeElement::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIDsToDiscard,
|
const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIDsToDiscard,
|
||||||
bool visibleOnly, bool collidableOnly, QVariantMap& extraInfo, bool precisionPicking, float distanceToElementCube) {
|
bool visibleOnly, bool collidableOnly, QVariantMap& extraInfo, bool precisionPicking) {
|
||||||
|
|
||||||
// only called if we do intersect our bounding cube, but find if we actually intersect with entities...
|
// only called if we do intersect our bounding cube, but find if we actually intersect with entities...
|
||||||
int entityNumber = 0;
|
int entityNumber = 0;
|
||||||
EntityItemID entityID;
|
EntityItemID entityID;
|
||||||
forEachEntity([&](EntityItemPointer entity) {
|
forEachEntity([&](EntityItemPointer entity) {
|
||||||
if ( (visibleOnly && !entity->isVisible()) || (collidableOnly && (entity->getCollisionless() || entity->getShapeType() == SHAPE_TYPE_NONE))
|
// use simple line-sphere for broadphase check
|
||||||
|| (entityIdsToInclude.size() > 0 && !entityIdsToInclude.contains(entity->getID()))
|
// (this is faster and more likely to cull results than the filter check below so we do it first)
|
||||||
|| (entityIDsToDiscard.size() > 0 && entityIDsToDiscard.contains(entity->getID())) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
AABox entityBox = entity->getAABox(success);
|
AABox entityBox = entity->getAABox(success);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!entityBox.rayHitsBoundingSphere(origin, direction)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float localDistance;
|
// check RayPick filter settings
|
||||||
BoxFace localFace;
|
if ((visibleOnly && !entity->isVisible())
|
||||||
glm::vec3 localSurfaceNormal;
|
|| (collidableOnly && (entity->getCollisionless() || entity->getShapeType() == SHAPE_TYPE_NONE))
|
||||||
QVariantMap localExtraInfo;
|
|| (entityIdsToInclude.size() > 0 && !entityIdsToInclude.contains(entity->getID()))
|
||||||
|
|| (entityIDsToDiscard.size() > 0 && entityIDsToDiscard.contains(entity->getID())) ) {
|
||||||
// if the ray doesn't intersect with our cube, we can stop searching!
|
|
||||||
if (!entityBox.findRayIntersection(origin, direction, localDistance, localFace, localSurfaceNormal)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,14 +674,17 @@ EntityItemID EntityTreeElement::findDetailedRayIntersection(const glm::vec3& ori
|
||||||
|
|
||||||
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
||||||
// and testing intersection there.
|
// and testing intersection there.
|
||||||
|
float localDistance;
|
||||||
|
BoxFace localFace;
|
||||||
|
glm::vec3 localSurfaceNormal;
|
||||||
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, localDistance,
|
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, localDistance,
|
||||||
localFace, localSurfaceNormal)) {
|
localFace, localSurfaceNormal)) {
|
||||||
if (entityFrameBox.contains(entityFrameOrigin) || localDistance < distance) {
|
if (entityFrameBox.contains(entityFrameOrigin) || localDistance < distance) {
|
||||||
// now ask the entity if we actually intersect
|
// now ask the entity if we actually intersect
|
||||||
if (entity->supportsDetailedRayIntersection()) {
|
if (entity->supportsDetailedRayIntersection()) {
|
||||||
if (entity->findDetailedRayIntersection(origin, direction, keepSearching, element, localDistance,
|
QVariantMap localExtraInfo;
|
||||||
localFace, localSurfaceNormal, localExtraInfo, precisionPicking)) {
|
if (entity->findDetailedRayIntersection(origin, direction, element, localDistance,
|
||||||
|
localFace, localSurfaceNormal, localExtraInfo, precisionPicking)) {
|
||||||
if (localDistance < distance) {
|
if (localDistance < distance) {
|
||||||
distance = localDistance;
|
distance = localDistance;
|
||||||
face = localFace;
|
face = localFace;
|
||||||
|
|
|
@ -152,10 +152,10 @@ public:
|
||||||
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
||||||
QVariantMap& extraInfo, bool precisionPicking = false);
|
QVariantMap& extraInfo, bool precisionPicking = false);
|
||||||
virtual EntityItemID findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual EntityItemID findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude,
|
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude,
|
||||||
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, bool collidableOnly,
|
||||||
QVariantMap& extraInfo, bool precisionPicking, float distanceToElementCube);
|
QVariantMap& extraInfo, bool precisionPicking);
|
||||||
virtual bool findSpherePenetration(const glm::vec3& center, float radius,
|
virtual bool findSpherePenetration(const glm::vec3& center, float radius,
|
||||||
glm::vec3& penetration, void** penetratedObject) const override;
|
glm::vec3& penetration, void** penetratedObject) const override;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ const xColor KeyLightPropertyGroup::DEFAULT_KEYLIGHT_COLOR = { 255, 255, 255 };
|
||||||
const float KeyLightPropertyGroup::DEFAULT_KEYLIGHT_INTENSITY = 1.0f;
|
const float KeyLightPropertyGroup::DEFAULT_KEYLIGHT_INTENSITY = 1.0f;
|
||||||
const float KeyLightPropertyGroup::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY = 0.5f;
|
const float KeyLightPropertyGroup::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY = 0.5f;
|
||||||
const glm::vec3 KeyLightPropertyGroup::DEFAULT_KEYLIGHT_DIRECTION = { 0.0f, -1.0f, 0.0f };
|
const glm::vec3 KeyLightPropertyGroup::DEFAULT_KEYLIGHT_DIRECTION = { 0.0f, -1.0f, 0.0f };
|
||||||
|
const bool KeyLightPropertyGroup::DEFAULT_KEYLIGHT_CAST_SHADOWS { false };
|
||||||
|
|
||||||
void KeyLightPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
|
void KeyLightPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties,
|
||||||
QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||||
|
@ -28,23 +29,27 @@ void KeyLightPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desired
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_COLOR, KeyLight, keyLight, Color, color);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_COLOR, KeyLight, keyLight, Color, color);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_INTENSITY, KeyLight, keyLight, Intensity, intensity);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_INTENSITY, KeyLight, keyLight, Intensity, intensity);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_DIRECTION, KeyLight, keyLight, Direction, direction);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_DIRECTION, KeyLight, keyLight, Direction, direction);
|
||||||
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_KEYLIGHT_CAST_SHADOW, KeyLight, keyLight, CastShadows, castShadows);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyLightPropertyGroup::copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) {
|
void KeyLightPropertyGroup::copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) {
|
||||||
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, color, xColor, setColor);
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, color, xColor, setColor);
|
||||||
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, intensity, float, setIntensity);
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, intensity, float, setIntensity);
|
||||||
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, direction, glmVec3, setDirection);
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, direction, glmVec3, setDirection);
|
||||||
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(keyLight, castShadows, bool, setCastShadows);
|
||||||
|
|
||||||
// legacy property support
|
// legacy property support
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightColor, xColor, setColor, getColor);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightColor, xColor, setColor, getColor);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightIntensity, float, setIntensity, getIntensity);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightIntensity, float, setIntensity, getIntensity);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightDirection, glmVec3, setDirection, getDirection);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightDirection, glmVec3, setDirection, getDirection);
|
||||||
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightCastShadows, bool, setCastShadows, getCastShadows);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyLightPropertyGroup::merge(const KeyLightPropertyGroup& other) {
|
void KeyLightPropertyGroup::merge(const KeyLightPropertyGroup& other) {
|
||||||
COPY_PROPERTY_IF_CHANGED(color);
|
COPY_PROPERTY_IF_CHANGED(color);
|
||||||
COPY_PROPERTY_IF_CHANGED(intensity);
|
COPY_PROPERTY_IF_CHANGED(intensity);
|
||||||
COPY_PROPERTY_IF_CHANGED(direction);
|
COPY_PROPERTY_IF_CHANGED(direction);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(castShadows);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyLightPropertyGroup::debugDump() const {
|
void KeyLightPropertyGroup::debugDump() const {
|
||||||
|
@ -52,6 +57,7 @@ void KeyLightPropertyGroup::debugDump() const {
|
||||||
qCDebug(entities) << " color:" << getColor(); // << "," << getColor()[1] << "," << getColor()[2];
|
qCDebug(entities) << " color:" << getColor(); // << "," << getColor()[1] << "," << getColor()[2];
|
||||||
qCDebug(entities) << " intensity:" << getIntensity();
|
qCDebug(entities) << " intensity:" << getIntensity();
|
||||||
qCDebug(entities) << " direction:" << getDirection();
|
qCDebug(entities) << " direction:" << getDirection();
|
||||||
|
qCDebug(entities) << " castShadows:" << getCastShadows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyLightPropertyGroup::listChangedProperties(QList<QString>& out) {
|
void KeyLightPropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
|
@ -64,6 +70,9 @@ void KeyLightPropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
if (directionChanged()) {
|
if (directionChanged()) {
|
||||||
out << "keyLight-direction";
|
out << "keyLight-direction";
|
||||||
}
|
}
|
||||||
|
if (castShadowsChanged()) {
|
||||||
|
out << "keyLight-castShadows";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeyLightPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
bool KeyLightPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
|
@ -78,12 +87,13 @@ bool KeyLightPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, getColor());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, getColor());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, getIntensity());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, getIntensity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, getDirection());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, getDirection());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_CAST_SHADOW, getCastShadows());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt,
|
bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt,
|
||||||
int& processedBytes) {
|
int& processedBytes) {
|
||||||
|
|
||||||
int bytesRead = 0;
|
int bytesRead = 0;
|
||||||
bool overwriteLocalData = true;
|
bool overwriteLocalData = true;
|
||||||
|
@ -92,10 +102,12 @@ bool KeyLightPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyFl
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, xColor, setColor);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, xColor, setColor);
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, float, setIntensity);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, float, setIntensity);
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, glm::vec3, setDirection);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, glm::vec3, setDirection);
|
||||||
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_CAST_SHADOW, bool, setCastShadows);
|
||||||
|
|
||||||
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_COLOR, Color);
|
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_COLOR, Color);
|
||||||
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_INTENSITY, Intensity);
|
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_INTENSITY, Intensity);
|
||||||
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_DIRECTION, Direction);
|
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_DIRECTION, Direction);
|
||||||
|
DECODE_GROUP_PROPERTY_HAS_CHANGED(PROP_KEYLIGHT_CAST_SHADOW, CastShadows);
|
||||||
|
|
||||||
processedBytes += bytesRead;
|
processedBytes += bytesRead;
|
||||||
|
|
||||||
|
@ -108,6 +120,7 @@ void KeyLightPropertyGroup::markAllChanged() {
|
||||||
_colorChanged = true;
|
_colorChanged = true;
|
||||||
_intensityChanged = true;
|
_intensityChanged = true;
|
||||||
_directionChanged = true;
|
_directionChanged = true;
|
||||||
|
_castShadowsChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityPropertyFlags KeyLightPropertyGroup::getChangedProperties() const {
|
EntityPropertyFlags KeyLightPropertyGroup::getChangedProperties() const {
|
||||||
|
@ -116,6 +129,7 @@ EntityPropertyFlags KeyLightPropertyGroup::getChangedProperties() const {
|
||||||
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_COLOR, color);
|
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_COLOR, color);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_INTENSITY, intensity);
|
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_INTENSITY, intensity);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_DIRECTION, direction);
|
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_DIRECTION, direction);
|
||||||
|
CHECK_PROPERTY_CHANGE(PROP_KEYLIGHT_CAST_SHADOW, castShadows);
|
||||||
|
|
||||||
return changedProperties;
|
return changedProperties;
|
||||||
}
|
}
|
||||||
|
@ -124,6 +138,7 @@ void KeyLightPropertyGroup::getProperties(EntityItemProperties& properties) cons
|
||||||
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Color, getColor);
|
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Color, getColor);
|
||||||
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Intensity, getIntensity);
|
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Intensity, getIntensity);
|
||||||
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Direction, getDirection);
|
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, Direction, getDirection);
|
||||||
|
COPY_ENTITY_GROUP_PROPERTY_TO_PROPERTIES(KeyLight, CastShadows, getCastShadows);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeyLightPropertyGroup::setProperties(const EntityItemProperties& properties) {
|
bool KeyLightPropertyGroup::setProperties(const EntityItemProperties& properties) {
|
||||||
|
@ -132,6 +147,7 @@ bool KeyLightPropertyGroup::setProperties(const EntityItemProperties& properties
|
||||||
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Color, color, setColor);
|
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Color, color, setColor);
|
||||||
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Intensity, intensity, setIntensity);
|
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Intensity, intensity, setIntensity);
|
||||||
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Direction, direction, setDirection);
|
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, Direction, direction, setDirection);
|
||||||
|
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(KeyLight, CastShadows, castShadows, setCastShadows);
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
@ -142,6 +158,7 @@ EntityPropertyFlags KeyLightPropertyGroup::getEntityProperties(EncodeBitstreamPa
|
||||||
requestedProperties += PROP_KEYLIGHT_COLOR;
|
requestedProperties += PROP_KEYLIGHT_COLOR;
|
||||||
requestedProperties += PROP_KEYLIGHT_INTENSITY;
|
requestedProperties += PROP_KEYLIGHT_INTENSITY;
|
||||||
requestedProperties += PROP_KEYLIGHT_DIRECTION;
|
requestedProperties += PROP_KEYLIGHT_DIRECTION;
|
||||||
|
requestedProperties += PROP_KEYLIGHT_CAST_SHADOW;
|
||||||
|
|
||||||
return requestedProperties;
|
return requestedProperties;
|
||||||
}
|
}
|
||||||
|
@ -159,6 +176,7 @@ void KeyLightPropertyGroup::appendSubclassData(OctreePacketData* packetData, Enc
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, getColor());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, getColor());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, getIntensity());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, getIntensity());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, getDirection());
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, getDirection());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_KEYLIGHT_CAST_SHADOW, getCastShadows());
|
||||||
}
|
}
|
||||||
|
|
||||||
int KeyLightPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
int KeyLightPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
|
@ -172,6 +190,7 @@ int KeyLightPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char*
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, xColor, setColor);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_COLOR, xColor, setColor);
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, float, setIntensity);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_INTENSITY, float, setIntensity);
|
||||||
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, glm::vec3, setDirection);
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_DIRECTION, glm::vec3, setDirection);
|
||||||
|
READ_ENTITY_PROPERTY(PROP_KEYLIGHT_CAST_SHADOW, bool, setCastShadows);
|
||||||
|
|
||||||
return bytesRead;
|
return bytesRead;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,12 @@ public:
|
||||||
static const float DEFAULT_KEYLIGHT_INTENSITY;
|
static const float DEFAULT_KEYLIGHT_INTENSITY;
|
||||||
static const float DEFAULT_KEYLIGHT_AMBIENT_INTENSITY;
|
static const float DEFAULT_KEYLIGHT_AMBIENT_INTENSITY;
|
||||||
static const glm::vec3 DEFAULT_KEYLIGHT_DIRECTION;
|
static const glm::vec3 DEFAULT_KEYLIGHT_DIRECTION;
|
||||||
|
static const bool DEFAULT_KEYLIGHT_CAST_SHADOWS;
|
||||||
|
|
||||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, Color, color, xColor, DEFAULT_KEYLIGHT_COLOR);
|
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, Color, color, xColor, DEFAULT_KEYLIGHT_COLOR);
|
||||||
DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, Intensity, intensity, float, DEFAULT_KEYLIGHT_INTENSITY);
|
DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, Intensity, intensity, float, DEFAULT_KEYLIGHT_INTENSITY);
|
||||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, Direction, direction, glm::vec3, DEFAULT_KEYLIGHT_DIRECTION);
|
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, Direction, direction, glm::vec3, DEFAULT_KEYLIGHT_DIRECTION);
|
||||||
|
DEFINE_PROPERTY(PROP_KEYLIGHT_CAST_SHADOW, CastShadows, castShadows, bool, DEFAULT_KEYLIGHT_CAST_SHADOWS);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_KeyLightPropertyGroup_h
|
#endif // hifi_KeyLightPropertyGroup_h
|
||||||
|
|
|
@ -298,7 +298,7 @@ void LightEntityItem::resetLightPropertiesChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LightEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool LightEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const {
|
QVariantMap& extraInfo, bool precisionPicking) const {
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
|
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override;
|
QVariantMap& extraInfo, bool precisionPicking) const override;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class LineEntityItem : public EntityItem {
|
||||||
// never have a ray intersection pick a LineEntityItem.
|
// never have a ray intersection pick a LineEntityItem.
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo,
|
QVariantMap& extraInfo,
|
||||||
bool precisionPicking) const override { return false; }
|
bool precisionPicking) const override { return false; }
|
||||||
|
|
|
@ -94,7 +94,7 @@ class PolyLineEntityItem : public EntityItem {
|
||||||
// never have a ray intersection pick a PolyLineEntityItem.
|
// never have a ray intersection pick a PolyLineEntityItem.
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override { return false; }
|
QVariantMap& extraInfo, bool precisionPicking) const override { return false; }
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PolyVoxEntityItem : public EntityItem {
|
||||||
// never have a ray intersection pick a PolyVoxEntityItem.
|
// never have a ray intersection pick a PolyVoxEntityItem.
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override { return false; }
|
QVariantMap& extraInfo, bool precisionPicking) const override { return false; }
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ bool ShapeEntityItem::supportsDetailedRayIntersection() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShapeEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool ShapeEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element,
|
OctreeElementPointer& element,
|
||||||
float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
float& distance, BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const {
|
QVariantMap& extraInfo, bool precisionPicking) const {
|
||||||
// determine the ray in the frame of the entity transformed from a unit sphere
|
// determine the ray in the frame of the entity transformed from a unit sphere
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
|
|
||||||
bool supportsDetailedRayIntersection() const override;
|
bool supportsDetailedRayIntersection() const override;
|
||||||
bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override;
|
QVariantMap& extraInfo, bool precisionPicking) const override;
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ void TextEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBits
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const {
|
QVariantMap& extraInfo, bool precisionPicking) const {
|
||||||
glm::vec3 dimensions = getScaledDimensions();
|
glm::vec3 dimensions = getScaledDimensions();
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
|
|
||||||
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
virtual bool supportsDetailedRayIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const override;
|
QVariantMap& extraInfo, bool precisionPicking) const override;
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ void WebEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBitst
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
bool WebEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElementPointer& element, float& distance,
|
OctreeElementPointer& element, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
QVariantMap& extraInfo, bool precisionPicking) const {
|
QVariantMap& extraInfo, bool precisionPicking) const {
|
||||||
glm::vec3 dimensions = getScaledDimensions();
|
glm::vec3 dimensions = getScaledDimensions();
|
||||||
|
|