mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:38:29 +02:00
hand the launchURL off to RenderingClient
This commit is contained in:
parent
2657af8d4b
commit
f37fc30e0c
3 changed files with 14 additions and 6 deletions
|
@ -36,10 +36,16 @@
|
||||||
|
|
||||||
#include "GVRInterface.h"
|
#include "GVRInterface.h"
|
||||||
|
|
||||||
|
static QString launchURLString = "";
|
||||||
|
|
||||||
GVRInterface::GVRInterface(int argc, char* argv[]) :
|
GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||||
QApplication(argc, argv),
|
QApplication(argc, argv),
|
||||||
_inVRMode(false)
|
_inVRMode(false)
|
||||||
{
|
{
|
||||||
|
// did we get launched with a lookup URL? If so it is time to give that to the AddressManager
|
||||||
|
qDebug() << "We were opened via a hifi URL -" << launchURLString;
|
||||||
|
launchURLString = "";
|
||||||
|
|
||||||
_client = new RenderingClient(this);
|
_client = new RenderingClient(this);
|
||||||
|
|
||||||
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
|
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
|
||||||
|
@ -65,7 +71,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
JNIEXPORT void Java_io_highfidelity_gvrinterface_InterfaceActivity_handleHifiURL(JNIEnv *jni, jclass clazz, jstring hifiURLString) {
|
JNIEXPORT void Java_io_highfidelity_gvrinterface_InterfaceActivity_handleHifiURL(JNIEnv *jni, jclass clazz, jstring hifiURLString) {
|
||||||
qDebug() << "The lookup string in c++ is" << QAndroidJniObject(hifiURLString).toString();
|
launchURLString = QAndroidJniObject(hifiURLString).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,16 @@
|
||||||
|
|
||||||
RenderingClient* RenderingClient::_instance = NULL;
|
RenderingClient* RenderingClient::_instance = NULL;
|
||||||
|
|
||||||
RenderingClient::RenderingClient(QObject *parent) :
|
RenderingClient::RenderingClient(QObject *parent, const QString& launchURLString) :
|
||||||
Client(parent)
|
Client(parent)
|
||||||
{
|
{
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
||||||
|
// connect to AddressManager and pass it the launch URL, if we have one
|
||||||
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
connect(addressManager.data(), &AddressManager::locationChangeRequired, this, &RenderingClient::goToLocation);
|
||||||
|
addressManager->loadSettings(launchURLString);
|
||||||
|
|
||||||
// tell the NodeList which node types all rendering clients will want to know about
|
// tell the NodeList which node types all rendering clients will want to know about
|
||||||
DependencyManager::get<NodeList>()->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer);
|
DependencyManager::get<NodeList>()->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer);
|
||||||
|
|
||||||
|
@ -42,9 +47,6 @@ RenderingClient::RenderingClient(QObject *parent) :
|
||||||
connect(audioThread, &QThread::started, audioClient.data(), &AudioClient::start);
|
connect(audioThread, &QThread::started, audioClient.data(), &AudioClient::start);
|
||||||
|
|
||||||
audioThread->start();
|
audioThread->start();
|
||||||
|
|
||||||
connect(DependencyManager::get<AddressManager>().data(), &AddressManager::locationChangeRequired,
|
|
||||||
this, &RenderingClient::goToLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderingClient::~RenderingClient() {
|
RenderingClient::~RenderingClient() {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
class RenderingClient : public Client {
|
class RenderingClient : public Client {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
RenderingClient(QObject* parent = 0);
|
RenderingClient(QObject* parent = 0, const QString& launchURLString = QString());
|
||||||
~RenderingClient();
|
~RenderingClient();
|
||||||
|
|
||||||
const glm::vec3& getPosition() const { return _position; }
|
const glm::vec3& getPosition() const { return _position; }
|
||||||
|
|
Loading…
Reference in a new issue