mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-06 20:53:54 +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)
|
||||
if (Os.isFamily(Os.FAMILY_UNIX)) {
|
||||
// FIXME
|
||||
|
||||
def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${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()
|
||||
runDumpSymsTask.dependsOn(task)
|
||||
|
|
|
@ -62,6 +62,7 @@ extern "C" {
|
|||
initOculusPlatform(env, obj);
|
||||
}
|
||||
QAndroidJniObject __interfaceActivity;
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnCreate(JNIEnv *env, jobject obj) {
|
||||
__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());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnDestroy(JNIEnv *env, jobject obj) {
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnPause(JNIEnv *env, jobject obj) {
|
||||
AndroidHelper::instance().notifyEnterBackground();
|
||||
|
|
|
@ -18,4 +18,6 @@ android {
|
|||
|
||||
dependencies {
|
||||
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 org.qtproject.qt5.android.QtNative;
|
||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
||||
|
||||
import io.highfidelity.utils.HifiUtils;
|
||||
|
@ -35,11 +36,9 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
private native void nativeOnCreate();
|
||||
private native static void nativeOnResume();
|
||||
private native static void nativeOnPause();
|
||||
private native static void nativeOnDestroy();
|
||||
private native static void nativeOnSurfaceChanged(Surface s);
|
||||
|
||||
private native void questNativeOnCreate();
|
||||
private native void questNativeOnDestroy();
|
||||
private native void questNativeOnPause();
|
||||
private native void questNativeOnResume();
|
||||
private native void questOnAppAfterLoad();
|
||||
|
@ -48,10 +47,7 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
private SurfaceView mView;
|
||||
private SurfaceHolder mSurfaceHolder;
|
||||
|
||||
boolean isLoading =false;
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
isLoading=true;
|
||||
super.onCreate(savedInstanceState);
|
||||
HifiUtils.upackAssets(getAssets(), getCacheDir().getAbsolutePath());
|
||||
|
||||
|
@ -65,14 +61,10 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
nativeOnCreate();
|
||||
questNativeOnCreate();
|
||||
}
|
||||
|
||||
public void onAppLoadedComplete() {
|
||||
Log.w(TAG, "QQQ Load Completed");
|
||||
isLoading=false;
|
||||
|
||||
//isLoading=false;
|
||||
runOnUiThread(() -> {
|
||||
setContentView(mView); setContentView(mView);
|
||||
setContentView(mView);
|
||||
questOnAppAfterLoad();
|
||||
});
|
||||
}
|
||||
|
@ -80,23 +72,22 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
@Override
|
||||
protected void onDestroy() {
|
||||
Log.w(TAG, "QQQ onDestroy");
|
||||
super.onDestroy();
|
||||
|
||||
if (mSurfaceHolder != null) {
|
||||
nativeOnSurfaceChanged(null);
|
||||
}
|
||||
nativeOnDestroy();
|
||||
questNativeOnDestroy();
|
||||
nativeOnSurfaceChanged(null);
|
||||
|
||||
Log.w(TAG, "QQQ onDestroy -- SUPER onDestroy");
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
Log.w(TAG, "QQQ onResume");
|
||||
super.onResume();
|
||||
//Reconnect the global reference back to handler
|
||||
nativeOnCreate();
|
||||
|
||||
questNativeOnResume();
|
||||
nativeOnResume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,16 +95,21 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
Log.w(TAG, "QQQ onPause");
|
||||
super.onPause();
|
||||
|
||||
if (!isLoading) {
|
||||
questNativeOnPause();
|
||||
nativeOnPause();
|
||||
}
|
||||
questNativeOnPause();
|
||||
nativeOnPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop(){
|
||||
super.onStop();
|
||||
Log.w(TAG, "QQQ Onstop called");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart(){
|
||||
super.onRestart();
|
||||
nativeOnCreate();
|
||||
Log.w(TAG, "QQQ onRestart called ****");
|
||||
questOnAppAfterLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,5 +131,6 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
|||
Log.w(TAG, "QQQ surfaceDestroyed ***************************************************");
|
||||
nativeOnSurfaceChanged(null);
|
||||
mSurfaceHolder = null;
|
||||
|
||||
}
|
||||
}
|
|
@ -364,7 +364,10 @@ public class QtActivity extends Activity {
|
|||
@Override
|
||||
protected void 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();
|
||||
// GC: this trick allow us to show a splash activity until Qt app finishes
|
||||
// loading
|
||||
QtApplication.invokeDelegate();
|
||||
|
||||
|
||||
// QtApplication.invokeDelegate();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -865,11 +865,6 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar
|
|||
|
||||
//virtual
|
||||
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
|
||||
auto solutionSource = animVars.lookup(_solutionSourceVar, (int)_solutionSource);
|
||||
|
||||
|
|
|
@ -70,6 +70,12 @@ struct VrSurface : public TaskQueue {
|
|||
}
|
||||
|
||||
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;
|
||||
submitRenderThreadTask([this](VrHandler* handler){ updateVrMode(); });
|
||||
}
|
||||
|
@ -334,10 +340,6 @@ JNIEXPORT void JNICALL Java_io_highfidelity_oculus_OculusMobileActivity_nativeOn
|
|||
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) {
|
||||
__android_log_write(ANDROID_LOG_WARN, "QQQ_JNI", __FUNCTION__);
|
||||
SURFACE.setResumed(true);
|
||||
|
|
|
@ -137,7 +137,7 @@ const float SCALE_CHANGE_EPSILON = 0.0000001f;
|
|||
void Model::setScaleInternal(const glm::vec3& scale) {
|
||||
if (glm::distance(_scale, scale) > SCALE_CHANGE_EPSILON) {
|
||||
_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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,10 @@ void ShapeInfo::setSphere(float radius) {
|
|||
void ShapeInfo::setMultiSphere(const std::vector<glm::vec3>& centers, const std::vector<float>& radiuses) {
|
||||
_url = "";
|
||||
_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++) {
|
||||
SphereData sphere = SphereData(centers[i], radiuses[i]);
|
||||
_sphereCollection.push_back(sphere);
|
||||
|
|
Loading…
Reference in a new issue