mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Merge branch 'android' of git://github.com/birarda/hifi into android
This commit is contained in:
commit
505f3f143b
10 changed files with 38 additions and 52 deletions
|
@ -7,6 +7,7 @@ You will need the following tools to build our Android targets.
|
|||
* [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
|
||||
* [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2
|
||||
* Be sure to install SDK Platform for API Level 19
|
||||
* [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) ~> 0.4.2
|
||||
|
||||
You will also need to cross-compile the dependencies required for all platforms for Android, and help CMake find these compiled libraries on your machine.
|
||||
|
||||
|
@ -94,6 +95,11 @@ make install
|
|||
|
||||
This will create the `lib` and `include` folders inside `ANDROID_LIB_DIR/soxr` that FindSoxr will look for.
|
||||
|
||||
####Oculus Mobile SDK
|
||||
|
||||
Download the [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) and extract the archive inside your `ANDROID_LIB_DIR` folder. Rename the extracted folder to `libovr`.
|
||||
|
||||
From the VrLib directory, use ndk-build to build VrLib. This will create the liboculus.a archive that our FindLibOVR module will look for when cmake is run.
|
||||
|
||||
####GLM
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
||||
|
||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||
android:name="org.qtproject.qt5.android.bindings.QtActivity"
|
||||
android:name="${ANDROID_ACTIVITY_NAME}"
|
||||
android:label="@string/AppDisplayName"
|
||||
android:screenOrientation="landscape"
|
||||
android:launchMode="singleTop"
|
||||
|
|
|
@ -19,6 +19,7 @@ set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME})
|
|||
set(ANDROID_APP_DISPLAY_NAME Interface)
|
||||
set(ANDROID_API_LEVEL 19)
|
||||
set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
|
||||
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
||||
|
||||
find_package(LibOVR REQUIRED)
|
||||
target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARIES} ${LIBOVR_ANDROID_LIBRARIES})
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <QtCore/QThread>
|
||||
|
||||
#include <AccountManager.h>
|
||||
#include <AddressManager.h>
|
||||
#include <HifiSockAddr.h>
|
||||
#include <NodeList.h>
|
||||
|
@ -28,6 +29,9 @@ Client::Client(QObject* parent) :
|
|||
}
|
||||
|
||||
void Client::setupNetworking() {
|
||||
// once Application order of instantiation is fixed this should be done from AccountManager
|
||||
AccountManager::getInstance().setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||
|
||||
// setup the NodeList for this client
|
||||
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
|
||||
auto nodeList = DependencyManager::set<NodeList>(NodeType::Agent, 0);
|
||||
|
|
|
@ -79,7 +79,7 @@ void GVRInterface::idle() {
|
|||
|
||||
auto ovrOrientation = sensor.Predicted.Pose.Orientation;
|
||||
glm::quat newOrientation(ovrOrientation.w, ovrOrientation.x, ovrOrientation.y, ovrOrientation.z);
|
||||
// _client->setOrientation(newOrientation);
|
||||
_client->setOrientation(newOrientation);
|
||||
|
||||
if (counter++ % 100000 == 0) {
|
||||
qDebug() << "GetSensorState in frame" << counter << "-"
|
||||
|
@ -104,46 +104,3 @@ void GVRInterface::handleApplicationStateChange(Qt::ApplicationState state) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GVRInterface::enterVRMode() {
|
||||
// // Reload local preferences, in case we are coming back from a
|
||||
// // switch to the dashboard that changed them.
|
||||
// ovr_UpdateLocalPreferences();
|
||||
//
|
||||
// // Default vrModeParms
|
||||
// ovrModeParms vrModeParms;
|
||||
// vrModeParms.AsynchronousTimeWarp = true;
|
||||
// vrModeParms.AllowPowerSave = true;
|
||||
// vrModeParms.DistortionFileName = NULL;
|
||||
// vrModeParms.EnableImageServer = false;
|
||||
// vrModeParms.CpuLevel = 2;
|
||||
// vrModeParms.GpuLevel = 2;
|
||||
// vrModeParms.GameThreadTid = 0;
|
||||
//
|
||||
// QPlatformNativeInterface* interface = QApplication::platformNativeInterface();
|
||||
//
|
||||
// vrModeParms.ActivityObject = (jobject) interface->nativeResourceForIntegration("QtActivity");
|
||||
//
|
||||
// _hmdInfo = new ovrHmdInfo;
|
||||
//
|
||||
// const char* cpuLevelStr = ovr_GetLocalPreferenceValueForKey( LOCAL_PREF_DEV_CPU_LEVEL, "-1" );
|
||||
// const int cpuLevel = atoi( cpuLevelStr );
|
||||
// if ( cpuLevel >= 0 ) {
|
||||
// vrModeParms.CpuLevel = cpuLevel;
|
||||
// qDebug() << "Local Preferences: Setting cpuLevel" << vrModeParms.CpuLevel;
|
||||
// }
|
||||
//
|
||||
// const char* gpuLevelStr = ovr_GetLocalPreferenceValueForKey( LOCAL_PREF_DEV_GPU_LEVEL, "-1" );
|
||||
// const int gpuLevel = atoi( gpuLevelStr );
|
||||
// if ( gpuLevel >= 0 ) {
|
||||
// vrModeParms.GpuLevel = gpuLevel;
|
||||
// qDebug() << "Local Preferences: Setting gpuLevel" << vrModeParms.GpuLevel;
|
||||
// }
|
||||
//
|
||||
// _ovr = ovr_EnterVrMode(vrModeParms, _hmdInfo);
|
||||
}
|
||||
|
||||
void GVRInterface::leaveVRMode() {
|
||||
|
||||
// ovr_LeaveVrMode(_ovr);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,6 @@ private slots:
|
|||
void handleApplicationStateChange(Qt::ApplicationState state);
|
||||
void idle();
|
||||
private:
|
||||
void enterVRMode();
|
||||
void leaveVRMode();
|
||||
|
||||
RenderingClient* _client;
|
||||
bool _inVRMode;
|
||||
|
||||
|
|
|
@ -74,7 +74,6 @@ void RenderingClient::processVerifiedPacket(const HifiSockAddr& senderSockAddr,
|
|||
Qt::QueuedConnection,
|
||||
Q_ARG(QByteArray, incomingPacket));
|
||||
} else {
|
||||
qDebug() << "Processing received audio of" << incomingPacket.size();
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "addReceivedAudioToStream",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QByteArray, incomingPacket));
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// InterfaceActivity.java
|
||||
// gvr-interface/java
|
||||
//
|
||||
// Created by Stephen Birarda on 1/26/15.
|
||||
// Copyright 2015 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
|
||||
//
|
||||
|
||||
package io.highfidelity.gvrinterface;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
||||
|
||||
public class InterfaceActivity extends QtActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
}
|
|
@ -231,7 +231,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
||||
|
||||
|
||||
// read the ApplicationInfo.ini file for Name/Version/Domain information
|
||||
QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
|
||||
|
||||
|
|
|
@ -74,8 +74,6 @@ AccountManager::AccountManager() :
|
|||
qRegisterMetaType<JSONCallbackParameters>("JSONCallbackParameters");
|
||||
|
||||
qRegisterMetaType<QHttpMultiPart*>("QHttpMultiPart*");
|
||||
|
||||
setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||
|
||||
connect(&_accountInfo, &DataServerAccountInfo::balanceChanged, this, &AccountManager::accountInfoBalanceChanged);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue