mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into polyvox
This commit is contained in:
commit
752c787f0b
21 changed files with 114 additions and 103 deletions
|
@ -83,5 +83,11 @@ EntityListTool = function(opts) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
webView.visibilityChanged.connect(function (visible) {
|
||||||
|
if (visible) {
|
||||||
|
that.sendUpdate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,46 +55,50 @@ void IceServer::processDatagrams() {
|
||||||
_serverSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
_serverSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
||||||
sendingSockAddr.getAddressPointer(), sendingSockAddr.getPortPointer());
|
sendingSockAddr.getAddressPointer(), sendingSockAddr.getPortPointer());
|
||||||
|
|
||||||
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, sendingSockAddr);
|
// make sure that this packet at least looks like something we can read
|
||||||
|
if (packetSizeWithHeader >= Packet::localHeaderSize(PacketType::ICEServerHeartbeat)) {
|
||||||
PacketType::Value packetType = packet->getType();
|
|
||||||
|
|
||||||
if (packetType == PacketType::ICEServerHeartbeat) {
|
|
||||||
SharedNetworkPeer peer = addOrUpdateHeartbeatingPeer(*packet);
|
|
||||||
|
|
||||||
// so that we can send packets to the heartbeating peer when we need, we need to activate a socket now
|
|
||||||
peer->activateMatchingOrNewSymmetricSocket(sendingSockAddr);
|
|
||||||
} else if (packetType == PacketType::ICEServerQuery) {
|
|
||||||
QDataStream heartbeatStream(packet.get());
|
|
||||||
|
|
||||||
// this is a node hoping to connect to a heartbeating peer - do we have the heartbeating peer?
|
|
||||||
QUuid senderUUID;
|
|
||||||
heartbeatStream >> senderUUID;
|
|
||||||
|
|
||||||
// pull the public and private sock addrs for this peer
|
|
||||||
HifiSockAddr publicSocket, localSocket;
|
|
||||||
heartbeatStream >> publicSocket >> localSocket;
|
|
||||||
|
|
||||||
// check if this node also included a UUID that they would like to connect to
|
|
||||||
QUuid connectRequestID;
|
|
||||||
heartbeatStream >> connectRequestID;
|
|
||||||
|
|
||||||
SharedNetworkPeer matchingPeer = _activePeers.value(connectRequestID);
|
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, sendingSockAddr);
|
||||||
|
|
||||||
if (matchingPeer) {
|
PacketType::Value packetType = packet->getType();
|
||||||
|
|
||||||
|
if (packetType == PacketType::ICEServerHeartbeat) {
|
||||||
|
SharedNetworkPeer peer = addOrUpdateHeartbeatingPeer(*packet);
|
||||||
|
|
||||||
qDebug() << "Sending information for peer" << connectRequestID << "to peer" << senderUUID;
|
// so that we can send packets to the heartbeating peer when we need, we need to activate a socket now
|
||||||
|
peer->activateMatchingOrNewSymmetricSocket(sendingSockAddr);
|
||||||
|
} else if (packetType == PacketType::ICEServerQuery) {
|
||||||
|
QDataStream heartbeatStream(packet.get());
|
||||||
|
|
||||||
// we have the peer they want to connect to - send them pack the information for that peer
|
// this is a node hoping to connect to a heartbeating peer - do we have the heartbeating peer?
|
||||||
sendPeerInformationPacket(*(matchingPeer.data()), &sendingSockAddr);
|
QUuid senderUUID;
|
||||||
|
heartbeatStream >> senderUUID;
|
||||||
// we also need to send them to the active peer they are hoping to connect to
|
|
||||||
// create a dummy peer object we can pass to sendPeerInformationPacket
|
// pull the public and private sock addrs for this peer
|
||||||
|
HifiSockAddr publicSocket, localSocket;
|
||||||
NetworkPeer dummyPeer(senderUUID, publicSocket, localSocket);
|
heartbeatStream >> publicSocket >> localSocket;
|
||||||
sendPeerInformationPacket(dummyPeer, matchingPeer->getActiveSocket());
|
|
||||||
} else {
|
// check if this node also included a UUID that they would like to connect to
|
||||||
qDebug() << "Peer" << senderUUID << "asked for" << connectRequestID << "but no matching peer found";
|
QUuid connectRequestID;
|
||||||
|
heartbeatStream >> connectRequestID;
|
||||||
|
|
||||||
|
SharedNetworkPeer matchingPeer = _activePeers.value(connectRequestID);
|
||||||
|
|
||||||
|
if (matchingPeer) {
|
||||||
|
|
||||||
|
qDebug() << "Sending information for peer" << connectRequestID << "to peer" << senderUUID;
|
||||||
|
|
||||||
|
// we have the peer they want to connect to - send them pack the information for that peer
|
||||||
|
sendPeerInformationPacket(*(matchingPeer.data()), &sendingSockAddr);
|
||||||
|
|
||||||
|
// we also need to send them to the active peer they are hoping to connect to
|
||||||
|
// create a dummy peer object we can pass to sendPeerInformationPacket
|
||||||
|
|
||||||
|
NetworkPeer dummyPeer(senderUUID, publicSocket, localSocket);
|
||||||
|
sendPeerInformationPacket(dummyPeer, matchingPeer->getActiveSocket());
|
||||||
|
} else {
|
||||||
|
qDebug() << "Peer" << senderUUID << "asked for" << connectRequestID << "but no matching peer found";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5048,5 +5048,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index)
|
||||||
void Application::crashApplication() {
|
void Application::crashApplication() {
|
||||||
QObject* object = nullptr;
|
QObject* object = nullptr;
|
||||||
bool value = object->isWindowType();
|
bool value = object->isWindowType();
|
||||||
|
Q_UNUSED(value);
|
||||||
|
|
||||||
qCDebug(interfaceapp) << "Intentionally crashed Interface";
|
qCDebug(interfaceapp) << "Intentionally crashed Interface";
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ Menu::Menu() {
|
||||||
addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,
|
addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,
|
||||||
qApp, SLOT(packageModel()));
|
qApp, SLOT(packageModel()));
|
||||||
|
|
||||||
MenuWrapper* displayMenu = addMenu(DisplayPlugin::MENU_PATH());
|
addMenu(DisplayPlugin::MENU_PATH());
|
||||||
{
|
{
|
||||||
MenuWrapper* displayModeMenu = addMenu(MenuOption::OutputMenu);
|
MenuWrapper* displayModeMenu = addMenu(MenuOption::OutputMenu);
|
||||||
QActionGroup* displayModeGroup = new QActionGroup(displayModeMenu);
|
QActionGroup* displayModeGroup = new QActionGroup(displayModeMenu);
|
||||||
|
@ -431,6 +431,8 @@ Menu::Menu() {
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowWhosLookingAtMe, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowWhosLookingAtMe, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::FixGaze, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::FixGaze, 0, false);
|
||||||
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::EnableRigAnimations, 0, false,
|
||||||
|
avatar, SLOT(setEnableRigAnimations(bool)));
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::DisableEyelidAdjustment, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::DisableEyelidAdjustment, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu,
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu,
|
||||||
MenuOption::Connexion,
|
MenuOption::Connexion,
|
||||||
|
|
|
@ -188,6 +188,7 @@ namespace MenuOption {
|
||||||
const QString EditEntitiesHelp = "Edit Entities Help...";
|
const QString EditEntitiesHelp = "Edit Entities Help...";
|
||||||
const QString Enable3DTVMode = "Enable 3DTV Mode";
|
const QString Enable3DTVMode = "Enable 3DTV Mode";
|
||||||
const QString EnableCharacterController = "Enable avatar collisions";
|
const QString EnableCharacterController = "Enable avatar collisions";
|
||||||
|
const QString EnableRigAnimations = "Enable Rig Animations";
|
||||||
const QString ExpandMyAvatarSimulateTiming = "Expand /myAvatar/simulation";
|
const QString ExpandMyAvatarSimulateTiming = "Expand /myAvatar/simulation";
|
||||||
const QString ExpandMyAvatarTiming = "Expand /myAvatar";
|
const QString ExpandMyAvatarTiming = "Expand /myAvatar";
|
||||||
const QString ExpandOtherAvatarTiming = "Expand /otherAvatar";
|
const QString ExpandOtherAvatarTiming = "Expand /otherAvatar";
|
||||||
|
|
|
@ -705,9 +705,10 @@ float loadSetting(QSettings& settings, const char* name, float defaultValue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setEnableRigAnimations(bool isEnabled) {
|
void MyAvatar::setEnableRigAnimations(bool isEnabled) {
|
||||||
Settings settings;
|
|
||||||
settings.setValue("enableRig", isEnabled);
|
|
||||||
_rig->setEnableRig(isEnabled);
|
_rig->setEnableRig(isEnabled);
|
||||||
|
if (!isEnabled) {
|
||||||
|
_rig->deleteAnimations();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::loadData() {
|
void MyAvatar::loadData() {
|
||||||
|
@ -769,7 +770,7 @@ void MyAvatar::loadData() {
|
||||||
setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString());
|
setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString());
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
_rig->setEnableRig(settings.value("enableRig").toBool());
|
_rig->setEnableRig(Menu::getInstance()->isOptionChecked(MenuOption::EnableRigAnimations));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::saveAttachmentData(const AttachmentData& attachment) const {
|
void MyAvatar::saveAttachmentData(const AttachmentData& attachment) const {
|
||||||
|
@ -843,7 +844,6 @@ void MyAvatar::sendKillAvatar() {
|
||||||
DependencyManager::get<NodeList>()->broadcastToNodes(std::move(killPacket), NodeSet() << NodeType::AvatarMixer);
|
DependencyManager::get<NodeList>()->broadcastToNodes(std::move(killPacket), NodeSet() << NodeType::AvatarMixer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int counter = 0;
|
|
||||||
void MyAvatar::updateLookAtTargetAvatar() {
|
void MyAvatar::updateLookAtTargetAvatar() {
|
||||||
//
|
//
|
||||||
// Look at the avatar whose eyes are closest to the ray in direction of my avatar's head
|
// Look at the avatar whose eyes are closest to the ray in direction of my avatar's head
|
||||||
|
|
|
@ -87,7 +87,6 @@ public:
|
||||||
Q_INVOKABLE AnimationDetails getAnimationDetailsByRole(const QString& role);
|
Q_INVOKABLE AnimationDetails getAnimationDetailsByRole(const QString& role);
|
||||||
Q_INVOKABLE AnimationDetails getAnimationDetails(const QString& url);
|
Q_INVOKABLE AnimationDetails getAnimationDetails(const QString& url);
|
||||||
void clearJointAnimationPriorities();
|
void clearJointAnimationPriorities();
|
||||||
Q_INVOKABLE void setEnableRigAnimations(bool isEnabled);
|
|
||||||
|
|
||||||
// get/set avatar data
|
// get/set avatar data
|
||||||
void saveData();
|
void saveData();
|
||||||
|
@ -190,6 +189,7 @@ public slots:
|
||||||
void loadLastRecording();
|
void loadLastRecording();
|
||||||
|
|
||||||
virtual void rebuildSkeletonBody();
|
virtual void rebuildSkeletonBody();
|
||||||
|
void setEnableRigAnimations(bool isEnabled);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void transformChanged();
|
void transformChanged();
|
||||||
|
|
|
@ -45,6 +45,7 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid
|
||||||
|
|
||||||
auto dockWidget = new QDockWidget(title, toolWindow);
|
auto dockWidget = new QDockWidget(title, toolWindow);
|
||||||
dockWidget->setFeatures(QDockWidget::DockWidgetMovable);
|
dockWidget->setFeatures(QDockWidget::DockWidgetMovable);
|
||||||
|
connect(dockWidget, &QDockWidget::visibilityChanged, this, &WebWindowClass::visibilityChanged);
|
||||||
|
|
||||||
_webView = new QWebView(dockWidget);
|
_webView = new QWebView(dockWidget);
|
||||||
addEventBridgeToWindowObject();
|
addEventBridgeToWindowObject();
|
||||||
|
|
|
@ -60,6 +60,7 @@ public slots:
|
||||||
void setTitle(const QString& title);
|
void setTitle(const QString& title);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void visibilityChanged(bool visible); // Tool window
|
||||||
void moved(glm::vec2 position);
|
void moved(glm::vec2 position);
|
||||||
void resized(QSizeF size);
|
void resized(QSizeF size);
|
||||||
void closed();
|
void closed();
|
||||||
|
|
|
@ -206,8 +206,6 @@ void ApplicationCompositor::displayOverlayTexture(RenderArgs* renderArgs) {
|
||||||
|
|
||||||
updateTooltips();
|
updateTooltips();
|
||||||
|
|
||||||
auto deviceSize = qApp->getDeviceSize();
|
|
||||||
|
|
||||||
//Handle fading and deactivation/activation of UI
|
//Handle fading and deactivation/activation of UI
|
||||||
gpu::Batch batch;
|
gpu::Batch batch;
|
||||||
|
|
||||||
|
|
|
@ -100,24 +100,21 @@ AnimationHandlePointer Rig::addAnimationByRole(const QString& role, const QStrin
|
||||||
AnimationHandlePointer handle = createAnimationHandle();
|
AnimationHandlePointer handle = createAnimationHandle();
|
||||||
QString standard = "";
|
QString standard = "";
|
||||||
if (url.isEmpty()) { // Default animations for fight club
|
if (url.isEmpty()) { // Default animations for fight club
|
||||||
const QString& base = "https://hifi-public.s3.amazonaws.com/ozan/";
|
const QString& base = "https://hifi-public.s3.amazonaws.com/ozan/anim/standard_anims/";
|
||||||
if (role == "walk") {
|
if (role == "walk") {
|
||||||
standard = base + "support/FightClubBotTest1/Animations/standard_walk.fbx";
|
standard = base + "walk_fwd.fbx";
|
||||||
lastFrame = 60;
|
} else if (role == "backup") {
|
||||||
|
standard = base + "walk_bwd.fbx";
|
||||||
} else if (role == "leftTurn") {
|
} else if (role == "leftTurn") {
|
||||||
standard = base + "support/FightClubBotTest1/Animations/left_turn_noHipRotation.fbx";
|
standard = base + "turn_left.fbx";
|
||||||
lastFrame = 29;
|
|
||||||
} else if (role == "rightTurn") {
|
} else if (role == "rightTurn") {
|
||||||
standard = base + "support/FightClubBotTest1/Animations/right_turn_noHipRotation.fbx";
|
standard = base + "turn_right.fbx";
|
||||||
lastFrame = 31;
|
|
||||||
} else if (role == "leftStrafe") {
|
} else if (role == "leftStrafe") {
|
||||||
standard = base + "animations/fightclub_bot_anims/side_step_left_inPlace.fbx";
|
standard = base + "strafe_left.fbx";
|
||||||
lastFrame = 31;
|
|
||||||
} else if (role == "rightStrafe") {
|
} else if (role == "rightStrafe") {
|
||||||
standard = base + "animations/fightclub_bot_anims/side_step_right_inPlace.fbx";
|
standard = base + "strafe_right.fbx";
|
||||||
lastFrame = 31;
|
|
||||||
} else if (role == "idle") {
|
} else if (role == "idle") {
|
||||||
standard = base + "support/FightClubBotTest1/Animations/standard_idle.fbx";
|
standard = base + "idle.fbx";
|
||||||
fps = 25.0f;
|
fps = 25.0f;
|
||||||
}
|
}
|
||||||
if (!standard.isEmpty()) {
|
if (!standard.isEmpty()) {
|
||||||
|
@ -438,11 +435,12 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
updateRole("walk", std::abs(forwardSpeed) > 0.01f);
|
updateRole("walk", forwardSpeed > 0.01f);
|
||||||
|
updateRole("backup", forwardSpeed < -0.01f);
|
||||||
bool isTurning = std::abs(rightTurningSpeed) > 0.5f;
|
bool isTurning = std::abs(rightTurningSpeed) > 0.5f;
|
||||||
updateRole("rightTurn", isTurning && (rightTurningSpeed > 0));
|
updateRole("rightTurn", isTurning && (rightTurningSpeed > 0));
|
||||||
updateRole("leftTurn", isTurning && (rightTurningSpeed < 0));
|
updateRole("leftTurn", isTurning && (rightTurningSpeed < 0));
|
||||||
bool isStrafing = std::abs(rightLateralSpeed) > 0.01f;
|
bool isStrafing = !isTurning && (std::abs(rightLateralSpeed) > 0.01f);
|
||||||
updateRole("rightStrafe", isStrafing && (rightLateralSpeed > 0.0f));
|
updateRole("rightStrafe", isStrafing && (rightLateralSpeed > 0.0f));
|
||||||
updateRole("leftStrafe", isStrafing && (rightLateralSpeed < 0.0f));
|
updateRole("leftStrafe", isStrafing && (rightLateralSpeed < 0.0f));
|
||||||
updateRole("idle", !isMoving); // Must be last, as it makes isMoving bogus.
|
updateRole("idle", !isMoving); // Must be last, as it makes isMoving bogus.
|
||||||
|
|
|
@ -80,32 +80,34 @@ void OpenGLDisplayPlugin::deactivate() {
|
||||||
// Pass input events on to the application
|
// Pass input events on to the application
|
||||||
bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseButtonPress:
|
case QEvent::MouseButtonPress:
|
||||||
case QEvent::MouseButtonRelease:
|
case QEvent::MouseButtonRelease:
|
||||||
case QEvent::MouseButtonDblClick:
|
case QEvent::MouseButtonDblClick:
|
||||||
case QEvent::MouseMove:
|
case QEvent::MouseMove:
|
||||||
case QEvent::Wheel:
|
case QEvent::Wheel:
|
||||||
|
|
||||||
case QEvent::TouchBegin:
|
case QEvent::TouchBegin:
|
||||||
case QEvent::TouchEnd:
|
case QEvent::TouchEnd:
|
||||||
case QEvent::TouchUpdate:
|
case QEvent::TouchUpdate:
|
||||||
|
|
||||||
case QEvent::FocusIn:
|
case QEvent::FocusIn:
|
||||||
case QEvent::FocusOut:
|
case QEvent::FocusOut:
|
||||||
|
|
||||||
case QEvent::KeyPress:
|
case QEvent::KeyPress:
|
||||||
case QEvent::KeyRelease:
|
case QEvent::KeyRelease:
|
||||||
case QEvent::ShortcutOverride:
|
case QEvent::ShortcutOverride:
|
||||||
|
|
||||||
case QEvent::DragEnter:
|
case QEvent::DragEnter:
|
||||||
case QEvent::Drop:
|
case QEvent::Drop:
|
||||||
|
|
||||||
case QEvent::Resize:
|
case QEvent::Resize:
|
||||||
if (QCoreApplication::sendEvent(QCoreApplication::instance(), event)) {
|
if (QCoreApplication::sendEvent(QCoreApplication::instance(), event)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,4 +143,4 @@ bool OpenGLDisplayPlugin::isVsyncEnabled() {
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,20 +51,22 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const QString NAME;
|
||||||
|
|
||||||
ovrHmd _hmd;
|
|
||||||
float _ipd{ OVR_DEFAULT_IPD };
|
|
||||||
unsigned int _frameIndex;
|
|
||||||
ovrEyeRenderDesc _eyeRenderDescs[2];
|
|
||||||
ovrPosef _eyePoses[2];
|
ovrPosef _eyePoses[2];
|
||||||
ovrVector3f _eyeOffsets[2];
|
|
||||||
ovrFovPort _eyeFovs[2];
|
|
||||||
mat4 _eyeProjections[3];
|
mat4 _eyeProjections[3];
|
||||||
mat4 _compositeEyeProjections[2];
|
mat4 _compositeEyeProjections[2];
|
||||||
uvec2 _desiredFramebufferSize;
|
uvec2 _desiredFramebufferSize;
|
||||||
ovrTrackingState _trackingState;
|
ovrTrackingState _trackingState;
|
||||||
|
|
||||||
#if (OVR_MAJOR_VERSION >= 6)
|
#if (OVR_MAJOR_VERSION >= 6)
|
||||||
|
ovrHmd _hmd;
|
||||||
|
float _ipd{ OVR_DEFAULT_IPD };
|
||||||
|
unsigned int _frameIndex;
|
||||||
|
ovrEyeRenderDesc _eyeRenderDescs[2];
|
||||||
|
ovrVector3f _eyeOffsets[2];
|
||||||
|
ovrFovPort _eyeFovs[2];
|
||||||
|
|
||||||
ovrLayerEyeFov& getSceneLayer();
|
ovrLayerEyeFov& getSceneLayer();
|
||||||
ovrHmdDesc _hmdDesc;
|
ovrHmdDesc _hmdDesc;
|
||||||
SwapFboPtr _sceneFbo;
|
SwapFboPtr _sceneFbo;
|
||||||
|
|
|
@ -34,7 +34,7 @@ const QString & OculusLegacyDisplayPlugin::getName() const {
|
||||||
return NAME;
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
OculusLegacyDisplayPlugin::OculusLegacyDisplayPlugin() : _ipd(OVR_DEFAULT_IPD) {
|
OculusLegacyDisplayPlugin::OculusLegacyDisplayPlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
uvec2 OculusLegacyDisplayPlugin::getRecommendedRenderSize() const {
|
uvec2 OculusLegacyDisplayPlugin::getRecommendedRenderSize() const {
|
||||||
|
|
|
@ -44,7 +44,6 @@ protected:
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const QString NAME;
|
||||||
|
|
||||||
float _ipd{ OVR_DEFAULT_IPD };
|
|
||||||
ovrHmd _hmd;
|
ovrHmd _hmd;
|
||||||
unsigned int _frameIndex;
|
unsigned int _frameIndex;
|
||||||
ovrTrackingState _trackingState;
|
ovrTrackingState _trackingState;
|
||||||
|
|
|
@ -78,7 +78,7 @@ void StereoDisplayPlugin::activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void StereoDisplayPlugin::updateScreen() {
|
void StereoDisplayPlugin::updateScreen() {
|
||||||
for (int i = 0; i < _screenActions.size(); ++i) {
|
for (int i = 0; i < (int) _screenActions.size(); ++i) {
|
||||||
if (_screenActions[i]->isChecked()) {
|
if (_screenActions[i]->isChecked()) {
|
||||||
CONTAINER->setFullscreen(qApp->screens().at(i));
|
CONTAINER->setFullscreen(qApp->screens().at(i));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -41,7 +41,6 @@ void GLBackend::do_setViewportTransform(Batch& batch, uint32 paramOffset) {
|
||||||
if (_stereo._pass) {
|
if (_stereo._pass) {
|
||||||
vp.x += vp.z;
|
vp.x += vp.z;
|
||||||
}
|
}
|
||||||
int i = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glViewport(vp.x, vp.y, vp.z, vp.w);
|
glViewport(vp.x, vp.y, vp.z, vp.w);
|
||||||
|
|
|
@ -65,11 +65,11 @@ void compileProgram(ProgramPtr & result, const std::string& vs, const std::strin
|
||||||
.Compile()
|
.Compile()
|
||||||
);
|
);
|
||||||
result->Link();
|
result->Link();
|
||||||
} catch (ProgramBuildError & err) {
|
} catch (ProgramBuildError& err) {
|
||||||
Q_UNUSED(err);
|
Q_UNUSED(err);
|
||||||
qWarning() << err.Log().c_str();
|
qWarning() << err.Log().c_str();
|
||||||
Q_ASSERT_X(false, "compileProgram", "Failed to build shader program");
|
Q_ASSERT_X(false, "compileProgram", "Failed to build shader program");
|
||||||
qFatal((const char*)err.Message);
|
qFatal("%s", (const char*) err.Message);
|
||||||
result.reset();
|
result.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,16 @@
|
||||||
#include "WebSocketClass.h"
|
#include "WebSocketClass.h"
|
||||||
|
|
||||||
WebSocketClass::WebSocketClass(QScriptEngine* engine, QString url) :
|
WebSocketClass::WebSocketClass(QScriptEngine* engine, QString url) :
|
||||||
_engine(engine),
|
_webSocket(new QWebSocket()),
|
||||||
_webSocket(new QWebSocket())
|
_engine(engine)
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
_webSocket->open(url);
|
_webSocket->open(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebSocketClass::WebSocketClass(QScriptEngine* engine, QWebSocket* qWebSocket) :
|
WebSocketClass::WebSocketClass(QScriptEngine* engine, QWebSocket* qWebSocket) :
|
||||||
_engine(engine),
|
_webSocket(qWebSocket),
|
||||||
_webSocket(qWebSocket)
|
_engine(engine)
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
#include "WebSocketServerClass.h"
|
#include "WebSocketServerClass.h"
|
||||||
|
|
||||||
WebSocketServerClass::WebSocketServerClass(QScriptEngine* engine, const QString& serverName, const quint16 port) :
|
WebSocketServerClass::WebSocketServerClass(QScriptEngine* engine, const QString& serverName, const quint16 port) :
|
||||||
_engine(engine),
|
_webSocketServer(serverName, QWebSocketServer::SslMode::NonSecureMode),
|
||||||
_webSocketServer(serverName, QWebSocketServer::SslMode::NonSecureMode)
|
_engine(engine)
|
||||||
{
|
{
|
||||||
if (_webSocketServer.listen(QHostAddress::Any, port)) {
|
if (_webSocketServer.listen(QHostAddress::Any, port)) {
|
||||||
connect(&_webSocketServer, &QWebSocketServer::newConnection, this, &WebSocketServerClass::onNewConnection);
|
connect(&_webSocketServer, &QWebSocketServer::newConnection, this, &WebSocketServerClass::onNewConnection);
|
||||||
|
|
|
@ -378,8 +378,6 @@ glm::mat4 createMatFromQuatAndPos(const glm::quat& q, const glm::vec3& p) {
|
||||||
|
|
||||||
// cancel out roll and pitch
|
// cancel out roll and pitch
|
||||||
glm::quat cancelOutRollAndPitch(const glm::quat& q) {
|
glm::quat cancelOutRollAndPitch(const glm::quat& q) {
|
||||||
glm::vec3 xAxis = q * glm::vec3(1, 0, 0);
|
|
||||||
glm::vec3 yAxis = q * glm::vec3(0, 1, 0);
|
|
||||||
glm::vec3 zAxis = q * glm::vec3(0, 0, 1);
|
glm::vec3 zAxis = q * glm::vec3(0, 0, 1);
|
||||||
|
|
||||||
// cancel out the roll and pitch
|
// cancel out the roll and pitch
|
||||||
|
@ -393,8 +391,6 @@ glm::quat cancelOutRollAndPitch(const glm::quat& q) {
|
||||||
|
|
||||||
// cancel out roll and pitch
|
// cancel out roll and pitch
|
||||||
glm::mat4 cancelOutRollAndPitch(const glm::mat4& m) {
|
glm::mat4 cancelOutRollAndPitch(const glm::mat4& m) {
|
||||||
glm::vec3 xAxis = glm::vec3(m[0]);
|
|
||||||
glm::vec3 yAxis = glm::vec3(m[1]);
|
|
||||||
glm::vec3 zAxis = glm::vec3(m[2]);
|
glm::vec3 zAxis = glm::vec3(m[2]);
|
||||||
|
|
||||||
// cancel out the roll and pitch
|
// cancel out the roll and pitch
|
||||||
|
|
Loading…
Reference in a new issue