mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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)
|
setup_hifi_library(AndroidExtras)
|
||||||
link_hifi_libraries(shared ktx shaders gpu gl oculusMobile ${PLATFORM_GL_BACKEND})
|
link_hifi_libraries(shared ktx shaders gpu gl oculusMobile ${PLATFORM_GL_BACKEND})
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE ${HIFI_ANDROID_PRECOMPILED}/ovr/VrApi/Include)
|
target_include_directories(${TARGET_NAME} PRIVATE ${HIFI_ANDROID_PRECOMPILED}/ovr/VrApi/Include)
|
||||||
|
|
|
@ -19,12 +19,12 @@ android {
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments '-DHIFI_ANDROID=1',
|
arguments '-DHIFI_ANDROID=1',
|
||||||
'-DHIFI_ANDROID_APP=framePlayer',
|
'-DHIFI_ANDROID_APP=questFramePlayer',
|
||||||
'-DANDROID_TOOLCHAIN=clang',
|
'-DANDROID_TOOLCHAIN=clang',
|
||||||
'-DANDROID_STL=c++_shared',
|
'-DANDROID_STL=c++_shared',
|
||||||
|
|
||||||
'-DCMAKE_VERBOSE_MAKEFILE=ON'
|
'-DCMAKE_VERBOSE_MAKEFILE=ON'
|
||||||
targets = ['framePlayer']
|
targets = ['questFramePlayer']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
||||||
>
|
>
|
||||||
<!-- JNI nonsense -->
|
<!-- 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 -->
|
<!-- Qt nonsense -->
|
||||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
<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"/>
|
<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 <gpu/Texture.h>
|
||||||
|
|
||||||
#include <VrApi_Types.h>
|
#include <VrApi_Types.h>
|
||||||
|
#include <VrApi_Helpers.h>
|
||||||
#include <ovr/VrHandler.h>
|
#include <ovr/VrHandler.h>
|
||||||
#include <ovr/Helpers.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) {
|
static void textureLoader(const std::string& filename, const gpu::TexturePointer& texture, uint16_t layer) {
|
||||||
QImage image;
|
QImage image;
|
||||||
|
@ -193,9 +194,12 @@ void RenderThread::renderFrame() {
|
||||||
// Quest
|
// Quest
|
||||||
auto frameCorrection = _correction * ovr::toGlm(tracking.HeadPose.Pose);
|
auto frameCorrection = _correction * ovr::toGlm(tracking.HeadPose.Pose);
|
||||||
_backend->setCameraCorrection(glm::inverse(frameCorrection), frame->view);
|
_backend->setCameraCorrection(glm::inverse(frameCorrection), frame->view);
|
||||||
|
vec4 fovs[2];
|
||||||
ovr::for_each_eye([&](ovrEye eye){
|
ovr::for_each_eye([&](ovrEye eye){
|
||||||
const auto& eyeInfo = tracking.Eye[eye];
|
const auto& eyeInfo = tracking.Eye[eye];
|
||||||
eyeProjections[eye] = ovr::toGlm(eyeInfo.ProjectionMatrix);
|
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);
|
eyeOffsets[eye] = ovr::toGlm(eyeInfo.ViewMatrix);
|
||||||
});
|
});
|
||||||
_backend->recycle();
|
_backend->recycle();
|
||||||
|
|
|
@ -12,8 +12,8 @@ project(':qt').projectDir = new File(settingsDir, 'libraries/qt')
|
||||||
// Applications
|
// Applications
|
||||||
//
|
//
|
||||||
|
|
||||||
//include ':interface'
|
include ':interface'
|
||||||
//project(':interface').projectDir = new File(settingsDir, 'apps/interface')
|
project(':interface').projectDir = new File(settingsDir, 'apps/interface')
|
||||||
|
|
||||||
include ':questInterface'
|
include ':questInterface'
|
||||||
project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface')
|
project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface')
|
||||||
|
@ -22,8 +22,8 @@ project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterfa
|
||||||
// Test projects
|
// Test projects
|
||||||
//
|
//
|
||||||
|
|
||||||
//include ':framePlayer'
|
include ':framePlayer'
|
||||||
//project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer')
|
project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer')
|
||||||
|
|
||||||
//include ':questFramePlayer'
|
include ':questFramePlayer'
|
||||||
//project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer')
|
project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer')
|
||||||
|
|
|
@ -418,6 +418,10 @@ public:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef GL_CLIP_DISTANCE0
|
||||||
|
#define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GL_PROFILE_RANGE(category, name) \
|
#define GL_PROFILE_RANGE(category, name) \
|
||||||
PROFILE_RANGE(category, name); \
|
PROFILE_RANGE(category, name); \
|
||||||
GlDuration glProfileRangeThis(name);
|
GlDuration glProfileRangeThis(name);
|
||||||
|
|
|
@ -380,6 +380,7 @@ ShaderPointer Deserializer::readShader(const json& node) {
|
||||||
|
|
||||||
// FIXME support procedural shaders
|
// FIXME support procedural shaders
|
||||||
Shader::Type type = node[keys::type];
|
Shader::Type type = node[keys::type];
|
||||||
|
std::string name = node[keys::name];
|
||||||
uint32_t id = node[keys::id];
|
uint32_t id = node[keys::id];
|
||||||
ShaderPointer result;
|
ShaderPointer result;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -395,6 +396,9 @@ ShaderPointer Deserializer::readShader(const json& node) {
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("not implemented");
|
throw std::runtime_error("not implemented");
|
||||||
}
|
}
|
||||||
|
if (result->getSource().name != name) {
|
||||||
|
throw std::runtime_error("Bad name match");
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue