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

This commit is contained in:
unknown 2018-11-16 17:14:42 -08:00
commit 20cb64ead2
10 changed files with 115 additions and 50 deletions

View file

@ -488,11 +488,8 @@ void AudioMixer::throttle(chrono::microseconds duration, int frame) {
// target different mix and backoff ratios (they also have different backoff rates)
// this is to prevent oscillation, and encourage throttling to find a steady state
const float TARGET = 0.9f;
// on a "regular" machine with 100 avatars, this is the largest value where
// - overthrottling can be recovered
// - oscillations will not occur after the recovery
const float BACKOFF_TARGET = 0.44f;
const float TARGET = _throttleStartTarget;
const float BACKOFF_TARGET = _throttleBackoffTarget;
// the mixer is known to struggle at about 80 on a "regular" machine
// so throttle 2/80 the streams to ensure smooth audio (throttling is linear)
@ -551,6 +548,24 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) {
_slavePool.setNumThreads(numThreads);
}
}
const QString THROTTLE_START_KEY = "throttle_start";
const QString THROTTLE_BACKOFF_KEY = "throttle_backoff";
float settingsThrottleStart = audioThreadingGroupObject[THROTTLE_START_KEY].toDouble(_throttleStartTarget);
float settingsThrottleBackoff = audioThreadingGroupObject[THROTTLE_BACKOFF_KEY].toDouble(_throttleBackoffTarget);
if (settingsThrottleBackoff > settingsThrottleStart) {
qCWarning(audio) << "Throttle backoff target cannot be higher than throttle start target. Using default values.";
} else if (settingsThrottleBackoff < 0.0f || settingsThrottleStart > 1.0f) {
qCWarning(audio) << "Throttle start and backoff targets must be greater than or equal to 0.0"
<< "and lesser than or equal to 1.0. Using default values.";
} else {
_throttleStartTarget = settingsThrottleStart;
_throttleBackoffTarget = settingsThrottleBackoff;
}
qCDebug(audio) << "Throttle Start:" << _throttleStartTarget << "Throttle Backoff:" << _throttleBackoffTarget;
}
if (settingsObject.contains(AUDIO_BUFFER_GROUP_KEY)) {

View file

@ -144,11 +144,13 @@ private:
static std::map<QString, CodecPluginPointer> _availableCodecs;
static QStringList _codecPreferenceOrder;
static std::vector<ZoneDescription> _audioZones;
static std::vector<ZoneSettings> _zoneSettings;
static std::vector<ReverbSettings> _zoneReverbSettings;
float _throttleStartTarget = 0.9f;
float _throttleBackoffTarget = 0.44f;
AudioMixerSlave::SharedData _workerSharedData;
};

View file

@ -1012,6 +1012,24 @@
"placeholder": "1",
"default": "1",
"advanced": true
},
{
"name": "throttle_start",
"type": "double",
"label": "Throttle Start Target",
"help": "Target percentage of frame time to start throttling",
"placeholder": "0.9",
"default": 0.9,
"advanced": true
},
{
"name": "throttle_backoff",
"type": "double",
"label": "Throttle Backoff Target",
"help": "Target percentage of frame time to backoff throttling",
"placeholder": "0.44",
"default": 0.44,
"advanced": true
}
]
},

View file

@ -66,7 +66,7 @@
<script>
var handControllerImageURL = null;
var index = 0;
var count = 5;
var count = 3;
function showKbm() {
document.getElementById("main_image").setAttribute("src", "img/tablet-help-keyboard.jpg");
@ -94,24 +94,14 @@
switch (index)
{
case 0:
handControllerImageURL = "img/tablet-help-oculus.jpg";
showHandControllers();
break;
case 1:
handControllerImageURL = "img/tablet-help-vive.jpg";
showHandControllers();
break;
case 2:
handControllerImageURL = "img/tablet-help-windowsMR.jpg";
showHandControllers();
break;
case 3:
showGamepad();
break;
case 4:
case 1:
showKbm();
break;
case 2:
showHandControllers();
break;
default:
}
}
@ -144,34 +134,33 @@
}
switch (params.handControllerName) {
case "oculus":
handControllerImageURL = "img/tablet-help-oculus.jpg";
index = 0;
break;
case "windowsMR":
handControllerImageURL = "img/tablet-help-windowsMR.jpg";
index = 2;
break;
case "vive":
default:
handControllerImageURL = "img/tablet-help-vive.jpg";
index = 1;
break;
case "oculus":
handControllerImageURL = "img/tablet-help-oculus.jpg";
break;
default:
handControllerImageURL = "";
count = 2;
}
switch (params.defaultTab) {
case "gamepad":
showGamepad();
index = 3;
break;
case "handControllers":
showHandControllers();
index = 2;
break;
case "gamepad":
showGamepad();
index = 0;
break;
case "kbm":
default:
showKbm();
index = 4;
index = 1;
}
}
</script>

View file

@ -56,7 +56,7 @@ StackView {
Qt.callLater(function() {
addressBarDialog.keyboardEnabled = HMD.active;
addressLine.forceActiveFocus();
addressBarDialog.raised = true;
addressBarDialog.keyboardRaised = true;
})
}

View file

@ -371,6 +371,8 @@ static const QString INFO_HELP_PATH = "html/tabletHelp.html";
static const unsigned int THROTTLED_SIM_FRAMERATE = 15;
static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE;
static const int ENTITY_SERVER_ADDED_TIMEOUT = 5000;
static const int ENTITY_SERVER_CONNECTION_TIMEOUT = 5000;
static const uint32_t INVALID_FRAME = UINT32_MAX;
@ -1229,6 +1231,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
getOverlays().deleteOverlay(getTabletScreenID());
getOverlays().deleteOverlay(getTabletHomeButtonID());
getOverlays().deleteOverlay(getTabletFrameID());
_failedToConnectToEntityServer = false;
});
_entityServerConnectionTimer.setSingleShot(true);
connect(&_entityServerConnectionTimer, &QTimer::timeout, this, &Application::setFailedToConnectToEntityServer);
connect(&domainHandler, &DomainHandler::connectedToDomain, this, [this]() {
if (!isServerlessMode()) {
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_ADDED_TIMEOUT);
_entityServerConnectionTimer.start();
_failedToConnectToEntityServer = false;
}
});
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
@ -3417,26 +3431,37 @@ void Application::showHelp() {
static const QString HAND_CONTROLLER_NAME_OCULUS_TOUCH = "oculus";
static const QString HAND_CONTROLLER_NAME_WINDOWS_MR = "windowsMR";
static const QString VIVE_PLUGIN_NAME = "HTC Vive";
static const QString OCULUS_RIFT_PLUGIN_NAME = "Oculus Rift";
static const QString WINDOWS_MR_PLUGIN_NAME = "WindowsMR";
static const QString TAB_KEYBOARD_MOUSE = "kbm";
static const QString TAB_GAMEPAD = "gamepad";
static const QString TAB_HAND_CONTROLLERS = "handControllers";
QString handControllerName = HAND_CONTROLLER_NAME_VIVE;
QString handControllerName;
QString defaultTab = TAB_KEYBOARD_MOUSE;
if (PluginUtils::isViveControllerAvailable()) {
defaultTab = TAB_HAND_CONTROLLERS;
handControllerName = HAND_CONTROLLER_NAME_VIVE;
} else if (PluginUtils::isOculusTouchControllerAvailable()) {
defaultTab = TAB_HAND_CONTROLLERS;
handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH;
} else if (qApp->getActiveDisplayPlugin()->getName() == "WindowMS") {
if (PluginUtils::isHMDAvailable(WINDOWS_MR_PLUGIN_NAME)) {
defaultTab = TAB_HAND_CONTROLLERS;
handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR;
} else if (PluginUtils::isHMDAvailable(VIVE_PLUGIN_NAME)) {
defaultTab = TAB_HAND_CONTROLLERS;
handControllerName = HAND_CONTROLLER_NAME_VIVE;
} else if (PluginUtils::isHMDAvailable(OCULUS_RIFT_PLUGIN_NAME)) {
if (PluginUtils::isOculusTouchControllerAvailable()) {
defaultTab = TAB_HAND_CONTROLLERS;
handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH;
} else if (PluginUtils::isXboxControllerAvailable()) {
defaultTab = TAB_GAMEPAD;
} else {
defaultTab = TAB_KEYBOARD_MOUSE;
}
} else if (PluginUtils::isXboxControllerAvailable()) {
defaultTab = TAB_GAMEPAD;
} else {
defaultTab = TAB_KEYBOARD_MOUSE;
}
// TODO need some way to detect windowsMR to load controls reference default tab in Help > Controls Reference menu.
QUrlQuery queryString;
queryString.addQueryItem("handControllerName", handControllerName);
@ -5732,6 +5757,7 @@ void Application::update(float deltaTime) {
quint64 now = usecTimestampNow();
if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) {
bool enableInterstitial = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
if (gpuTextureMemSizeStable() || !enableInterstitial) {
// we've received a new full-scene octree stats packet, or it's been long enough to try again anyway
_lastPhysicsCheckTime = now;
@ -6663,7 +6689,13 @@ void Application::resettingDomain() {
}
void Application::nodeAdded(SharedNodePointer node) const {
// nothing to do here
if (node->getType() == NodeType::EntityServer) {
if (!_failedToConnectToEntityServer) {
_entityServerConnectionTimer.stop();
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT);
_entityServerConnectionTimer.start();
}
}
}
void Application::nodeActivated(SharedNodePointer node) {
@ -6691,6 +6723,10 @@ void Application::nodeActivated(SharedNodePointer node) {
if (node->getType() == NodeType::EntityServer) {
_queryExpiry = SteadyClock::now();
_octreeQuery.incrementConnectionID();
if (!_failedToConnectToEntityServer) {
_entityServerConnectionTimer.stop();
}
}
if (node->getType() == NodeType::AudioMixer && !isInterstitialMode()) {

View file

@ -310,6 +310,7 @@ public:
bool isServerlessMode() const;
bool isInterstitialMode() const { return _interstitialMode; }
bool failedToConnectToEntityServer() const { return _failedToConnectToEntityServer; }
void replaceDomainContent(const QString& url);
@ -467,6 +468,7 @@ private slots:
void loadSettings();
void saveSettings() const;
void setFailedToConnectToEntityServer() { _failedToConnectToEntityServer = true; }
bool acceptSnapshot(const QString& urlString);
bool askToSetAvatarUrl(const QString& url);
@ -719,6 +721,7 @@ private:
bool _isForeground = true; // starts out assumed to be in foreground
bool _isGLInitialized { false };
bool _physicsEnabled { false };
bool _failedToConnectToEntityServer { false };
bool _reticleClickPressed { false };
@ -765,6 +768,7 @@ private:
QStringList _addAssetToWorldInfoMessages; // Info message
QTimer _addAssetToWorldInfoTimer;
QTimer _addAssetToWorldErrorTimer;
mutable QTimer _entityServerConnectionTimer;
FileScriptingInterface* _fileDownload;
AudioInjectorPointer _snapshotSoundInjector;

View file

@ -107,7 +107,7 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) {
}
bool SafeLanding::isLoadSequenceComplete() {
if (isEntityLoadingComplete() && isSequenceNumbersComplete()) {
if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || qApp->failedToConnectToEntityServer()) {
Locker lock(_lock);
_initialStart = INVALID_SEQUENCE;
_initialEnd = INVALID_SEQUENCE;

View file

@ -65,6 +65,6 @@ bool PluginUtils::isOculusTouchControllerAvailable() {
};
bool PluginUtils::isXboxControllerAvailable() {
return isSubdeviceContainingNameAvailable("X360 Controller");
return isSubdeviceContainingNameAvailable("X360 Controller") || isSubdeviceContainingNameAvailable("XInput Controller");
};

View file

@ -197,7 +197,7 @@
var loadingBarProgress = Overlays.addOverlay("image3d", {
name: "Loading-Bar-Progress",
localPosition: { x: 0.0, y: -0.86, z: 0.0 },
localPosition: { x: 0.0, y: -0.91, z: 0.0 },
url: LOADING_BAR_PROGRESS,
alpha: 1,
dimensions: { x: TOTAL_LOADING_PROGRESS, y: 0.3},
@ -274,6 +274,7 @@
previousCameraMode = Camera.mode;
Camera.mode = "first person";
updateProgressBar(0.0);
scaleInterstitialPage(MyAvatar.sensorToWorldScale);
timer = Script.setTimeout(update, 2000);
}
}
@ -482,7 +483,7 @@
var end = 0;
var xLocalPosition = (progressPercentage * (end - start)) + start;
var properties = {
localPosition: { x: xLocalPosition, y: -0.93, z: 0.0 },
localPosition: { x: xLocalPosition, y: (HMD.active ? -0.93 : -0.91), z: 0.0 },
dimensions: {
x: progress,
y: 0.3