mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 07:02:46 +02:00
Quest frame player work
This commit is contained in:
parent
efff296398
commit
f146c9fe77
7 changed files with 23 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
|||
set(TARGET_NAME framePlayer)
|
||||
set(TARGET_NAME questFramePlayer)
|
||||
setup_hifi_library(AndroidExtras)
|
||||
link_hifi_libraries(shared ktx shaders gpu gl oculusMobile ${PLATFORM_GL_BACKEND})
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${HIFI_ANDROID_PRECOMPILED}/ovr/VrApi/Include)
|
||||
|
|
|
@ -19,12 +19,12 @@ android {
|
|||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments '-DHIFI_ANDROID=1',
|
||||
'-DHIFI_ANDROID_APP=framePlayer',
|
||||
'-DHIFI_ANDROID_APP=questFramePlayer',
|
||||
'-DANDROID_TOOLCHAIN=clang',
|
||||
'-DANDROID_STL=c++_shared',
|
||||
|
||||
'-DCMAKE_VERBOSE_MAKEFILE=ON'
|
||||
targets = ['framePlayer']
|
||||
targets = ['questFramePlayer']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
||||
>
|
||||
<!-- JNI nonsense -->
|
||||
<meta-data android:name="android.app.lib_name" android:value="framePlayer"/>
|
||||
<meta-data android:name="android.app.lib_name" android:value="questFramePlayer"/>
|
||||
<!-- Qt nonsense -->
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <gpu/Texture.h>
|
||||
|
||||
#include <VrApi_Types.h>
|
||||
#include <VrApi_Helpers.h>
|
||||
#include <ovr/VrHandler.h>
|
||||
#include <ovr/Helpers.h>
|
||||
|
||||
|
@ -62,7 +63,7 @@ JNIEXPORT void JNICALL Java_io_highfidelity_frameplayer_QuestQtActivity_nativeOn
|
|||
}
|
||||
}
|
||||
|
||||
static const char* FRAME_FILE = "assets:/frames/20190115_0948.json";
|
||||
static const char* FRAME_FILE = "assets:/frames/20190121_1220.json";
|
||||
|
||||
static void textureLoader(const std::string& filename, const gpu::TexturePointer& texture, uint16_t layer) {
|
||||
QImage image;
|
||||
|
@ -193,9 +194,12 @@ void RenderThread::renderFrame() {
|
|||
// Quest
|
||||
auto frameCorrection = _correction * ovr::toGlm(tracking.HeadPose.Pose);
|
||||
_backend->setCameraCorrection(glm::inverse(frameCorrection), frame->view);
|
||||
vec4 fovs[2];
|
||||
ovr::for_each_eye([&](ovrEye eye){
|
||||
const auto& eyeInfo = tracking.Eye[eye];
|
||||
eyeProjections[eye] = ovr::toGlm(eyeInfo.ProjectionMatrix);
|
||||
auto& fov = fovs[eye];
|
||||
ovrMatrix4f_ExtractFov(&eyeInfo.ProjectionMatrix, &fov.x, &fov.y, &fov.z, &fov.w);
|
||||
eyeOffsets[eye] = ovr::toGlm(eyeInfo.ViewMatrix);
|
||||
});
|
||||
_backend->recycle();
|
||||
|
|
|
@ -12,8 +12,8 @@ project(':qt').projectDir = new File(settingsDir, 'libraries/qt')
|
|||
// Applications
|
||||
//
|
||||
|
||||
//include ':interface'
|
||||
//project(':interface').projectDir = new File(settingsDir, 'apps/interface')
|
||||
include ':interface'
|
||||
project(':interface').projectDir = new File(settingsDir, 'apps/interface')
|
||||
|
||||
include ':questInterface'
|
||||
project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface')
|
||||
|
@ -22,8 +22,8 @@ project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterfa
|
|||
// Test projects
|
||||
//
|
||||
|
||||
//include ':framePlayer'
|
||||
//project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer')
|
||||
include ':framePlayer'
|
||||
project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer')
|
||||
|
||||
//include ':questFramePlayer'
|
||||
//project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer')
|
||||
include ':questFramePlayer'
|
||||
project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer')
|
||||
|
|
|
@ -418,6 +418,10 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifndef GL_CLIP_DISTANCE0
|
||||
#define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT
|
||||
#endif
|
||||
|
||||
#define GL_PROFILE_RANGE(category, name) \
|
||||
PROFILE_RANGE(category, name); \
|
||||
GlDuration glProfileRangeThis(name);
|
||||
|
|
|
@ -380,6 +380,7 @@ ShaderPointer Deserializer::readShader(const json& node) {
|
|||
|
||||
// FIXME support procedural shaders
|
||||
Shader::Type type = node[keys::type];
|
||||
std::string name = node[keys::name];
|
||||
uint32_t id = node[keys::id];
|
||||
ShaderPointer result;
|
||||
switch (type) {
|
||||
|
@ -395,6 +396,9 @@ ShaderPointer Deserializer::readShader(const json& node) {
|
|||
default:
|
||||
throw std::runtime_error("not implemented");
|
||||
}
|
||||
if (result->getSource().name != name) {
|
||||
throw std::runtime_error("Bad name match");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue