mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:17:28 +02:00
Merge branch 'master' into oauth2-wordpress
This commit is contained in:
commit
5ba33a521f
9 changed files with 124 additions and 21 deletions
|
@ -3951,12 +3951,15 @@ void Application::handleSandboxStatus(QNetworkReply* reply) {
|
||||||
|
|
||||||
qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers;
|
qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers;
|
||||||
|
|
||||||
// when --url in command line, teleport to location
|
|
||||||
const QString HIFI_URL_COMMAND_LINE_KEY = "--url";
|
|
||||||
int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY);
|
|
||||||
QString addressLookupString;
|
QString addressLookupString;
|
||||||
if (urlIndex != -1) {
|
|
||||||
QUrl url(arguments().value(urlIndex + 1));
|
// when --url in command line, teleport to location
|
||||||
|
QCommandLineParser parser;
|
||||||
|
QCommandLineOption urlOption("url", "", "value");
|
||||||
|
parser.addOption(urlOption);
|
||||||
|
parser.parse(arguments());
|
||||||
|
if (parser.isSet(urlOption)) {
|
||||||
|
QUrl url = QUrl(parser.value(urlOption));
|
||||||
if (url.scheme() == URL_SCHEME_HIFIAPP) {
|
if (url.scheme() == URL_SCHEME_HIFIAPP) {
|
||||||
Setting::Handle<QVariant>("startUpApp").set(url.path());
|
Setting::Handle<QVariant>("startUpApp").set(url.path());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -407,13 +407,13 @@ void MyCharacterController::clearDetailedMotionStates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyCharacterController::buildPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
void MyCharacterController::buildPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
||||||
for (size_t i = 0; i < _detailedMotionStates.size(); i++) {
|
for (auto& detailedMotionState : _detailedMotionStates) {
|
||||||
_detailedMotionStates[i]->forceActive();
|
detailedMotionState->forceActive();
|
||||||
}
|
}
|
||||||
if (_pendingFlags & PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION) {
|
if (_pendingFlags & PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION) {
|
||||||
_pendingFlags &= ~PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION;
|
_pendingFlags &= ~PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION;
|
||||||
for (size_t i = 0; i < _detailedMotionStates.size(); i++) {
|
for (auto& detailedMotionState : _detailedMotionStates) {
|
||||||
transaction.objectsToRemove.push_back(_detailedMotionStates[i]);
|
transaction.objectsToRemove.push_back(detailedMotionState);
|
||||||
}
|
}
|
||||||
// NOTE: the DetailedMotionStates are deleted after being added to PhysicsEngine::Transaction::_objectsToRemove
|
// NOTE: the DetailedMotionStates are deleted after being added to PhysicsEngine::Transaction::_objectsToRemove
|
||||||
// See AvatarManager::handleProcessedPhysicsTransaction()
|
// See AvatarManager::handleProcessedPhysicsTransaction()
|
||||||
|
|
|
@ -116,10 +116,10 @@ void OtherAvatar::updateSpaceProxy(workload::Transaction& transaction) const {
|
||||||
|
|
||||||
int OtherAvatar::parseDataFromBuffer(const QByteArray& buffer) {
|
int OtherAvatar::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
int32_t bytesRead = Avatar::parseDataFromBuffer(buffer);
|
int32_t bytesRead = Avatar::parseDataFromBuffer(buffer);
|
||||||
for (size_t i = 0; i < _detailedMotionStates.size(); i++) {
|
for (auto& detailedMotionState : _detailedMotionStates) {
|
||||||
// NOTE: we activate _detailedMotionStates is because they are KINEMATIC
|
// NOTE: we activate _detailedMotionStates is because they are KINEMATIC
|
||||||
// and Bullet will automagically call DetailedMotionState::getWorldTransform() when active.
|
// and Bullet will automagically call DetailedMotionState::getWorldTransform() when active.
|
||||||
_detailedMotionStates[i]->forceActive();
|
detailedMotionState->forceActive();
|
||||||
}
|
}
|
||||||
if (_moving && _motionState) {
|
if (_moving && _motionState) {
|
||||||
_motionState->addDirtyFlags(Simulation::DIRTY_POSITION);
|
_motionState->addDirtyFlags(Simulation::DIRTY_POSITION);
|
||||||
|
|
|
@ -2793,6 +2793,17 @@ bool EntityTree::sendEntitiesOperation(const OctreeElementPointer& element, void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVector<QUuid> oldRenderWithZones = properties.getRenderWithZones();
|
||||||
|
if (!oldRenderWithZones.isEmpty()) {
|
||||||
|
QVector<QUuid> newRenderWithZones;
|
||||||
|
for (QUuid oldRenderWithZoneID : oldRenderWithZones) {
|
||||||
|
if (args->ourTree->findEntityByEntityItemID(oldRenderWithZoneID)) {
|
||||||
|
newRenderWithZones.append(getMapped(oldRenderWithZoneID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
properties.setRenderWithZones(newRenderWithZones);
|
||||||
|
}
|
||||||
|
|
||||||
properties.setXNNeighborID(getMapped(properties.getXNNeighborID()));
|
properties.setXNNeighborID(getMapped(properties.getXNNeighborID()));
|
||||||
properties.setXPNeighborID(getMapped(properties.getXPNeighborID()));
|
properties.setXPNeighborID(getMapped(properties.getXPNeighborID()));
|
||||||
properties.setYNNeighborID(getMapped(properties.getYNNeighborID()));
|
properties.setYNNeighborID(getMapped(properties.getYNNeighborID()));
|
||||||
|
|
|
@ -543,12 +543,8 @@ void CharacterController::setLocalBoundingBox(const glm::vec3& minCorner, const
|
||||||
_minStepHeight = DEFAULT_MIN_STEP_HEIGHT_FACTOR * (_halfHeight + _radius);
|
_minStepHeight = DEFAULT_MIN_STEP_HEIGHT_FACTOR * (_halfHeight + _radius);
|
||||||
_maxStepHeight = DEFAULT_MAX_STEP_HEIGHT_FACTOR * (_halfHeight + _radius);
|
_maxStepHeight = DEFAULT_MAX_STEP_HEIGHT_FACTOR * (_halfHeight + _radius);
|
||||||
|
|
||||||
if (_physicsEngine) {
|
_pendingFlags |= PENDING_FLAG_UPDATE_SHAPE | PENDING_FLAG_REMOVE_FROM_SIMULATION | PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION |
|
||||||
// must REMOVE from world prior to shape update
|
PENDING_FLAG_ADD_TO_SIMULATION | PENDING_FLAG_ADD_DETAILED_TO_SIMULATION;
|
||||||
_pendingFlags |= PENDING_FLAG_REMOVE_FROM_SIMULATION | PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION;
|
|
||||||
}
|
|
||||||
_pendingFlags |= PENDING_FLAG_UPDATE_SHAPE;
|
|
||||||
_pendingFlags |= PENDING_FLAG_ADD_TO_SIMULATION | PENDING_FLAG_ADD_DETAILED_TO_SIMULATION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// it's ok to change offset immediately -- there are no thread safety issues here
|
// it's ok to change offset immediately -- there are no thread safety issues here
|
||||||
|
|
|
@ -389,7 +389,8 @@
|
||||||
|
|
||||||
function time() {
|
function time() {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var month = (d.getMonth()).toString();
|
// Months are returned in range 0-11 instead of 1-12, so we have to add 1.
|
||||||
|
var month = (d.getMonth() + 1).toString();
|
||||||
var day = (d.getDate()).toString();
|
var day = (d.getDate()).toString();
|
||||||
var h = (d.getHours()).toString();
|
var h = (d.getHours()).toString();
|
||||||
var m = (d.getMinutes()).toString();
|
var m = (d.getMinutes()).toString();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
//
|
//
|
||||||
// Created by Fluffy Jenkins January 2020.
|
// Created by Fluffy Jenkins January 2020.
|
||||||
// Copyright 2020 Fluffy Jenkins
|
// Copyright 2020 Fluffy Jenkins
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
//
|
//
|
||||||
// For any future coders, please keep me in the loop when making changes.
|
// For any future coders, please keep me in the loop when making changes.
|
||||||
// Please tag me in any Pull Requests.
|
// Please tag me in any Pull Requests.
|
||||||
|
@ -98,6 +99,8 @@ function init() {
|
||||||
chatBar.sendToQml(JSON.stringify({visible: false, history: chatBarHistory}));
|
chatBar.sendToQml(JSON.stringify({visible: false, history: chatBarHistory}));
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
Messages.messageReceived.connect(messageReceived);
|
Messages.messageReceived.connect(messageReceived);
|
||||||
|
AvatarManager.avatarAddedEvent.connect(avatarJoinsDomain);
|
||||||
|
AvatarManager.avatarRemovedEvent.connect(avatarLeavesDomain);
|
||||||
|
|
||||||
connectWebSocket();
|
connectWebSocket();
|
||||||
}
|
}
|
||||||
|
@ -510,13 +513,17 @@ function messageReceived(channel, message) {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (cmd.type === "ShowChatWindow") {
|
||||||
|
toggleMainChatWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function time() {
|
function time() {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var month = (d.getMonth()).toString();
|
// Months are returned in range 0-11 instead of 1-12, so we have to add 1.
|
||||||
|
var month = (d.getMonth() + 1).toString();
|
||||||
var day = (d.getDate()).toString();
|
var day = (d.getDate()).toString();
|
||||||
var h = (d.getHours()).toString();
|
var h = (d.getHours()).toString();
|
||||||
var m = (d.getMinutes()).toString();
|
var m = (d.getMinutes()).toString();
|
||||||
|
@ -618,6 +625,46 @@ function setVisible(_visible) {
|
||||||
visible = _visible;
|
visible = _visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function avatarJoinsDomain(sessionID) {
|
||||||
|
Script.setTimeout(function () {
|
||||||
|
var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has joined."
|
||||||
|
var messageColor = { red: 122, green: 122, blue: 122 };
|
||||||
|
|
||||||
|
addToLog(messageText, "Notice", messageColor, "Domain");
|
||||||
|
|
||||||
|
if (!mutedAudio["Domain"]) {
|
||||||
|
playNotificationSound();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!muted["Domain"]) {
|
||||||
|
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||||
|
sender: "(D)",
|
||||||
|
text: messageText,
|
||||||
|
colour: { text: messageColor }
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}, 500); // Wait 500ms for the avatar to load to properly get info about them.
|
||||||
|
}
|
||||||
|
|
||||||
|
function avatarLeavesDomain(sessionID) {
|
||||||
|
var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has left."
|
||||||
|
var messageColor = { red: 122, green: 122, blue: 122 };
|
||||||
|
|
||||||
|
addToLog(messageText, "Notice", messageColor, "Domain");
|
||||||
|
|
||||||
|
if (!mutedAudio["Domain"]) {
|
||||||
|
playNotificationSound();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!muted["Domain"]) {
|
||||||
|
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||||
|
sender: "(D)",
|
||||||
|
text: messageText,
|
||||||
|
colour: { text: messageColor }
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function keyPressEvent(event) {
|
function keyPressEvent(event) {
|
||||||
if (event.key === H_KEY && !event.isAutoRepeat && event.isControl) {
|
if (event.key === H_KEY && !event.isAutoRepeat && event.isControl) {
|
||||||
toggleMainChatWindow()
|
toggleMainChatWindow()
|
||||||
|
@ -636,11 +683,25 @@ function shutdown() {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
AvatarManager.avatarAddedEvent.disconnect(avatarJoinsDomain);
|
||||||
|
} catch (e) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
AvatarManager.avatarRemovedEvent.disconnect(avatarLeavesDomain);
|
||||||
|
} catch (e) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Controller.keyPressEvent.disconnect(keyPressEvent);
|
Controller.keyPressEvent.disconnect(keyPressEvent);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
chatBar.close();
|
chatBar.close();
|
||||||
chatHistory.close();
|
chatHistory.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
//
|
||||||
|
// notificationCore.js
|
||||||
|
//
|
||||||
|
// Created by Fluffy Jenkins January 2020.
|
||||||
|
// Copyright 2020 Fluffy Jenkins
|
||||||
|
// Copyright 2020 Vircadia contributors.
|
||||||
|
//
|
||||||
|
// For any future coders, please keep me in the loop when making changes.
|
||||||
|
// Please tag me in any Pull Requests.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
var notificationList = [];
|
var notificationList = [];
|
||||||
|
|
||||||
|
@ -6,6 +20,7 @@ var sizeData = {30: {widthMul: 1.8, heightMul: 2.05, split: 35, size: 30}};
|
||||||
var DEFAULT_SIZE = 30;
|
var DEFAULT_SIZE = 30;
|
||||||
var DEFAULT_OFFSET = 10;
|
var DEFAULT_OFFSET = 10;
|
||||||
var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif";
|
var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif";
|
||||||
|
var MAIN_CHAT_APP_CHANNEL = "Chat";
|
||||||
|
|
||||||
var offset = DEFAULT_OFFSET;
|
var offset = DEFAULT_OFFSET;
|
||||||
|
|
||||||
|
@ -161,4 +176,19 @@ function notif(text, colour) {
|
||||||
notificationList.push(noti);
|
notificationList.push(noti);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Controller.mousePressEvent.connect(function (event) {
|
||||||
|
// Overlays.getOverlayAtPoint applies only to 2D overlays.
|
||||||
|
var overlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y });
|
||||||
|
if (overlay) {
|
||||||
|
for (var i = 0; i < notificationList.length; i++) {
|
||||||
|
if (overlay === notificationList[i].id) {
|
||||||
|
Overlays.deleteOverlay(notificationList[i].id)
|
||||||
|
Messages.sendMessage(MAIN_CHAT_APP_CHANNEL, JSON.stringify({
|
||||||
|
type: "ShowChatWindow",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanUp);
|
Script.scriptEnding.connect(cleanUp);
|
|
@ -474,9 +474,10 @@ function takeSnapshot() {
|
||||||
volume: 1.0
|
volume: 1.0
|
||||||
});
|
});
|
||||||
HMD.closeTablet();
|
HMD.closeTablet();
|
||||||
|
var DOUBLE_RENDER_TIME_TO_MS = 2000; // If rendering is bogged down, allow double the render time to close the tablet.
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
Window.takeSnapshot(false, includeAnimated, 1.91);
|
Window.takeSnapshot(false, includeAnimated, 1.91);
|
||||||
}, SNAPSHOT_DELAY);
|
}, Math.max(SNAPSHOT_DELAY, DOUBLE_RENDER_TIME_TO_MS / Rates.render ));
|
||||||
}, FINISH_SOUND_DELAY);
|
}, FINISH_SOUND_DELAY);
|
||||||
UserActivityLogger.logAction("snaphshot_taken", { location: location.href });
|
UserActivityLogger.logAction("snaphshot_taken", { location: location.href });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue