mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 04:08:55 +02:00
fixed issues with pause/resume and start/stop. still issues with input after resume
This commit is contained in:
parent
3cada9722c
commit
8d522d9ce7
9 changed files with 42 additions and 39 deletions
|
@ -92,7 +92,9 @@ android {
|
||||||
variant.mergeResources.dependsOn(task)
|
variant.mergeResources.dependsOn(task)
|
||||||
if (Os.isFamily(Os.FAMILY_UNIX)) {
|
if (Os.isFamily(Os.FAMILY_UNIX)) {
|
||||||
// FIXME
|
// FIXME
|
||||||
|
|
||||||
def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first()
|
def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first()
|
||||||
|
|
||||||
def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first()
|
def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first()
|
||||||
def renameHifiACTask = rootProject.getTasksByName("renameHifiACTask${variant.name.capitalize()}", false).first()
|
def renameHifiACTask = rootProject.getTasksByName("renameHifiACTask${variant.name.capitalize()}", false).first()
|
||||||
runDumpSymsTask.dependsOn(task)
|
runDumpSymsTask.dependsOn(task)
|
||||||
|
|
|
@ -62,6 +62,7 @@ extern "C" {
|
||||||
initOculusPlatform(env, obj);
|
initOculusPlatform(env, obj);
|
||||||
}
|
}
|
||||||
QAndroidJniObject __interfaceActivity;
|
QAndroidJniObject __interfaceActivity;
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnCreate(JNIEnv *env, jobject obj) {
|
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnCreate(JNIEnv *env, jobject obj) {
|
||||||
__android_log_print(ANDROID_LOG_INFO, "QQQ", __FUNCTION__);
|
__android_log_print(ANDROID_LOG_INFO, "QQQ", __FUNCTION__);
|
||||||
|
@ -85,10 +86,6 @@ JNIEXPORT void Java_io_highfidelity_oculus_OculusMobileActivity_questOnAppAfterL
|
||||||
AndroidHelper::instance().moveToThread(qApp->thread());
|
AndroidHelper::instance().moveToThread(qApp->thread());
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnDestroy(JNIEnv *env, jobject obj) {
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnPause(JNIEnv *env, jobject obj) {
|
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnPause(JNIEnv *env, jobject obj) {
|
||||||
AndroidHelper::instance().notifyEnterBackground();
|
AndroidHelper::instance().notifyEnterBackground();
|
||||||
|
|
|
@ -18,4 +18,6 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(path: ':qt')
|
compile project(path: ':qt')
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: '../../libraries/qt/libs')
|
||||||
|
implementation project(':qt')
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.view.WindowManager;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
|
||||||
|
import org.qtproject.qt5.android.QtNative;
|
||||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
import org.qtproject.qt5.android.bindings.QtActivity;
|
||||||
|
|
||||||
import io.highfidelity.utils.HifiUtils;
|
import io.highfidelity.utils.HifiUtils;
|
||||||
|
@ -35,11 +36,9 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
private native void nativeOnCreate();
|
private native void nativeOnCreate();
|
||||||
private native static void nativeOnResume();
|
private native static void nativeOnResume();
|
||||||
private native static void nativeOnPause();
|
private native static void nativeOnPause();
|
||||||
private native static void nativeOnDestroy();
|
|
||||||
private native static void nativeOnSurfaceChanged(Surface s);
|
private native static void nativeOnSurfaceChanged(Surface s);
|
||||||
|
|
||||||
private native void questNativeOnCreate();
|
private native void questNativeOnCreate();
|
||||||
private native void questNativeOnDestroy();
|
|
||||||
private native void questNativeOnPause();
|
private native void questNativeOnPause();
|
||||||
private native void questNativeOnResume();
|
private native void questNativeOnResume();
|
||||||
private native void questOnAppAfterLoad();
|
private native void questOnAppAfterLoad();
|
||||||
|
@ -48,10 +47,7 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
private SurfaceView mView;
|
private SurfaceView mView;
|
||||||
private SurfaceHolder mSurfaceHolder;
|
private SurfaceHolder mSurfaceHolder;
|
||||||
|
|
||||||
boolean isLoading =false;
|
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
isLoading=true;
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
HifiUtils.upackAssets(getAssets(), getCacheDir().getAbsolutePath());
|
HifiUtils.upackAssets(getAssets(), getCacheDir().getAbsolutePath());
|
||||||
|
|
||||||
|
@ -65,14 +61,10 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
nativeOnCreate();
|
nativeOnCreate();
|
||||||
questNativeOnCreate();
|
questNativeOnCreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAppLoadedComplete() {
|
public void onAppLoadedComplete() {
|
||||||
Log.w(TAG, "QQQ Load Completed");
|
Log.w(TAG, "QQQ Load Completed");
|
||||||
isLoading=false;
|
|
||||||
|
|
||||||
//isLoading=false;
|
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
setContentView(mView); setContentView(mView);
|
setContentView(mView);
|
||||||
questOnAppAfterLoad();
|
questOnAppAfterLoad();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -80,23 +72,22 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
Log.w(TAG, "QQQ onDestroy");
|
Log.w(TAG, "QQQ onDestroy");
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mSurfaceHolder != null) {
|
nativeOnSurfaceChanged(null);
|
||||||
nativeOnSurfaceChanged(null);
|
|
||||||
}
|
Log.w(TAG, "QQQ onDestroy -- SUPER onDestroy");
|
||||||
nativeOnDestroy();
|
super.onDestroy();
|
||||||
questNativeOnDestroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
Log.w(TAG, "QQQ onResume");
|
Log.w(TAG, "QQQ onResume");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
//Reconnect the global reference back to handler
|
||||||
|
nativeOnCreate();
|
||||||
|
|
||||||
questNativeOnResume();
|
questNativeOnResume();
|
||||||
nativeOnResume();
|
nativeOnResume();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -104,16 +95,21 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
Log.w(TAG, "QQQ onPause");
|
Log.w(TAG, "QQQ onPause");
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
if (!isLoading) {
|
questNativeOnPause();
|
||||||
questNativeOnPause();
|
nativeOnPause();
|
||||||
nativeOnPause();
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
protected void onStop(){
|
||||||
|
super.onStop();
|
||||||
|
Log.w(TAG, "QQQ Onstop called");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestart(){
|
protected void onRestart(){
|
||||||
super.onRestart();
|
super.onRestart();
|
||||||
nativeOnCreate();
|
Log.w(TAG, "QQQ onRestart called ****");
|
||||||
|
questOnAppAfterLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -135,5 +131,6 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
Log.w(TAG, "QQQ surfaceDestroyed ***************************************************");
|
Log.w(TAG, "QQQ surfaceDestroyed ***************************************************");
|
||||||
nativeOnSurfaceChanged(null);
|
nativeOnSurfaceChanged(null);
|
||||||
mSurfaceHolder = null;
|
mSurfaceHolder = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -364,7 +364,10 @@ public class QtActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
QtApplication.invokeDelegate();
|
|
||||||
|
QtNative.terminateQt();
|
||||||
|
QtNative.setActivity(null,null);
|
||||||
|
System.exit(0);
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -506,7 +509,9 @@ public class QtActivity extends Activity {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
// GC: this trick allow us to show a splash activity until Qt app finishes
|
// GC: this trick allow us to show a splash activity until Qt app finishes
|
||||||
// loading
|
// loading
|
||||||
QtApplication.invokeDelegate();
|
|
||||||
|
|
||||||
|
// QtApplication.invokeDelegate();
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -865,11 +865,6 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut, const AnimPoseVec& underPoses) {
|
const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut, const AnimPoseVec& underPoses) {
|
||||||
#ifdef Q_OS_ANDROID
|
|
||||||
// disable IK on android
|
|
||||||
return underPoses;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// allows solutionSource to be overridden by an animVar
|
// allows solutionSource to be overridden by an animVar
|
||||||
auto solutionSource = animVars.lookup(_solutionSourceVar, (int)_solutionSource);
|
auto solutionSource = animVars.lookup(_solutionSourceVar, (int)_solutionSource);
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,12 @@ struct VrSurface : public TaskQueue {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setResumed(bool newResumed) {
|
void setResumed(bool newResumed) {
|
||||||
|
|
||||||
|
if(oculusActivity)
|
||||||
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Set Resumed VRHANDLER ::: OCULUS ACTIVITY IN NOT NULL");
|
||||||
|
else
|
||||||
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Set Resumed VRHANDLER ::: OCULUS ACTIVITY is null");
|
||||||
|
|
||||||
this->resumed = newResumed;
|
this->resumed = newResumed;
|
||||||
submitRenderThreadTask([this](VrHandler* handler){ updateVrMode(); });
|
submitRenderThreadTask([this](VrHandler* handler){ updateVrMode(); });
|
||||||
}
|
}
|
||||||
|
@ -334,10 +340,6 @@ JNIEXPORT void JNICALL Java_io_highfidelity_oculus_OculusMobileActivity_nativeOn
|
||||||
SURFACE.onCreate(env, obj);
|
SURFACE.onCreate(env, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_io_highfidelity_oculus_OculusMobileActivity_nativeOnDestroy(JNIEnv*, jclass) {
|
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ_JNI", __FUNCTION__);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_io_highfidelity_oculus_OculusMobileActivity_nativeOnResume(JNIEnv*, jclass) {
|
JNIEXPORT void JNICALL Java_io_highfidelity_oculus_OculusMobileActivity_nativeOnResume(JNIEnv*, jclass) {
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ_JNI", __FUNCTION__);
|
__android_log_write(ANDROID_LOG_WARN, "QQQ_JNI", __FUNCTION__);
|
||||||
SURFACE.setResumed(true);
|
SURFACE.setResumed(true);
|
||||||
|
|
|
@ -137,7 +137,7 @@ const float SCALE_CHANGE_EPSILON = 0.0000001f;
|
||||||
void Model::setScaleInternal(const glm::vec3& scale) {
|
void Model::setScaleInternal(const glm::vec3& scale) {
|
||||||
if (glm::distance(_scale, scale) > SCALE_CHANGE_EPSILON) {
|
if (glm::distance(_scale, scale) > SCALE_CHANGE_EPSILON) {
|
||||||
_scale = scale;
|
_scale = scale;
|
||||||
assert(_scale.x != 0.0f && scale.y != 0.0f && scale.z != 0.0f);
|
// assert(_scale.x != 0.0f && scale.y != 0.0f && scale.z != 0.0f);
|
||||||
simulate(0.0f, true);
|
simulate(0.0f, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,10 @@ void ShapeInfo::setSphere(float radius) {
|
||||||
void ShapeInfo::setMultiSphere(const std::vector<glm::vec3>& centers, const std::vector<float>& radiuses) {
|
void ShapeInfo::setMultiSphere(const std::vector<glm::vec3>& centers, const std::vector<float>& radiuses) {
|
||||||
_url = "";
|
_url = "";
|
||||||
_type = SHAPE_TYPE_MULTISPHERE;
|
_type = SHAPE_TYPE_MULTISPHERE;
|
||||||
assert(centers.size() == radiuses.size() && centers.size() > 0);
|
if(centers.size() == radiuses.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// assert(centers.size() == radiuses.size() && centers.size() > 0);
|
||||||
for (size_t i = 0; i < centers.size(); i++) {
|
for (size_t i = 0; i < centers.size(); i++) {
|
||||||
SphereData sphere = SphereData(centers[i], radiuses[i]);
|
SphereData sphere = SphereData(centers[i], radiuses[i]);
|
||||||
_sphereCollection.push_back(sphere);
|
_sphereCollection.push_back(sphere);
|
||||||
|
|
Loading…
Reference in a new issue