mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Merge remote-tracking branch 'remotes/origin/kasen/core' into kasen/core
This commit is contained in:
commit
e15c135dc5
40 changed files with 326 additions and 139 deletions
|
@ -22,6 +22,7 @@
|
|||
#include <ResourceManager.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <EntityItem.h>
|
||||
#include <EntityItemProperties.h>
|
||||
#include "ClientTraitsHandler.h"
|
||||
|
@ -235,7 +236,7 @@ void MixerAvatar::requestCurrentOwnership() {
|
|||
QNetworkRequest networkRequest;
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath(POP_MARKETPLACE_API);
|
||||
networkRequest.setUrl(requestURL);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <plugins/PluginManager.h>
|
||||
#include <EntityEditFilters.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <hfm/ModelFormatRegistry.h>
|
||||
|
||||
#include "../AssignmentDynamicFactory.h"
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <HTTPConnection.h>
|
||||
#include <LogUtils.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <udt/PacketHeaders.h>
|
||||
#include <SettingHandle.h>
|
||||
#include <SharedUtil.h>
|
||||
|
@ -121,7 +122,7 @@ bool DomainServer::forwardMetaverseAPIRequest(HTTPConnection* connection,
|
|||
root.insert(requestSubobjectKey, subobject);
|
||||
QJsonDocument doc { root };
|
||||
|
||||
QUrl url { NetworkingConstants::METAVERSE_SERVER_URL().toString() + metaversePath };
|
||||
QUrl url{ MetaverseAPI::getCurrentMetaverseServerURL().toString() + metaversePath };
|
||||
|
||||
QNetworkRequest req(url);
|
||||
req.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||
|
@ -516,7 +517,7 @@ bool DomainServer::optionallySetupOAuth() {
|
|||
|
||||
// if we don't have an oauth provider URL then we default to the default node auth url
|
||||
if (_oauthProviderURL.isEmpty()) {
|
||||
_oauthProviderURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
_oauthProviderURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
}
|
||||
|
||||
_oauthClientSecret = QProcessEnvironment::systemEnvironment().value(OAUTH_CLIENT_SECRET_ENV);
|
||||
|
@ -2222,7 +2223,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
return true;
|
||||
} else if (url.path() == URI_API_METAVERSE_INFO) {
|
||||
QJsonObject rootJSON {
|
||||
{ "metaverse_url", NetworkingConstants::METAVERSE_SERVER_URL().toString() }
|
||||
{ "metaverse_url", MetaverseAPI::getCurrentMetaverseServerURL().toString() }
|
||||
};
|
||||
|
||||
QJsonDocument docJSON{ rootJSON };
|
||||
|
@ -2449,7 +2450,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
QJsonDocument doc(root);
|
||||
|
||||
|
||||
QUrl url { NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/api/v1/places/" + place_id };
|
||||
QUrl url { MetaverseAPI::getCurrentMetaverseServerURL().toString() + "/api/v1/places/" + place_id };
|
||||
|
||||
url.setQuery("access_token=" + accessTokenVariant.toString());
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <LimitedNodeList.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <udt/PacketHeaders.h>
|
||||
#include <SharedUtil.h>
|
||||
|
||||
|
@ -209,7 +210,7 @@ void IceServer::requestDomainPublicKey(const QUuid& domainID) {
|
|||
// send a request to the metaverse API for the public key for this domain
|
||||
auto& networkAccessManager = NetworkAccessManager::getInstance();
|
||||
|
||||
QUrl publicKeyURL { NetworkingConstants::METAVERSE_SERVER_URL() };
|
||||
QUrl publicKeyURL{ MetaverseAPI::getCurrentMetaverseServerURL() };
|
||||
QString publicKeyPath = QString("/api/v1/domains/%1/public_key").arg(uuidStringWithoutCurlyBraces(domainID));
|
||||
publicKeyURL.setPath(publicKeyPath);
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
#include <ModelEntityItem.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <ObjectMotionState.h>
|
||||
#include <OctalCode.h>
|
||||
#include <OctreeSceneStats.h>
|
||||
|
@ -1216,7 +1217,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
|
||||
// set the account manager's root URL and trigger a login request if we don't have the access token
|
||||
accountManager->setIsAgent(true);
|
||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL());
|
||||
accountManager->setAuthURL(MetaverseAPI::getCurrentMetaverseServerURL());
|
||||
if (!accountManager->hasKeyPair()) {
|
||||
accountManager->generateNewUserKeypair();
|
||||
}
|
||||
|
@ -3184,7 +3185,7 @@ void Application::showLoginScreen() {
|
|||
QJsonObject loginData = {};
|
||||
loginData["action"] = "login dialog popped up";
|
||||
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
||||
_window->setWindowTitle("High Fidelity");
|
||||
_window->setWindowTitle("Project Athena");
|
||||
} else {
|
||||
resumeAfterLoginDialogActionTaken();
|
||||
}
|
||||
|
@ -7066,7 +7067,7 @@ void Application::updateWindowTitle() const {
|
|||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
auto isInErrorState = nodeList->getDomainHandler().isInErrorState();
|
||||
|
||||
QString buildVersion = " - Project Athena v0.86.0 K2 - "
|
||||
QString buildVersion = " - Project Athena Interface v0.86.0 K2 - "
|
||||
+ (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable ? QString("Version") : QString("Build"))
|
||||
+ " " + applicationVersion();
|
||||
|
||||
|
@ -8503,7 +8504,7 @@ void Application::loadAddAvatarBookmarkDialog() const {
|
|||
void Application::loadAvatarBrowser() const {
|
||||
auto tablet = dynamic_cast<TabletProxy*>(DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"));
|
||||
// construct the url to the marketplace item
|
||||
QString url = NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/marketplace?category=avatars";
|
||||
QString url = MetaverseAPI::getCurrentMetaverseServerURL().toString() + "/marketplace?category=avatars";
|
||||
|
||||
QString MARKETPLACES_INJECT_SCRIPT_PATH = "file:///" + qApp->applicationDirPath() + "/scripts/system/html/js/marketplacesInject.js";
|
||||
tablet->gotoWebScreen(url, MARKETPLACES_INJECT_SCRIPT_PATH);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <QJsonDocument>
|
||||
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <AddressManager.h>
|
||||
|
||||
#include "Wallet.h"
|
||||
|
@ -181,21 +182,28 @@ QString hfcString(const QJsonValue& sentValue, const QJsonValue& receivedValue)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
static const QString USER_PAGE_BASE_URL = NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/users/";
|
||||
static const QString PLACE_PAGE_BASE_URL = NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/places/";
|
||||
|
||||
QString getUserPageBaseUrl() {
|
||||
return MetaverseAPI::getCurrentMetaverseServerURL().toString() + "/users/";
|
||||
}
|
||||
|
||||
QString getPlacePageBaseUrl() {
|
||||
return MetaverseAPI::getCurrentMetaverseServerURL().toString() + "/places/";
|
||||
}
|
||||
|
||||
static const QStringList KNOWN_USERS(QStringList() << "highfidelity" << "marketplace");
|
||||
QString userLink(const QString& username, const QString& placename) {
|
||||
if (username.isEmpty()) {
|
||||
if (placename.isEmpty()) {
|
||||
return QString("someone");
|
||||
} else {
|
||||
return QString("someone <a href=\"%1%2\">nearby</a>").arg(PLACE_PAGE_BASE_URL, placename);
|
||||
return QString("someone <a href=\"%1%2\">nearby</a>").arg(getPlacePageBaseUrl(), placename);
|
||||
}
|
||||
}
|
||||
if (KNOWN_USERS.contains(username)) {
|
||||
return username;
|
||||
}
|
||||
return QString("<a href=\"%1%2\">%2</a>").arg(USER_PAGE_BASE_URL, username);
|
||||
return QString("<a href=\"%1%2\">%2</a>").arg(getUserPageBaseUrl(), username);
|
||||
}
|
||||
|
||||
QString transactionString(const QJsonObject& valueObject) {
|
||||
|
|
|
@ -72,11 +72,11 @@ void QmlCommerce::openSystemApp(const QString& appName) {
|
|||
else if (appPathIter->contains(".html", Qt::CaseInsensitive)) {
|
||||
QMap<QString, QString>::const_iterator injectIter = systemInject.find(appName);
|
||||
if (appPathIter == systemInject.end()) {
|
||||
tablet->gotoWebScreen(NetworkingConstants::METAVERSE_SERVER_URL().toString() + *appPathIter);
|
||||
tablet->gotoWebScreen(MetaverseAPI::getCurrentMetaverseServerURL().toString() + *appPathIter);
|
||||
}
|
||||
else {
|
||||
QString inject = "file:///" + qApp->applicationDirPath() + *injectIter;
|
||||
tablet->gotoWebScreen(NetworkingConstants::METAVERSE_SERVER_URL().toString() + *appPathIter, inject);
|
||||
tablet->gotoWebScreen(MetaverseAPI::getCurrentMetaverseServerURL().toString() + *appPathIter, inject);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <AccountManager.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <NetworkLogging.h>
|
||||
#include <UserActivityLogger.h>
|
||||
#include <UUID.h>
|
||||
|
@ -28,7 +29,7 @@ QNetworkRequest createNetworkRequest() {
|
|||
|
||||
QNetworkRequest request;
|
||||
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath(USER_ACTIVITY_URL);
|
||||
|
||||
request.setUrl(requestURL);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <OffscreenQmlDialog.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
|
||||
class AddressBarDialog : public OffscreenQmlDialog {
|
||||
Q_OBJECT
|
||||
|
@ -30,7 +31,7 @@ public:
|
|||
bool forwardEnabled() { return _forwardEnabled; }
|
||||
bool useFeed() { return _useFeed; }
|
||||
void setUseFeed(bool useFeed) { if (_useFeed != useFeed) { _useFeed = useFeed; emit useFeedChanged(); } }
|
||||
QString metaverseServerUrl() { return NetworkingConstants::METAVERSE_SERVER_URL().toString(); }
|
||||
QString metaverseServerUrl() { return MetaverseAPI::getCurrentMetaverseServerURL().toString(); }
|
||||
|
||||
signals:
|
||||
void backEnabledChanged();
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <EntityTreeRenderer.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <QtNetwork/QNetworkRequest>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
|
@ -305,7 +306,7 @@ void ContextOverlayInterface::requestOwnershipVerification(const QUuid& entityID
|
|||
QNetworkRequest networkRequest;
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath("/api/v1/commerce/proof_of_purchase_status/transfer");
|
||||
QJsonObject request;
|
||||
request["certificate_id"] = entityProperties.getCertificateID();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "EntitiesRendererLogging.h"
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
|
||||
using namespace render;
|
||||
using namespace render::entities;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <QtEndian>
|
||||
#include <QJsonDocument>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtNetwork/QNetworkRequest>
|
||||
|
@ -3218,7 +3219,7 @@ void EntityItem::retrieveMarketplacePublicKey() {
|
|||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||
QNetworkRequest networkRequest;
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath("/api/v1/commerce/marketplace_key");
|
||||
QJsonObject request;
|
||||
networkRequest.setUrl(requestURL);
|
||||
|
|
|
@ -1366,7 +1366,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
|||
* var METERS_TO_INCHES = 39.3701;
|
||||
* var entity = Entities.addEntity({
|
||||
* type: "Web",
|
||||
* sourceUrl: "https://highfidelity.com/",
|
||||
* sourceUrl: "https://projectathena.io/",
|
||||
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -4 })),
|
||||
* rotation: MyAvatar.orientation,
|
||||
* dimensions: {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <openssl/pem.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include "AccountManager.h"
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
|
@ -1464,7 +1465,7 @@ void EntityTree::startDynamicDomainVerificationOnServer(float minimumAgeToRemove
|
|||
QNetworkRequest networkRequest;
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath("/api/v1/commerce/proof_of_purchase_status/location");
|
||||
QJsonObject request;
|
||||
request["certificate_id"] = certificateID;
|
||||
|
@ -1687,7 +1688,7 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt
|
|||
QNetworkRequest networkRequest;
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
QUrl requestURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
QUrl requestURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
requestURL.setPath("/api/v1/commerce/proof_of_purchase_status/transfer");
|
||||
QJsonObject request;
|
||||
request["certificate_id"] = certID;
|
||||
|
|
|
@ -43,9 +43,10 @@
|
|||
#include <Finally.h>
|
||||
#include <Profile.h>
|
||||
|
||||
#include "NetworkLogging.h"
|
||||
#include <NetworkLogging.h>
|
||||
#include "MaterialNetworkingLogging.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <Trace.h>
|
||||
#include <StatTracker.h>
|
||||
|
||||
|
|
|
@ -24,8 +24,9 @@
|
|||
#include "AccountSettings.h"
|
||||
#include "DataServerAccountInfo.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include "MetaverseAPI.h"
|
||||
#include "NetworkAccessManager.h"
|
||||
#include "SharedUtil.h"
|
||||
#include <SharedUtil.h>
|
||||
|
||||
class JSONCallbackParameters {
|
||||
public:
|
||||
|
@ -97,7 +98,7 @@ public:
|
|||
void setTemporaryDomain(const QUuid& domainID, const QString& key);
|
||||
const QString& getTemporaryDomainKey(const QUuid& domainID) { return _accountInfo.getTemporaryDomainKey(domainID); }
|
||||
|
||||
QUrl getMetaverseServerURL() { return NetworkingConstants::METAVERSE_SERVER_URL(); }
|
||||
QUrl getMetaverseServerURL() { return MetaverseAPI::getCurrentMetaverseServerURL(); }
|
||||
|
||||
void removeAccountFromFile();
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "NetworkAccessManager.h"
|
||||
#include "NetworkLogging.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include "MetaverseAPI.h"
|
||||
|
||||
#include "ResourceManager.h"
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "Node.h"
|
||||
#include "ReceivedMessage.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include "MetaverseAPI.h"
|
||||
|
||||
const unsigned short DEFAULT_DOMAIN_SERVER_PORT =
|
||||
QProcessEnvironment::systemEnvironment()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "NetworkLogging.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include "MetaverseAPI.h"
|
||||
|
||||
void FileResourceRequest::doSend() {
|
||||
auto statTracker = DependencyManager::get<StatTracker>();
|
||||
|
|
38
libraries/networking/src/MetaverseAPI.cpp
Normal file
38
libraries/networking/src/MetaverseAPI.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// MetaverseAPI.cpp
|
||||
// libraries/networking/src
|
||||
//
|
||||
// Created by Kalila (kasenvr) on 2019-12-16.
|
||||
// Copyright 2019 Project Athena
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "MetaverseAPI.h"
|
||||
|
||||
#include <QUrl>
|
||||
#include <QDebug>
|
||||
#include "NetworkingConstants.h"
|
||||
#include <SettingHandle.h>
|
||||
|
||||
|
||||
namespace MetaverseAPI {
|
||||
// You can change the return of this function if you want to use a custom metaverse URL at compile time
|
||||
// or you can pass a custom URL via the env variable
|
||||
QUrl getCurrentMetaverseServerURL() {
|
||||
QUrl selectedMetaverseURL;
|
||||
Setting::Handle<QUrl> selectedMetaverseURLSetting("private/selectedMetaverseURL",
|
||||
NetworkingConstants::METAVERSE_SERVER_URL_STABLE);
|
||||
|
||||
selectedMetaverseURL = selectedMetaverseURLSetting.get();
|
||||
|
||||
const QString HIFI_METAVERSE_URL_ENV = "HIFI_METAVERSE_URL";
|
||||
|
||||
if (QProcessEnvironment::systemEnvironment().contains(HIFI_METAVERSE_URL_ENV)) {
|
||||
return QUrl(QProcessEnvironment::systemEnvironment().value(HIFI_METAVERSE_URL_ENV));
|
||||
}
|
||||
|
||||
return selectedMetaverseURL;
|
||||
};
|
||||
}
|
22
libraries/networking/src/MetaverseAPI.h
Normal file
22
libraries/networking/src/MetaverseAPI.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// MetaverseAPI.h
|
||||
// libraries/networking/src
|
||||
//
|
||||
// Created by Kalila (kasenvr) on 2019-12-16.
|
||||
// Copyright 2019 Project Athena
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef athena_MetaverseAPI_h
|
||||
#define athena_MetaverseAPI_h
|
||||
|
||||
#include <QtCore/QProcessEnvironment>
|
||||
#include <QtCore/QUrl>
|
||||
|
||||
namespace MetaverseAPI {
|
||||
QUrl getCurrentMetaverseServerURL();
|
||||
}
|
||||
|
||||
#endif // athena_MetaverseAPI_h
|
|
@ -1,24 +0,0 @@
|
|||
//
|
||||
// NetworkingConstants.cpp
|
||||
// libraries/networking/src
|
||||
//
|
||||
// Created by Seth Alves on 2018-2-28.
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "NetworkingConstants.h"
|
||||
|
||||
namespace NetworkingConstants {
|
||||
// You can change the return of this function if you want to use a custom metaverse URL at compile time
|
||||
// or you can pass a custom URL via the env variable
|
||||
QUrl METAVERSE_SERVER_URL() {
|
||||
const QString HIFI_METAVERSE_URL_ENV = "HIFI_METAVERSE_URL";
|
||||
const QUrl serverURL = QProcessEnvironment::systemEnvironment().contains(HIFI_METAVERSE_URL_ENV)
|
||||
? QUrl(QProcessEnvironment::systemEnvironment().value(HIFI_METAVERSE_URL_ENV))
|
||||
: METAVERSE_SERVER_URL_STABLE;
|
||||
return serverURL;
|
||||
};
|
||||
}
|
|
@ -26,8 +26,7 @@ namespace NetworkingConstants {
|
|||
// at https://staging.highfidelity.com/user/tokens/new?for_domain_server=true
|
||||
|
||||
const QUrl METAVERSE_SERVER_URL_STABLE { "https://metaverse.highfidelity.com" };
|
||||
const QUrl METAVERSE_SERVER_URL_STAGING { "https://staging.highfidelity.com" };
|
||||
QUrl METAVERSE_SERVER_URL();
|
||||
const QUrl METAVERSE_SERVER_URL_STAGING { "https://staging.projectathena.io" };
|
||||
}
|
||||
|
||||
const QString HIFI_URL_SCHEME_ABOUT = "about";
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "AccountManager.h"
|
||||
#include "LimitedNodeList.h"
|
||||
#include "NetworkingConstants.h"
|
||||
#include "MetaverseAPI.h"
|
||||
#include "SharedUtil.h"
|
||||
|
||||
QThreadStorage<OAuthNetworkAccessManager*> oauthNetworkAccessManagers;
|
||||
|
@ -35,7 +36,7 @@ QNetworkReply* OAuthNetworkAccessManager::createRequest(QNetworkAccessManager::O
|
|||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
|
||||
if (accountManager->hasValidAccessToken()
|
||||
&& req.url().host() == NetworkingConstants::METAVERSE_SERVER_URL().host()) {
|
||||
&& req.url().host() == MetaverseAPI::getCurrentMetaverseServerURL().host()) {
|
||||
QNetworkRequest authenticatedRequest(req);
|
||||
authenticatedRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
authenticatedRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <NumericalConstants.h>
|
||||
#include <GLMHelpers.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <shaders/Shaders.h>
|
||||
|
||||
#include "ShaderConstants.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <gl/OffscreenGLCanvas.h>
|
||||
#include <shared/ReadWriteLockable.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
|
||||
#include "Logging.h"
|
||||
#include "impl/SharedObject.h"
|
||||
|
|
|
@ -20,12 +20,11 @@
|
|||
#include <AccountManager.h>
|
||||
#include <NetworkAccessManager.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
|
||||
#include "ResourceRequestObserver.h"
|
||||
#include "ScriptEngine.h"
|
||||
|
||||
const QString METAVERSE_API_URL = NetworkingConstants::METAVERSE_SERVER_URL().toString() + "/api/";
|
||||
|
||||
Q_DECLARE_METATYPE(QByteArray*)
|
||||
|
||||
XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
|
||||
|
@ -126,6 +125,8 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a
|
|||
_url.setUrl(url);
|
||||
_async = async;
|
||||
|
||||
const QString METAVERSE_API_URL = MetaverseAPI::getCurrentMetaverseServerURL().toString() + "/api/";
|
||||
|
||||
if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_WIN)
|
||||
// Enable event queue debugging
|
||||
#define DEBUG_EVENT_QUEUE
|
||||
#endif
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <SettingHandle.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <AccountManager.h>
|
||||
|
||||
#include "ContextAwareProfile.h"
|
||||
|
@ -25,7 +26,7 @@
|
|||
namespace {
|
||||
|
||||
bool isAuthableHighFidelityURL(const QUrl& url) {
|
||||
auto metaverseServerURL = NetworkingConstants::METAVERSE_SERVER_URL();
|
||||
auto metaverseServerURL = MetaverseAPI::getCurrentMetaverseServerURL();
|
||||
static const QStringList HF_HOSTS = {
|
||||
"highfidelity.com", "highfidelity.io",
|
||||
metaverseServerURL.toString(), "metaverse.highfidelity.io"
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
var part1 = text.substring(0, firstMatch - 2);
|
||||
var part2 = text.substring(firstMatch, secondMatch);
|
||||
var part3 = text.substring(secondMatch + 2);
|
||||
text = part1 + "<i>" + part2 + "</i>" + part3;
|
||||
text = part1 + "<b>" + part2 + "</b>" + part3;
|
||||
}
|
||||
} else if (text.indexOf("*") !== -1) {
|
||||
var firstMatch = text.indexOf("*") + 1;
|
||||
|
@ -204,7 +204,7 @@
|
|||
var part1 = text.substring(0, firstMatch - 1);
|
||||
var part2 = text.substring(firstMatch, secondMatch);
|
||||
var part3 = text.substring(secondMatch + 1);
|
||||
text = part1 + "<b>" + part2 + "</b>" + part3;
|
||||
text = part1 + "<i>" + part2 + "</i>" + part3;
|
||||
}
|
||||
} else if (text.indexOf("__") !== -1) {
|
||||
var firstMatch = text.indexOf("__") + 2;
|
||||
|
|
|
@ -170,6 +170,51 @@ function chatColour(tab) {
|
|||
}
|
||||
}
|
||||
|
||||
var chatBarChannel = "Local";
|
||||
|
||||
|
||||
function gotoConfirm(url) {
|
||||
var result = Window.confirm("Do you want to go to '" + ((url.indexOf("/") !== -1) ? url.split("/")[2] : url) + "'?");
|
||||
if (result) {
|
||||
location = url;
|
||||
}
|
||||
}
|
||||
|
||||
function processChat(cmd) {
|
||||
var msg = cmd.message;
|
||||
if (msg.indexOf("/") === 0) {
|
||||
msg = msg.substring(1);
|
||||
var commandList = msg.split(" ");
|
||||
var cmd1 = commandList[0].toLowerCase();
|
||||
if (cmd1 === "l") {
|
||||
chatBarChannel = "Local";
|
||||
msg = "";
|
||||
}
|
||||
if (cmd1 === "d") {
|
||||
chatBarChannel = "Domain";
|
||||
msg = "";
|
||||
}
|
||||
if (cmd1 === "g") {
|
||||
chatBarChannel = "Grid";
|
||||
msg = "";
|
||||
}
|
||||
|
||||
if (cmd1 === "goto") {
|
||||
gotoConfirm(commandList[1]);
|
||||
msg = "";
|
||||
}
|
||||
|
||||
if (cmd1 === "me") {
|
||||
var tempList = commandList;
|
||||
tempList.shift();
|
||||
msg = cmd.avatarName + " " + tempList.join(" ");
|
||||
cmd.avatarName = "";
|
||||
}
|
||||
}
|
||||
cmd.message = msg;
|
||||
return cmd;
|
||||
}
|
||||
|
||||
function onWebEventReceived(event) {
|
||||
event = JSON.parse(event);
|
||||
if (event.type === "ready") {
|
||||
|
@ -189,10 +234,7 @@ function onWebEventReceived(event) {
|
|||
chatHistory.setPosition({x: 0, y: Window.innerHeight - 700});
|
||||
}
|
||||
if (event.cmd === "GOTO") {
|
||||
var result = Window.confirm("Do you want to goto " + event.url.split("/")[2] + " ?");
|
||||
if (result) {
|
||||
location = event.url;
|
||||
}
|
||||
gotoConfirm(event.url);
|
||||
}
|
||||
if (event.cmd === "URL") {
|
||||
new OverlayWebWindow({
|
||||
|
@ -208,6 +250,8 @@ function onWebEventReceived(event) {
|
|||
}
|
||||
}
|
||||
if (event.type === "WEBMSG") {
|
||||
event.avatarName = MyAvatar.displayName;
|
||||
event = processChat(event);
|
||||
if (event.message === "") return;
|
||||
sendWS({
|
||||
uuid: "",
|
||||
|
@ -215,10 +259,12 @@ function onWebEventReceived(event) {
|
|||
channel: event.tab,
|
||||
colour: chatColour(event.tab),
|
||||
message: event.message,
|
||||
displayName: MyAvatar.displayName
|
||||
displayName: event.avatarName
|
||||
});
|
||||
}
|
||||
if (event.type === "MSG") {
|
||||
event.avatarName = MyAvatar.displayName;
|
||||
event = processChat(event);
|
||||
if (event.message === "") return;
|
||||
Messages.sendMessage("Chat", JSON.stringify({
|
||||
type: "TransmitChatMessage",
|
||||
|
@ -226,7 +272,7 @@ function onWebEventReceived(event) {
|
|||
channel: event.tab,
|
||||
colour: chatColour(event.tab),
|
||||
message: event.message,
|
||||
displayName: MyAvatar.displayName
|
||||
displayName: event.avatarName
|
||||
}));
|
||||
setVisible(false);
|
||||
}
|
||||
|
@ -242,7 +288,7 @@ function replaceFormatting(text) {
|
|||
var part1 = text.substring(0, firstMatch - 2);
|
||||
var part2 = text.substring(firstMatch, secondMatch);
|
||||
var part3 = text.substring(secondMatch + 2);
|
||||
text = part1 + "<i>" + part2 + "</i>" + part3;
|
||||
text = part1 + "<b>" + part2 + "</b>" + part3;
|
||||
}
|
||||
} else if (text.indexOf("*") !== -1) {
|
||||
var firstMatch = text.indexOf("*") + 1;
|
||||
|
@ -252,7 +298,7 @@ function replaceFormatting(text) {
|
|||
var part1 = text.substring(0, firstMatch - 1);
|
||||
var part2 = text.substring(firstMatch, secondMatch);
|
||||
var part3 = text.substring(secondMatch + 1);
|
||||
text = part1 + "<b>" + part2 + "</b>" + part3;
|
||||
text = part1 + "<i>" + part2 + "</i>" + part3;
|
||||
}
|
||||
} else if (text.indexOf("__") !== -1) {
|
||||
var firstMatch = text.indexOf("__") + 2;
|
||||
|
@ -386,28 +432,37 @@ function fromQml(message) {
|
|||
if (cmd.type === "MSG") {
|
||||
if (cmd.message !== "") {
|
||||
if (cmd.event.modifiers === CONTROL_KEY) {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
Messages.sendMessage(FLOOF_CHAT_CHANNEL, JSON.stringify({
|
||||
type: "TransmitChatMessage", channel: "Domain", colour: chatColour("Domain"),
|
||||
message: cmd.message,
|
||||
displayName: MyAvatar.displayName
|
||||
displayName: cmd.avatarName
|
||||
}));
|
||||
} else if (cmd.event.modifiers === CONTROL_KEY + SHIFT_KEY) {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
sendWS({
|
||||
uuid: "",
|
||||
type: "WebChat",
|
||||
channel: "Grid",
|
||||
colour: chatColour("Grid"),
|
||||
message: cmd.message,
|
||||
displayName: MyAvatar.displayName
|
||||
displayName: cmd.avatarName
|
||||
});
|
||||
} else {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
Messages.sendMessage(FLOOF_CHAT_CHANNEL, JSON.stringify({
|
||||
type: "TransmitChatMessage",
|
||||
channel: "Local",
|
||||
channel: chatBarChannel,
|
||||
position: MyAvatar.position,
|
||||
colour: chatColour("Local"),
|
||||
colour: chatColour(chatBarChannel),
|
||||
message: cmd.message,
|
||||
displayName: MyAvatar.displayName
|
||||
displayName: cmd.avatarName
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,9 +24,7 @@ var DEFAULT_SCRIPTS_COMBINED = [
|
|||
"system/avatarapp.js",
|
||||
"system/makeUserConnection.js",
|
||||
"system/tablet-goto.js",
|
||||
"system/marketplaces/marketplaces.js",
|
||||
"system/notifications.js",
|
||||
"system/commerce/wallet.js",
|
||||
"system/create/edit.js",
|
||||
"system/dialTone.js",
|
||||
"system/firstPersonHMD.js",
|
||||
|
|
|
@ -427,7 +427,7 @@ const DEFAULT_ENTITY_PROPERTIES = {
|
|||
y: 0.9,
|
||||
z: 0.01
|
||||
},
|
||||
sourceUrl: "https://highfidelity.com/",
|
||||
sourceUrl: "https://projectathena.io/",
|
||||
dpi: 30,
|
||||
},
|
||||
ParticleEffect: {
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
// Created by Clément Brisset on March 20, 2014
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// Allows you to inspect non moving objects (Voxels or Avatars) using Atl, Control (Command on Mac) and Shift
|
||||
// Enables you to inspect entities and avatars using Alt and key combinations:
|
||||
// - Alt + mouse up/down zooms in/out.
|
||||
// - Alt + mouse left/right orbits left/right.
|
||||
// - Alt + Ctrl + mouse up/down/left/right: orbits over / under / left / right.
|
||||
// - Alt + Ctrl + Shift + mouse up/down/left/right: pans down / up / right / left.
|
||||
//
|
||||
// radial mode = hold ALT
|
||||
// orbit mode = hold ALT + CONTROL
|
||||
// pan mode = hold ALT + CONTROL + SHIFT
|
||||
// Once you are in a mode left click on the object to inspect and hold the click
|
||||
// Dragging the mouse will move your camera according to the mode you are in.
|
||||
// Your camera stays where it is when you release the Alt key, enabling you to Alt + left - click on another entity or
|
||||
// avatar to further move your view.
|
||||
//
|
||||
// Press Esc or move your avatar to revert back to your default view.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
@ -25,6 +28,9 @@ var ALTITUDE_RATE = 200.0;
|
|||
var RADIUS_RATE = 1.0 / 100.0;
|
||||
var PAN_RATE = 250.0;
|
||||
|
||||
var AVATAR_POSITION_SLOP = 0.1;
|
||||
var AVATAR_ROTATION_SLOP = 0.09; // 5 degrees
|
||||
|
||||
var Y_AXIS = {
|
||||
x: 0,
|
||||
y: 1,
|
||||
|
@ -36,7 +42,7 @@ var X_AXIS = {
|
|||
z: 0
|
||||
};
|
||||
|
||||
var LOOK_AT_TIME = 500;
|
||||
var LOOK_AT_TIME = 100; // ms
|
||||
|
||||
var alt = false;
|
||||
var shift = false;
|
||||
|
@ -53,6 +59,29 @@ var detachedMode = 4;
|
|||
|
||||
var mode = noMode;
|
||||
|
||||
var isAwayEnabled = true;
|
||||
|
||||
var EDIT_CAMERA_MANAGER_CHANNEL = "Edit-Camera-Manager-Channel";
|
||||
var isEditUsingCamera = false;
|
||||
Messages.messageReceived.connect(function (channel, data, senderID, localOnly) {
|
||||
if (channel === EDIT_CAMERA_MANAGER_CHANNEL && senderID === MyAvatar.sessionUUID && localOnly) {
|
||||
var message;
|
||||
try {
|
||||
message = JSON.parse(data);
|
||||
isEditUsingCamera = message.enabled;
|
||||
} catch (e) {
|
||||
// Ignore.
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var pick = Picks.createPick(PickType.Ray, {
|
||||
filter: Picks.PICK_DOMAIN_ENTITIES | Picks.PICK_AVATAR_ENTITIES | Picks.PICK_AVATARS | Picks.INCLUDE_VISIBLE
|
||||
| Picks.PICK_INCLUDE_COLLIDABLE | Picks.PICK_INCLUDE_NONCOLLIDABLE | Picks.PICK_PRECISE,
|
||||
joint: "Mouse",
|
||||
enabled: false
|
||||
});
|
||||
|
||||
var mouseLastX = 0;
|
||||
var mouseLastY = 0;
|
||||
|
||||
|
@ -144,6 +173,14 @@ function handlePanMode(dx, dy) {
|
|||
Camera.setOrientation(orientationOf(vector));
|
||||
}
|
||||
|
||||
function enableAway(enable) {
|
||||
if (enable !== isAwayEnabled) {
|
||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||
Messages.sendMessage(CHANNEL_AWAY_ENABLE, enable ? "enable" : "disable", true);
|
||||
}
|
||||
isAwayEnabled = enable;
|
||||
}
|
||||
|
||||
function saveCameraState() {
|
||||
oldMode = Camera.mode;
|
||||
oldPosition = Camera.getPosition();
|
||||
|
@ -160,7 +197,11 @@ function restoreCameraState() {
|
|||
}
|
||||
|
||||
function handleModes() {
|
||||
var newMode = (mode == noMode) ? noMode : detachedMode;
|
||||
if (isEditUsingCamera) {
|
||||
return;
|
||||
}
|
||||
|
||||
var newMode = (mode === noMode) ? noMode : detachedMode;
|
||||
if (alt) {
|
||||
if (control) {
|
||||
if (shift) {
|
||||
|
@ -174,54 +215,62 @@ function handleModes() {
|
|||
}
|
||||
|
||||
// if entering detachMode
|
||||
if (newMode == detachedMode && mode != detachedMode) {
|
||||
if (newMode === detachedMode && mode !== detachedMode) {
|
||||
avatarPosition = MyAvatar.position;
|
||||
avatarOrientation = MyAvatar.orientation;
|
||||
}
|
||||
// if leaving detachMode
|
||||
if (mode == detachedMode && newMode == detachedMode &&
|
||||
(avatarPosition.x != MyAvatar.position.x ||
|
||||
avatarPosition.y != MyAvatar.position.y ||
|
||||
avatarPosition.z != MyAvatar.position.z ||
|
||||
avatarOrientation.x != MyAvatar.orientation.x ||
|
||||
avatarOrientation.y != MyAvatar.orientation.y ||
|
||||
avatarOrientation.z != MyAvatar.orientation.z ||
|
||||
avatarOrientation.w != MyAvatar.orientation.w)) {
|
||||
if (mode === detachedMode && newMode === detachedMode && (
|
||||
Vec3.length(Vec3.subtract(avatarPosition, MyAvatar.position)) > AVATAR_POSITION_SLOP
|
||||
|| Vec3.length(Vec3.subtract(Quat.getFront(avatarOrientation), Quat.getFront(MyAvatar.orientation)))
|
||||
> AVATAR_ROTATION_SLOP)) {
|
||||
newMode = noMode;
|
||||
}
|
||||
|
||||
if (mode == noMode && newMode != noMode && Camera.mode == "independent") {
|
||||
if (mode === noMode && newMode !== noMode && Camera.mode === "independent") {
|
||||
newMode = noMode;
|
||||
}
|
||||
|
||||
// if leaving noMode
|
||||
if (mode == noMode && newMode != noMode) {
|
||||
if (mode === noMode && newMode !== noMode) {
|
||||
saveCameraState();
|
||||
}
|
||||
// if entering noMode
|
||||
if (newMode == noMode && mode != noMode) {
|
||||
if (newMode === noMode && mode !== noMode) {
|
||||
restoreCameraState();
|
||||
}
|
||||
|
||||
mode = newMode;
|
||||
|
||||
enableAway(mode === noMode);
|
||||
}
|
||||
|
||||
function keyPressEvent(event) {
|
||||
var changed = false;
|
||||
|
||||
if (event.text == "ALT") {
|
||||
if (event.text === "ALT") {
|
||||
if (isEditUsingCamera) {
|
||||
return;
|
||||
}
|
||||
alt = true;
|
||||
changed = true;
|
||||
Picks.enablePick(pick);
|
||||
}
|
||||
if (event.text == "CONTROL") {
|
||||
if (event.text === "CONTROL") {
|
||||
control = true;
|
||||
changed = true;
|
||||
}
|
||||
if (event.text == "SHIFT") {
|
||||
if (event.text === "SHIFT") {
|
||||
shift = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (mode !== noMode && !alt && !control && !shift && /^ESC|LEFT|RIGHT|UP|DOWN|[wasdWASD]$/.test(event.text)) {
|
||||
mode = noMode;
|
||||
restoreCameraState();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
handleModes();
|
||||
}
|
||||
|
@ -230,17 +279,16 @@ function keyPressEvent(event) {
|
|||
function keyReleaseEvent(event) {
|
||||
var changed = false;
|
||||
|
||||
if (event.text == "ALT") {
|
||||
if (event.text === "ALT") {
|
||||
alt = false;
|
||||
changed = true;
|
||||
mode = noMode;
|
||||
restoreCameraState();
|
||||
Picks.disablePick(pick);
|
||||
}
|
||||
if (event.text == "CONTROL") {
|
||||
if (event.text === "CONTROL") {
|
||||
control = false;
|
||||
changed = true;
|
||||
}
|
||||
if (event.text == "SHIFT") {
|
||||
if (event.text === "SHIFT") {
|
||||
shift = false;
|
||||
changed = true;
|
||||
}
|
||||
|
@ -255,34 +303,32 @@ function mousePressEvent(event) {
|
|||
mouseLastX = event.x;
|
||||
mouseLastY = event.y;
|
||||
|
||||
// Compute trajectories related values
|
||||
var pickRay = Camera.computePickRay(mouseLastX, mouseLastY);
|
||||
var modelIntersection = Entities.findRayIntersection(pickRay, true);
|
||||
var avatarIntersection = AvatarList.findRayIntersection(pickRay);
|
||||
position = Camera.position;
|
||||
|
||||
position = Camera.getPosition();
|
||||
|
||||
if (avatarIntersection.intersects || (modelIntersection.intersects && modelIntersection.accurate)) {
|
||||
if (avatarIntersection.intersects) {
|
||||
center = avatarIntersection.intersection;
|
||||
} else {
|
||||
center = modelIntersection.intersection;
|
||||
}
|
||||
// We've selected our target, now orbit towards it automatically
|
||||
rotatingTowardsTarget = true;
|
||||
// calculate our target cam rotation
|
||||
Script.setTimeout(function () {
|
||||
rotatingTowardsTarget = false;
|
||||
}, LOOK_AT_TIME);
|
||||
|
||||
vector = Vec3.subtract(position, center);
|
||||
targetCamOrientation = orientationOf(vector);
|
||||
radius = Vec3.length(vector);
|
||||
azimuth = Math.atan2(vector.z, vector.x);
|
||||
altitude = Math.asin(vector.y / Vec3.length(vector));
|
||||
|
||||
isActive = true;
|
||||
var pickResult = Picks.getPrevPickResult(pick);
|
||||
if (pickResult.intersects) {
|
||||
// Orbit about intersection.
|
||||
center = pickResult.intersection;
|
||||
} else {
|
||||
// Orbit about point in space.
|
||||
var ORBIT_DISTANCE = 10.0;
|
||||
center = Vec3.sum(position, Vec3.multiply(ORBIT_DISTANCE, pickResult.searchRay.direction));
|
||||
}
|
||||
|
||||
// We've selected our target, now orbit towards it automatically
|
||||
rotatingTowardsTarget = true;
|
||||
// calculate our target cam rotation
|
||||
Script.setTimeout(function () {
|
||||
rotatingTowardsTarget = false;
|
||||
}, LOOK_AT_TIME);
|
||||
|
||||
vector = Vec3.subtract(position, center);
|
||||
targetCamOrientation = orientationOf(vector);
|
||||
radius = Vec3.length(vector);
|
||||
azimuth = Math.atan2(vector.z, vector.x);
|
||||
altitude = Math.asin(vector.y / Vec3.length(vector));
|
||||
|
||||
isActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,14 +339,14 @@ function mouseReleaseEvent(event) {
|
|||
}
|
||||
|
||||
function mouseMoveEvent(event) {
|
||||
if (isActive && mode != noMode && !rotatingTowardsTarget) {
|
||||
if (mode == radialMode) {
|
||||
if (isActive && mode !== noMode && !rotatingTowardsTarget) {
|
||||
if (mode === radialMode) {
|
||||
handleRadialMode(event.x - mouseLastX, event.y - mouseLastY);
|
||||
}
|
||||
if (mode == orbitMode) {
|
||||
if (mode === orbitMode) {
|
||||
handleOrbitMode(event.x - mouseLastX, event.y - mouseLastY);
|
||||
}
|
||||
if (mode == panningMode) {
|
||||
if (mode === panningMode) {
|
||||
handlePanMode(event.x - mouseLastX, event.y - mouseLastY);
|
||||
}
|
||||
}
|
||||
|
@ -308,6 +354,11 @@ function mouseMoveEvent(event) {
|
|||
mouseLastY = event.y;
|
||||
}
|
||||
|
||||
function onCameraModeUpdated(newMode) {
|
||||
mode = noMode;
|
||||
handleModes();
|
||||
}
|
||||
|
||||
function update() {
|
||||
handleModes();
|
||||
if (rotatingTowardsTarget) {
|
||||
|
@ -316,13 +367,15 @@ function update() {
|
|||
}
|
||||
|
||||
function rotateTowardsTarget() {
|
||||
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, 0.1);
|
||||
var MIX_FACTOR = 0.1;
|
||||
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, MIX_FACTOR);
|
||||
Camera.setOrientation(newOrientation);
|
||||
}
|
||||
|
||||
function scriptEnding() {
|
||||
if (mode != noMode) {
|
||||
if (mode !== noMode) {
|
||||
restoreCameraState();
|
||||
enableAway(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,5 +386,7 @@ Controller.mousePressEvent.connect(mousePressEvent);
|
|||
Controller.mouseReleaseEvent.connect(mouseReleaseEvent);
|
||||
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
||||
|
||||
Camera.modeUpdated.connect(onCameraModeUpdated);
|
||||
|
||||
Script.update.connect(update);
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
|
|
|
@ -68,6 +68,8 @@ CameraManager = function() {
|
|||
|
||||
that.enabled = false;
|
||||
that.mode = MODE_INACTIVE;
|
||||
var EDIT_CAMERA_MANAGER_CHANNEL = "Edit-Camera-Manager-Channel";
|
||||
Messages.sendLocalMessage(EDIT_CAMERA_MANAGER_CHANNEL, JSON.stringify({ enabled: false }));
|
||||
|
||||
var actions = {
|
||||
orbitLeft: 0,
|
||||
|
@ -153,6 +155,7 @@ CameraManager = function() {
|
|||
|
||||
that.enabled = true;
|
||||
that.mode = MODE_INACTIVE;
|
||||
Messages.sendLocalMessage(EDIT_CAMERA_MANAGER_CHANNEL, JSON.stringify({ enabled: true }));
|
||||
|
||||
// Pick a point INITIAL_ZOOM_DISTANCE in front of the camera to use as a focal point
|
||||
that.zoomDistance = INITIAL_ZOOM_DISTANCE;
|
||||
|
@ -193,6 +196,7 @@ CameraManager = function() {
|
|||
|
||||
that.enabled = false;
|
||||
that.mode = MODE_INACTIVE;
|
||||
Messages.sendLocalMessage(EDIT_CAMERA_MANAGER_CHANNEL, JSON.stringify({ enabled: false }));
|
||||
|
||||
if (!ignoreCamera) {
|
||||
Camera.mode = that.previousCameraMode;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <NetworkLogging.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <SharedLogging.h>
|
||||
#include <AddressManager.h>
|
||||
#include <DependencyManager.h>
|
||||
|
@ -106,7 +107,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
|
|||
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
accountManager->setIsAgent(true);
|
||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL());
|
||||
accountManager->setAuthURL(MetaverseAPI::getCurrentMetaverseServerURL());
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <NetworkLogging.h>
|
||||
#include <NetworkingConstants.h>
|
||||
#include <MetaverseAPI.h>
|
||||
#include <SharedLogging.h>
|
||||
#include <AddressManager.h>
|
||||
#include <DependencyManager.h>
|
||||
|
@ -144,7 +145,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) :
|
|||
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
accountManager->setIsAgent(true);
|
||||
accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL());
|
||||
accountManager->setAuthURL(MetaverseAPI::getCurrentMetaverseServerURL());
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
<?js } ?>
|
||||
|
||||
<!-- Start Google Analytics Tag -->
|
||||
<!--
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
|
@ -81,13 +82,17 @@
|
|||
ga('create', '{{ theme_config.google_analytics_code }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
-->
|
||||
<!-- End Google Analytics Tag -->
|
||||
|
||||
<!-- Start of HubSpot Embed Code -->
|
||||
<!--
|
||||
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/5066246.js"></script>
|
||||
-->
|
||||
<!-- End of HubSpot Embed Code -->
|
||||
|
||||
<!-- Start Quantcast Tag -->
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
var _qevents = _qevents || [];
|
||||
(function() {
|
||||
|
@ -103,10 +108,12 @@ _qevents.push({qacct: "p-tK6PFLJY3q1s-"});
|
|||
<noscript>
|
||||
<img src="//pixel.quantserve.com/pixel/p-tK6PFLJY3q1s-.gif?labels=_fp.event.Default" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
|
||||
</noscript>
|
||||
-->
|
||||
<!-- End Quantcast Tag -->
|
||||
|
||||
|
||||
<!-- Start Hotjar Tracking Code for https://highfidelity.com/ -->
|
||||
<!--
|
||||
<script>
|
||||
(function(h,o,t,j,a,r){
|
||||
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
|
||||
|
@ -117,6 +124,7 @@ _qevents.push({qacct: "p-tK6PFLJY3q1s-"});
|
|||
a.appendChild(r);
|
||||
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
|
||||
</script>
|
||||
-->
|
||||
<!-- End Hotjar Tracking Code for https://highfidelity.com/ -->
|
||||
|
||||
|
||||
|
|
|
@ -279,5 +279,6 @@
|
|||
"toolbar/com.highfidelity.interface.toolbar.system/x": 655,
|
||||
"toolbar/com.highfidelity.interface.toolbar.system/y": 953,
|
||||
"toolbar/constrainToolbarToCenterX": true,
|
||||
"private/selectedMetaverseURL": "https://metaverse.highfidelity.com",
|
||||
"wallet/autoLogout": true
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ if (WIN32)
|
|||
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG "/OPT:NOREF /OPT:NOICF")
|
||||
endif()
|
||||
|
||||
link_hifi_libraries(entities-renderer platform)
|
||||
link_hifi_libraries(entities-renderer platform physics)
|
||||
|
||||
# perform standard include and linking for found externals
|
||||
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
||||
|
|
Loading…
Reference in a new issue