mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +02:00
Merge branch 'instancing' of github.com:highfidelity/hifi into instancing
This commit is contained in:
commit
3e8d6671f7
25 changed files with 154 additions and 67 deletions
|
@ -33,7 +33,7 @@ const QString ASSIGNMENT_CLIENT_MONITOR_TARGET_NAME = "assignment-client-monitor
|
||||||
const int WAIT_FOR_CHILD_MSECS = 1000;
|
const int WAIT_FOR_CHILD_MSECS = 1000;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
HANDLE PROCESS_GROUP = createProcessGroup();
|
void* PROCESS_GROUP = createProcessGroup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmentClientForks,
|
AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmentClientForks,
|
||||||
|
|
|
@ -252,6 +252,7 @@
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
#include <VersionHelpers.h>
|
#include <VersionHelpers.h>
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
// On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU
|
// On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU
|
||||||
// FIXME seems to be broken.
|
// FIXME seems to be broken.
|
||||||
|
@ -532,6 +533,11 @@ bool isDomainURL(QUrl url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
static const UINT UWM_IDENTIFY_INSTANCES =
|
||||||
|
RegisterWindowMessage("UWM_IDENTIFY_INSTANCES_{8AB82783-B74A-4258-955B-8188C22AA0D6}_" + qgetenv("USERNAME"));
|
||||||
|
static const UINT UWM_SHOW_APPLICATION =
|
||||||
|
RegisterWindowMessage("UWM_SHOW_APPLICATION_{71123FD6-3DA8-4DC1-9C27-8A12A6250CBA}_" + qgetenv("USERNAME"));
|
||||||
|
|
||||||
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
||||||
public:
|
public:
|
||||||
static MyNativeEventFilter& getInstance() {
|
static MyNativeEventFilter& getInstance() {
|
||||||
|
@ -4957,7 +4963,7 @@ extern "C" {
|
||||||
CCHAR NumberOfProcessors;
|
CCHAR NumberOfProcessors;
|
||||||
};
|
};
|
||||||
|
|
||||||
NTSYSCALLAPI NTSTATUS NTAPI NtQuerySystemInformation(
|
NTSYSCALLAPI LONG NTAPI NtQuerySystemInformation(
|
||||||
_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
_Out_writes_bytes_opt_(SystemInformationLength) PVOID SystemInformation,
|
_Out_writes_bytes_opt_(SystemInformationLength) PVOID SystemInformation,
|
||||||
_In_ ULONG SystemInformationLength,
|
_In_ ULONG SystemInformationLength,
|
||||||
|
@ -4966,12 +4972,12 @@ extern "C" {
|
||||||
|
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
NTSTATUS NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, T& t) {
|
LONG NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, T& t) {
|
||||||
return NtQuerySystemInformation(SystemInformationClass, &t, (ULONG)sizeof(T), nullptr);
|
return NtQuerySystemInformation(SystemInformationClass, &t, (ULONG)sizeof(T), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
NTSTATUS NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, std::vector<T>& t) {
|
LONG NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, std::vector<T>& t) {
|
||||||
return NtQuerySystemInformation(SystemInformationClass, t.data(), (ULONG)(sizeof(T) * t.size()), nullptr);
|
return NtQuerySystemInformation(SystemInformationClass, t.data(), (ULONG)(sizeof(T) * t.size()), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,12 +91,6 @@ namespace controller {
|
||||||
class StateController;
|
class StateController;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
static const UINT UWM_IDENTIFY_INSTANCES =
|
|
||||||
RegisterWindowMessage("UWM_IDENTIFY_INSTANCES_{8AB82783-B74A-4258-955B-8188C22AA0D6}_" + qgetenv("USERNAME"));
|
|
||||||
static const UINT UWM_SHOW_APPLICATION =
|
|
||||||
RegisterWindowMessage("UWM_SHOW_APPLICATION_{71123FD6-3DA8-4DC1-9C27-8A12A6250CBA}_" + qgetenv("USERNAME"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||||
static const QString SCRIPTS_SWITCH = "scripts";
|
static const QString SCRIPTS_SWITCH = "scripts";
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "Profile.h"
|
#include "Profile.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
#include <Windows.h>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
typedef int(__stdcall * CHECKMINSPECPROC) ();
|
typedef int(__stdcall * CHECKMINSPECPROC) ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QThread>
|
#include <QtCore/QThread>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtWidgets/QDesktopWidget>
|
#include <QtGui/QScreen>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
|
|
||||||
#include <DebugDraw.h>
|
#include <DebugDraw.h>
|
||||||
#include <shared/QtHelpers.h>
|
#include <shared/QtHelpers.h>
|
||||||
|
@ -177,9 +177,35 @@ QPointF CompositorHelper::getMouseEventPosition(QMouseEvent* event) {
|
||||||
return event->localPos();
|
return event->localPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isWindowActive() {
|
||||||
|
for (const auto& window : QGuiApplication::topLevelWindows()) {
|
||||||
|
if (window->isActive()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool CompositorHelper::shouldCaptureMouse() const {
|
bool CompositorHelper::shouldCaptureMouse() const {
|
||||||
|
if (!_allowMouseCapture) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isHMD()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!isWindowActive()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ui::Menu::isSomeSubmenuShown()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// if we're in HMD mode, and some window of ours is active, but we're not currently showing a popup menu
|
// if we're in HMD mode, and some window of ours is active, but we're not currently showing a popup menu
|
||||||
return _allowMouseCapture && isHMD() && QApplication::activeWindow() && !ui::Menu::isSomeSubmenuShown();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositorHelper::setAllowMouseCapture(bool capture) {
|
void CompositorHelper::setAllowMouseCapture(bool capture) {
|
||||||
|
@ -206,9 +232,9 @@ void CompositorHelper::handleLeaveEvent() {
|
||||||
mainWidgetFrame.moveTopLeft(topLeftScreen);
|
mainWidgetFrame.moveTopLeft(topLeftScreen);
|
||||||
}
|
}
|
||||||
QRect uncoveredRect = mainWidgetFrame;
|
QRect uncoveredRect = mainWidgetFrame;
|
||||||
foreach(QWidget* widget, QApplication::topLevelWidgets()) {
|
for(QWindow* window : QGuiApplication::topLevelWindows()) {
|
||||||
if (widget->isWindow() && widget->isVisible() && widget != mainWidget) {
|
if (window->isVisible() && window != mainWidget->windowHandle()) {
|
||||||
QRect widgetFrame = widget->frameGeometry();
|
QRect widgetFrame = window->frameGeometry();
|
||||||
if (widgetFrame.intersects(uncoveredRect)) {
|
if (widgetFrame.intersects(uncoveredRect)) {
|
||||||
QRect intersection = uncoveredRect & widgetFrame;
|
QRect intersection = uncoveredRect & widgetFrame;
|
||||||
if (intersection.top() > uncoveredRect.top()) {
|
if (intersection.top() > uncoveredRect.top()) {
|
||||||
|
@ -292,7 +318,7 @@ glm::vec2 CompositorHelper::getReticleMaximumPosition() const {
|
||||||
if (isHMD()) {
|
if (isHMD()) {
|
||||||
result = VIRTUAL_SCREEN_SIZE;
|
result = VIRTUAL_SCREEN_SIZE;
|
||||||
} else {
|
} else {
|
||||||
QRect rec = QApplication::desktop()->screenGeometry();
|
QRect rec = QGuiApplication::primaryScreen()->geometry();
|
||||||
result = glm::vec2(rec.right(), rec.bottom());
|
result = glm::vec2(rec.right(), rec.bottom());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -308,8 +334,8 @@ void CompositorHelper::sendFakeMouseEvent() {
|
||||||
// in HMD mode we need to fake our mouse moves...
|
// in HMD mode we need to fake our mouse moves...
|
||||||
QPoint globalPos(_reticlePositionInHMD.x, _reticlePositionInHMD.y);
|
QPoint globalPos(_reticlePositionInHMD.x, _reticlePositionInHMD.y);
|
||||||
auto button = Qt::NoButton;
|
auto button = Qt::NoButton;
|
||||||
auto buttons = QApplication::mouseButtons();
|
auto buttons = QGuiApplication::mouseButtons();
|
||||||
auto modifiers = QApplication::keyboardModifiers();
|
auto modifiers = QGuiApplication::keyboardModifiers();
|
||||||
QMouseEvent event(QEvent::MouseMove, globalPos, button, buttons, modifiers);
|
QMouseEvent event(QEvent::MouseMove, globalPos, button, buttons, modifiers);
|
||||||
_fakeMouseEvent = true;
|
_fakeMouseEvent = true;
|
||||||
qApp->sendEvent(_renderingWidget, &event);
|
qApp->sendEvent(_renderingWidget, &event);
|
||||||
|
|
|
@ -373,7 +373,7 @@ void OpenGLDisplayPlugin::customizeContext() {
|
||||||
auto usage = gpu::Texture::Usage::Builder().withColor().withAlpha();
|
auto usage = gpu::Texture::Usage::Builder().withColor().withAlpha();
|
||||||
cursorData.texture->setUsage(usage.build());
|
cursorData.texture->setUsage(usage.build());
|
||||||
cursorData.texture->setStoredMipFormat(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA));
|
cursorData.texture->setStoredMipFormat(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA));
|
||||||
cursorData.texture->assignStoredMip(0, image.byteCount(), image.constBits());
|
cursorData.texture->assignStoredMip(0, image.sizeInBytes(), image.constBits());
|
||||||
cursorData.texture->setAutoGenerateMips(true);
|
cursorData.texture->setAutoGenerateMips(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,7 +290,7 @@ void HmdDisplayPlugin::internalPresent() {
|
||||||
_previewTexture->setSource("HMD Preview Texture");
|
_previewTexture->setSource("HMD Preview Texture");
|
||||||
_previewTexture->setUsage(gpu::Texture::Usage::Builder().withColor().build());
|
_previewTexture->setUsage(gpu::Texture::Usage::Builder().withColor().build());
|
||||||
_previewTexture->setStoredMipFormat(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA));
|
_previewTexture->setStoredMipFormat(gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA));
|
||||||
_previewTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
_previewTexture->assignStoredMip(0, image.sizeInBytes(), image.constBits());
|
||||||
_previewTexture->setAutoGenerateMips(true);
|
_previewTexture->setAutoGenerateMips(true);
|
||||||
|
|
||||||
auto viewport = getViewportForSourceSize(uvec2(_previewTexture->getDimensions()));
|
auto viewport = getViewportForSourceSize(uvec2(_previewTexture->getDimensions()));
|
||||||
|
|
|
@ -666,7 +666,7 @@ QScriptValue EntityScriptingInterface::getMultipleEntityProperties(QScriptContex
|
||||||
const int ARGUMENT_EXTENDED_DESIRED_PROPERTIES = 1;
|
const int ARGUMENT_EXTENDED_DESIRED_PROPERTIES = 1;
|
||||||
|
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
const auto entityIDs = qScriptValueToValue<QVector<QUuid>>(context->argument(ARGUMENT_ENTITY_IDS));
|
const auto entityIDs = qscriptvalue_cast<QVector<QUuid>>(context->argument(ARGUMENT_ENTITY_IDS));
|
||||||
return entityScriptingInterface->getMultipleEntityPropertiesInternal(engine, entityIDs, context->argument(ARGUMENT_EXTENDED_DESIRED_PROPERTIES));
|
return entityScriptingInterface->getMultipleEntityPropertiesInternal(engine, entityIDs, context->argument(ARGUMENT_EXTENDED_DESIRED_PROPERTIES));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ QScriptValue EntityScriptingInterface::getMultipleEntityPropertiesInternal(QScri
|
||||||
psuedoPropertyFlags.set(EntityPsuedoPropertyFlag::FlagsActive);
|
psuedoPropertyFlags.set(EntityPsuedoPropertyFlag::FlagsActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityPropertyFlags desiredProperties = qScriptValueToValue<EntityPropertyFlags>(extendedDesiredProperties);
|
EntityPropertyFlags desiredProperties = qscriptvalue_cast<EntityPropertyFlags>(extendedDesiredProperties);
|
||||||
bool needsScriptSemantics = desiredProperties.getHasProperty(PROP_POSITION) ||
|
bool needsScriptSemantics = desiredProperties.getHasProperty(PROP_POSITION) ||
|
||||||
desiredProperties.getHasProperty(PROP_ROTATION) ||
|
desiredProperties.getHasProperty(PROP_ROTATION) ||
|
||||||
desiredProperties.getHasProperty(PROP_LOCAL_POSITION) ||
|
desiredProperties.getHasProperty(PROP_LOCAL_POSITION) ||
|
||||||
|
|
|
@ -1859,7 +1859,7 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning(modelformat) << "Unknown accessorType: " << accessorType;
|
qWarning(modelformat) << "Unknown accessorType: " << accessorType;
|
||||||
blobstream.unsetDevice();
|
blobstream.setDevice(nullptr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
|
@ -1869,13 +1869,13 @@ bool GLTFSerializer::readArray(const hifi::ByteArray& bin, int byteOffset, int c
|
||||||
blobstream >> value;
|
blobstream >> value;
|
||||||
outarray.push_back(value);
|
outarray.push_back(value);
|
||||||
} else {
|
} else {
|
||||||
blobstream.unsetDevice();
|
blobstream.setDevice(nullptr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blobstream.unsetDevice();
|
blobstream.setDevice(nullptr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -20,7 +20,7 @@ size_t Image::getByteCount() const {
|
||||||
if (_format == Format_RGBAF) {
|
if (_format == Format_RGBAF) {
|
||||||
return sizeof(FloatPixels::value_type) * _floatData.size();
|
return sizeof(FloatPixels::value_type) * _floatData.size();
|
||||||
} else {
|
} else {
|
||||||
return _packedData.byteCount();
|
return _packedData.sizeInBytes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
|
|
||||||
#include "NetworkLogging.h"
|
#include "NetworkLogging.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <WS2tcpip.h>
|
||||||
|
#else
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int hifiSockAddrMetaTypeId = qRegisterMetaType<HifiSockAddr>();
|
int hifiSockAddrMetaTypeId = qRegisterMetaType<HifiSockAddr>();
|
||||||
|
|
||||||
HifiSockAddr::HifiSockAddr() :
|
HifiSockAddr::HifiSockAddr() :
|
||||||
|
|
|
@ -15,12 +15,7 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef WIN32
|
struct sockaddr;
|
||||||
#include <winsock2.h>
|
|
||||||
#include <WS2tcpip.h>
|
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QtNetwork/QHostInfo>
|
#include <QtNetwork/QHostInfo>
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,12 @@
|
||||||
#include "udt/Packet.h"
|
#include "udt/Packet.h"
|
||||||
#include "HMACAuth.h"
|
#include "HMACAuth.h"
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#include <winsock.h>
|
||||||
|
#else
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static Setting::Handle<quint16> LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.LocalPort", 0);
|
static Setting::Handle<quint16> LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.LocalPort", 0);
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
|
@ -31,6 +31,14 @@
|
||||||
|
|
||||||
using namespace udt;
|
using namespace udt;
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <WS2tcpip.h>
|
||||||
|
#else
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Socket::Socket(QObject* parent, bool shouldChangeSocketOptions) :
|
Socket::Socket(QObject* parent, bool shouldChangeSocketOptions) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
_udpSocket(parent),
|
_udpSocket(parent),
|
||||||
|
|
|
@ -258,7 +258,7 @@ void Font::read(QIODevice& in) {
|
||||||
_texture = gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Texture::SINGLE_MIP,
|
_texture = gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Texture::SINGLE_MIP,
|
||||||
gpu::Sampler(gpu::Sampler::FILTER_MIN_POINT_MAG_LINEAR));
|
gpu::Sampler(gpu::Sampler::FILTER_MIN_POINT_MAG_LINEAR));
|
||||||
_texture->setStoredMipFormat(formatMip);
|
_texture->setStoredMipFormat(formatMip);
|
||||||
_texture->assignStoredMip(0, image.byteCount(), image.constBits());
|
_texture->assignStoredMip(0, image.sizeInBytes(), image.constBits());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Font::setupGPU() {
|
void Font::setupGPU() {
|
||||||
|
|
|
@ -46,13 +46,13 @@ void MovingPercentile::updatePercentile(qint64 sample) {
|
||||||
// swap new sample with neighbors in _samplesSorted until it's in sorted order
|
// swap new sample with neighbors in _samplesSorted until it's in sorted order
|
||||||
// try swapping up first, then down. element will only be swapped one direction.
|
// try swapping up first, then down. element will only be swapped one direction.
|
||||||
while (newSampleIndex < _samplesSorted.size() - 1 && sample > _samplesSorted[newSampleIndex + 1]) {
|
while (newSampleIndex < _samplesSorted.size() - 1 && sample > _samplesSorted[newSampleIndex + 1]) {
|
||||||
_samplesSorted.swap(newSampleIndex, newSampleIndex + 1);
|
std::swap(_samplesSorted[newSampleIndex], _samplesSorted[newSampleIndex + 1]);
|
||||||
_sampleIds.swap(newSampleIndex, newSampleIndex + 1);
|
std::swap(_sampleIds[newSampleIndex], _sampleIds[newSampleIndex + 1]);
|
||||||
newSampleIndex++;
|
newSampleIndex++;
|
||||||
}
|
}
|
||||||
while (newSampleIndex > 0 && sample < _samplesSorted[newSampleIndex - 1]) {
|
while (newSampleIndex > 0 && sample < _samplesSorted[newSampleIndex - 1]) {
|
||||||
_samplesSorted.swap(newSampleIndex, newSampleIndex - 1);
|
std::swap(_samplesSorted[newSampleIndex], _samplesSorted[newSampleIndex - 1]);
|
||||||
_sampleIds.swap(newSampleIndex, newSampleIndex - 1);
|
std::swap(_sampleIds[newSampleIndex], _sampleIds[newSampleIndex - 1]);
|
||||||
newSampleIndex--;
|
newSampleIndex--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
|
#include <QtCore/QOperatingSystemVersion>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -793,15 +794,7 @@ void printSystemInformation() {
|
||||||
qCDebug(shared).noquote() << "\tKernel Type: " << QSysInfo::kernelType();
|
qCDebug(shared).noquote() << "\tKernel Type: " << QSysInfo::kernelType();
|
||||||
qCDebug(shared).noquote() << "\tKernel Version: " << QSysInfo::kernelVersion();
|
qCDebug(shared).noquote() << "\tKernel Version: " << QSysInfo::kernelVersion();
|
||||||
|
|
||||||
auto macVersion = QSysInfo::macVersion();
|
qCDebug(shared) << "\tOS Version: " << QOperatingSystemVersion::current();
|
||||||
if (macVersion != QSysInfo::MV_None) {
|
|
||||||
qCDebug(shared) << "\tMac Version: " << macVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto windowsVersion = QSysInfo::windowsVersion();
|
|
||||||
if (windowsVersion != QSysInfo::WV_None) {
|
|
||||||
qCDebug(shared) << "\tWindows Version: " << windowsVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <QtCore/qjsondocument.h>
|
#include <QtCore/qjsondocument.h>
|
||||||
#include <QtCore/qjsonobject.h>
|
#include <QtCore/qjsonobject.h>
|
||||||
#include <QtCore/qjsonvalue.h>
|
#include <QtCore/qjsonvalue.h>
|
||||||
|
#include <QtCore/QRegularExpression>
|
||||||
#include <shared/JSONHelpers.h>
|
#include <shared/JSONHelpers.h>
|
||||||
|
|
||||||
#include "SettingHandle.h"
|
#include "SettingHandle.h"
|
||||||
|
@ -189,7 +190,7 @@ public:
|
||||||
* @returns {object[]}
|
* @returns {object[]}
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QObjectList getSubConfigs() const {
|
Q_INVOKABLE QObjectList getSubConfigs() const {
|
||||||
auto list = findChildren<JobConfig*>(QRegExp(".*"), Qt::FindDirectChildrenOnly);
|
auto list = findChildren<JobConfig*>(QRegularExpression(".*"), Qt::FindDirectChildrenOnly);
|
||||||
QObjectList returned;
|
QObjectList returned;
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
returned.push_back(list[i]);
|
returned.push_back(list[i]);
|
||||||
|
|
|
@ -56,10 +56,10 @@ void InfoView::show(const QString& path, bool firstOrChangedOnly, QString urlQue
|
||||||
const QString lastVersion = infoVersion.get();
|
const QString lastVersion = infoVersion.get();
|
||||||
const QString version = fetchVersion(url);
|
const QString version = fetchVersion(url);
|
||||||
// If we have version information stored
|
// If we have version information stored
|
||||||
if (lastVersion != QString::null) {
|
if (!lastVersion.isNull()) {
|
||||||
// Check to see the document version. If it's valid and matches
|
// Check to see the document version. If it's valid and matches
|
||||||
// the stored version, we're done, so exit
|
// the stored version, we're done, so exit
|
||||||
if (version == QString::null || version == lastVersion) {
|
if (version.isNull() || version == lastVersion) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QDesktopWidget>
|
#include <QtGui/QScreen>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QMoveEvent>
|
#include <QMoveEvent>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
#include <QDragEnterEvent>
|
#include <QDragEnterEvent>
|
||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
#include "ui/Logging.h"
|
#include "ui/Logging.h"
|
||||||
#include "DockWidget.h"
|
#include "DockWidget.h"
|
||||||
|
@ -60,7 +60,7 @@ QWindow* MainWindow::findMainWindow() {
|
||||||
void MainWindow::restoreGeometry() {
|
void MainWindow::restoreGeometry() {
|
||||||
// Did not use setGeometry() on purpose,
|
// Did not use setGeometry() on purpose,
|
||||||
// see http://doc.qt.io/qt-5/qsettings.html#restoring-the-state-of-a-gui-application
|
// see http://doc.qt.io/qt-5/qsettings.html#restoring-the-state-of-a-gui-application
|
||||||
QRect windowGeometry = qApp->desktop()->availableGeometry();
|
QRect windowGeometry = QGuiApplication::primaryScreen()->availableGeometry();
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
windowGeometry.setSize((windowGeometry.size() * 0.5f));
|
windowGeometry.setSize((windowGeometry.size() * 0.5f));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -50,13 +50,13 @@ QString OculusControllerManager::configurationLayout() {
|
||||||
|
|
||||||
void OculusControllerManager::setConfigurationSettings(const QJsonObject configurationSettings) {
|
void OculusControllerManager::setConfigurationSettings(const QJsonObject configurationSettings) {
|
||||||
if (configurationSettings.contains("trackControllersInOculusHome")) {
|
if (configurationSettings.contains("trackControllersInOculusHome")) {
|
||||||
_touch->_trackControllersInOculusHome.set(configurationSettings["trackControllersInOculusHome"].toBool());
|
_trackControllersInOculusHome.set(configurationSettings["trackControllersInOculusHome"].toBool());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject OculusControllerManager::configurationSettings() {
|
QJsonObject OculusControllerManager::configurationSettings() {
|
||||||
QJsonObject configurationSettings;
|
QJsonObject configurationSettings;
|
||||||
configurationSettings["trackControllersInOculusHome"] = _touch->_trackControllersInOculusHome.get();
|
configurationSettings["trackControllersInOculusHome"] = _trackControllersInOculusHome.get();
|
||||||
return configurationSettings;
|
return configurationSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void OculusControllerManager::TouchDevice::update(float deltaTime,
|
||||||
quint64 currentTime = usecTimestampNow();
|
quint64 currentTime = usecTimestampNow();
|
||||||
static const auto REQUIRED_HAND_STATUS = ovrStatus_OrientationTracked | ovrStatus_PositionTracked;
|
static const auto REQUIRED_HAND_STATUS = ovrStatus_OrientationTracked | ovrStatus_PositionTracked;
|
||||||
bool hasInputFocus = ovr::hasInputFocus();
|
bool hasInputFocus = ovr::hasInputFocus();
|
||||||
bool trackControllersInOculusHome = _trackControllersInOculusHome.get();
|
bool trackControllersInOculusHome = _parent._trackControllersInOculusHome.get();
|
||||||
auto tracking = ovr::getTrackingState(); // ovr_GetTrackingState(_parent._session, 0, false);
|
auto tracking = ovr::getTrackingState(); // ovr_GetTrackingState(_parent._session, 0, false);
|
||||||
ovr::for_each_hand([&](ovrHandType hand) {
|
ovr::for_each_hand([&](ovrHandType hand) {
|
||||||
++numTrackedControllers;
|
++numTrackedControllers;
|
||||||
|
|
|
@ -98,7 +98,6 @@ private:
|
||||||
float _leftHapticStrength { 0.0f };
|
float _leftHapticStrength { 0.0f };
|
||||||
float _rightHapticDuration { 0.0f };
|
float _rightHapticDuration { 0.0f };
|
||||||
float _rightHapticStrength { 0.0f };
|
float _rightHapticStrength { 0.0f };
|
||||||
Setting::Handle<bool> _trackControllersInOculusHome { "trackControllersInOculusHome", false };
|
|
||||||
mutable std::recursive_mutex _lock;
|
mutable std::recursive_mutex _lock;
|
||||||
std::map<int, bool> _lostTracking;
|
std::map<int, bool> _lostTracking;
|
||||||
std::map<int, quint64> _regainTrackingDeadline;
|
std::map<int, quint64> _regainTrackingDeadline;
|
||||||
|
@ -109,6 +108,7 @@ private:
|
||||||
|
|
||||||
void checkForConnectedDevices();
|
void checkForConnectedDevices();
|
||||||
|
|
||||||
|
Setting::Handle<bool> _trackControllersInOculusHome { "trackControllersInOculusHome", false };
|
||||||
ovrInputState _remoteInputState {};
|
ovrInputState _remoteInputState {};
|
||||||
ovrInputState _touchInputState {};
|
ovrInputState _touchInputState {};
|
||||||
RemoteDevice::Pointer _remote;
|
RemoteDevice::Pointer _remote;
|
||||||
|
|
|
@ -127,3 +127,8 @@ Script.scriptEnding.connect(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.menuItemEvent.connect(menuItemEvent);
|
Menu.menuItemEvent.connect(menuItemEvent);
|
||||||
|
|
||||||
|
var ANDROID_UI_AUTO_LOD_ADJUST = false;
|
||||||
|
var ANDROID_UI_LOD_ANGLE_DEG = 0.248;
|
||||||
|
LODManager.automaticLODAdjust = ANDROID_UI_AUTO_LOD_ADJUST;
|
||||||
|
LODManager.lodAngleDeg = ANDROID_UI_LOD_ANGLE_DEG;
|
||||||
|
|
|
@ -22,6 +22,31 @@ var SECONDS_IN_MINUTE = 60;
|
||||||
// Delete after 5 minutes in case a nametag is hanging around in on mode
|
// Delete after 5 minutes in case a nametag is hanging around in on mode
|
||||||
var ALWAYS_ON_MAX_LIFETIME_IN_SECONDS = 5 * SECONDS_IN_MINUTE;
|
var ALWAYS_ON_MAX_LIFETIME_IN_SECONDS = 5 * SECONDS_IN_MINUTE;
|
||||||
|
|
||||||
|
// *************************************
|
||||||
|
// START STARTUP/SHUTDOWN
|
||||||
|
// *************************************
|
||||||
|
// #region STARTUP/SHUTDOWN
|
||||||
|
|
||||||
|
|
||||||
|
// Connect the camera mode updated signal on startup
|
||||||
|
function startup() {
|
||||||
|
Camera.modeUpdated.connect(handleCameraModeChanged);
|
||||||
|
cameraModeUpdatedSignalConnected = true;
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(shutdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
startup();
|
||||||
|
|
||||||
|
function shutdown() {
|
||||||
|
maybeDisconnectCameraModeUpdatedSignal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// *************************************
|
||||||
|
// END STARTUP/SHUTDOWN
|
||||||
|
// *************************************
|
||||||
|
|
||||||
// *************************************
|
// *************************************
|
||||||
// START UTILTY
|
// START UTILTY
|
||||||
// *************************************
|
// *************************************
|
||||||
|
@ -197,6 +222,27 @@ function toggleInterval() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Disconnect the camera mode updated signal if we have one connected for the selfie mode
|
||||||
|
var cameraModeUpdatedSignalConnected = false;
|
||||||
|
function maybeDisconnectCameraModeUpdatedSignal() {
|
||||||
|
if (cameraModeUpdatedSignalConnected) {
|
||||||
|
Camera.modeUpdated.disconnect(handleCameraModeChanged);
|
||||||
|
cameraModeUpdatedSignalConnected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Turn on the nametag for yourself if you are in selfie mode, other wise delete it
|
||||||
|
function handleCameraModeChanged(mode) {
|
||||||
|
if (mode === "selfie") {
|
||||||
|
if (avatarNametagMode === "alwaysOn") {
|
||||||
|
add(MyAvatar.sessionUUID);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
maybeRemove(MyAvatar.sessionUUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle checking to see if we should add or delete nametags in persistent mode
|
// Handle checking to see if we should add or delete nametags in persistent mode
|
||||||
var alwaysOnAvatarDistanceCheck = false;
|
var alwaysOnAvatarDistanceCheck = false;
|
||||||
var DISTANCE_CHECK_INTERVAL_MS = 1000;
|
var DISTANCE_CHECK_INTERVAL_MS = 1000;
|
||||||
|
@ -215,6 +261,10 @@ function handleAlwaysOnMode(shouldTurnOnAlwaysOnMode) {
|
||||||
});
|
});
|
||||||
maybeClearAlwaysOnAvatarDistanceCheck();
|
maybeClearAlwaysOnAvatarDistanceCheck();
|
||||||
alwaysOnAvatarDistanceCheck = Script.setInterval(maybeAddOrRemoveIntervalCheck, DISTANCE_CHECK_INTERVAL_MS);
|
alwaysOnAvatarDistanceCheck = Script.setInterval(maybeAddOrRemoveIntervalCheck, DISTANCE_CHECK_INTERVAL_MS);
|
||||||
|
|
||||||
|
if (Camera.mode === "selfie") {
|
||||||
|
add(MyAvatar.sessionUUID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,12 @@ WIPE_PATHS = []
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
WIPE_PATHS = [
|
WIPE_PATHS = [
|
||||||
'jsdoc',
|
'jsdoc'
|
||||||
'resources/serverless'
|
|
||||||
]
|
]
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
INTERFACE_BUILD_PATH = os.path.join(INTERFACE_BUILD_PATH, "Interface.app", "Contents", "Resources")
|
INTERFACE_BUILD_PATH = os.path.join(INTERFACE_BUILD_PATH, "Interface.app", "Contents", "Resources")
|
||||||
WIPE_PATHS = [
|
WIPE_PATHS = [
|
||||||
'jsdoc',
|
'jsdoc'
|
||||||
'serverless'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,9 +79,6 @@ def fixupMacZip(filename):
|
||||||
# ignore the nitpick app
|
# ignore the nitpick app
|
||||||
if newFilename.startswith('nitpick.app'):
|
if newFilename.startswith('nitpick.app'):
|
||||||
continue
|
continue
|
||||||
# ignore the serverless content
|
|
||||||
if newFilename.startswith('interface.app/Contents/Resources/serverless'):
|
|
||||||
continue
|
|
||||||
# if we made it here, include the file in the output
|
# if we made it here, include the file in the output
|
||||||
buffer = inzip.read(entry.filename)
|
buffer = inzip.read(entry.filename)
|
||||||
entry.filename = newFilename
|
entry.filename = newFilename
|
||||||
|
|
Loading…
Reference in a new issue