Properly fixed projection

This commit is contained in:
Simon 2020-10-22 21:47:07 +01:00
parent f8d2e095a8
commit b8ffed9a79
6 changed files with 9 additions and 19 deletions

View file

@ -122,15 +122,15 @@
<sourceFolder url="file://$MODULE_DIR$/jni/quake2/src/game/savegame" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/jni/quake2/src/client/refresh/files" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/jni/quake2/src/client/refresh/gl1" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.quake2quest"
android:versionCode="15"
android:versionName="1.0.4" android:installLocation="auto" >
android:versionCode="16"
android:versionName="1.0.5" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>

View file

@ -667,7 +667,7 @@ void ovrRenderer_Clear( ovrRenderer * renderer )
{
ovrFramebuffer_Clear( &renderer->FrameBuffer[eye] );
}
renderer->ProjectionMatrix = ovrMatrix4f_CreateIdentity();
renderer->NumBuffers = VRAPI_FRAME_LAYER_EYE_MAX;
}
@ -676,9 +676,6 @@ void ovrRenderer_Create( int width, int height, ovrRenderer * renderer, const ov
{
renderer->NumBuffers = VRAPI_FRAME_LAYER_EYE_MAX;
//Now using a symmetrical render target, based on the horizontal FOV
vrFOV = vrapi_GetSystemPropertyInt( java, VRAPI_SYS_PROP_SUGGESTED_EYE_FOV_DEGREES_X);
// Create the render Textures.
for ( int eye = 0; eye < VRAPI_FRAME_LAYER_EYE_MAX; eye++ )
{
@ -688,11 +685,6 @@ void ovrRenderer_Create( int width, int height, ovrRenderer * renderer, const ov
height,
NUM_MULTI_SAMPLES );
}
// Setup the projection matrix.
renderer->ProjectionMatrix = ovrMatrix4f_CreateProjectionFov(
vrFOV, vrFOV, 0.0f, 0.0f, 1.0f, 0.0f );
}
void ovrRenderer_Destroy( ovrRenderer * renderer )
@ -701,7 +693,6 @@ void ovrRenderer_Destroy( ovrRenderer * renderer )
{
ovrFramebuffer_Destroy( &renderer->FrameBuffer[eye] );
}
renderer->ProjectionMatrix = ovrMatrix4f_CreateIdentity();
}
@ -1674,7 +1665,8 @@ void * AppThreadFunction( void * parm )
layer.Textures[eye].SwapChainIndex = frameBuffer->TextureSwapChainIndex;
ovrMatrix4f projectionMatrix;
projectionMatrix = ovrMatrix4f_CreateProjectionFov(vrFOV, vrFOV,
float fov = getFOV();
projectionMatrix = ovrMatrix4f_CreateProjectionFov(fov, fov,
0.0f, 0.0f, 0.1f, 0.0f);
layer.Textures[eye].TexCoordsFromTanAngles = ovrMatrix4f_TanAngleMatrixFromProjection(&projectionMatrix);

View file

@ -30,7 +30,6 @@ float playerHeight;
float playerYaw;
bool showingScreenLayer;
float vrFOV;
vec3_t worldPosition;

View file

@ -83,7 +83,6 @@ ovrRenderer
typedef struct
{
ovrFramebuffer FrameBuffer[VRAPI_FRAME_LAYER_EYE_MAX];
ovrMatrix4f ProjectionMatrix;
int NumBuffers;
} ovrRenderer;

View file

@ -32,7 +32,7 @@
#include "shared.h"
#include "crc.h"
#define Q2QVERSION "1.0.4"
#define Q2QVERSION "1.0.5"
#define YQ2VERSION "7.41"
#define BASEDIRNAME "Quake2Quest"