Matrix4f MeganekkoActivity::DrawEyeView(const int eye, const float fovDegreesX, const float fovDegreesY, ovrFrameParms & frameParms) { Scene* scene = GetScene(); ovrMatrix4f centerViewMatrix = scene->GetCenterViewMatrix(); const Matrix4f eyeViewMatrix = vrapi_GetEyeViewMatrix( &app->GetHeadModelParms(), ¢erViewMatrix, eye ); const Matrix4f eyeProjectionMatrix = ovrMatrix4f_CreateProjectionFov( fovDegreesX, fovDegreesY, 0.0f, 0.0f, 1.0f, 0.0f ); scene->SetViewMatrix(eyeViewMatrix); scene->SetProjectionMatrix(eyeProjectionMatrix); const Matrix4f eyeViewProjection = scene->Render(eye); GuiSys->RenderEyeView(centerViewMatrix, eyeViewMatrix, eyeProjectionMatrix); return eyeViewProjection; }
JNIEXPORT jobject JNICALL Java_com_eje_1c_meganekko_Scene_getViewOrientation(JNIEnv * jni, jobject obj, jlong jscene) { Scene* scene = reinterpret_cast<Scene*>(jscene); Quatf orientation = Quatf(scene->GetCenterViewMatrix().InvertedHomogeneousTransform()); return ToJava(jni, orientation); }