Automatic switching of refresh rate (Quest 2)

Also fixed lined the angle of the chainsaw up with the damage location
This commit is contained in:
Simon 2021-01-03 22:18:12 +00:00
parent b5778a6098
commit 833289a5e9
4 changed files with 29 additions and 11 deletions

View file

@ -1615,11 +1615,6 @@ void * AppThreadFunction(void * parm ) {
showLoadingIcon();
}
if (DISPLAY_REFRESH != -1)
{
vrapi_SetDisplayRefreshRate(gAppState.Ovr, DISPLAY_REFRESH);
}
//Should now be all set up and ready - start the Doom3 main loop
VR_Doom3Main(argc, argv);
@ -1636,11 +1631,25 @@ void * AppThreadFunction(void * parm ) {
}
//All the stuff we want to do each frame
void Doom3Quest_FrameSetup(int controlscheme)
void Doom3Quest_FrameSetup(int controlscheme, int refresh)
{
ALOGV("Refresh = %i", refresh);
//Use floor based tracking space
vrapi_SetTrackingSpace(gAppState.Ovr, VRAPI_TRACKING_SPACE_LOCAL_FLOOR);
int device = vrapi_GetSystemPropertyInt(&java, VRAPI_SYS_PROP_DEVICE_TYPE);
switch (device)
{
case VRAPI_DEVICE_TYPE_OCULUSQUEST:
//Force 60hz for Quest 1
vrapi_SetDisplayRefreshRate(gAppState.Ovr, 60);
break;
case VRAPI_DEVICE_TYPE_OCULUSQUEST2:
vrapi_SetDisplayRefreshRate(gAppState.Ovr, refresh);
break;
}
if (!Doom3Quest_useScreenLayer())
{
screenYaw = vr.hmdorientation_temp[YAW];
@ -1965,6 +1974,7 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_doom3quest_GLES3JNILib_onCreate( JNIEnv
if (refresh != -1)
{
//unused at the moment
DISPLAY_REFRESH = refresh;
}

View file

@ -23,7 +23,7 @@ extern "C" {
#if DEBUG
#define ALOGV(...) __android_log_print( ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__ )
#else
#define ALOGV(...)
#define ALOGV(...) __android_log_print( ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__ )
#endif
float screenYaw;
@ -76,7 +76,7 @@ void Doom3Quest_Vibrate(int channel, float low, float high);
bool Doom3Quest_processMessageQueue();
void Doom3Quest_FrameSetup();
void Doom3Quest_FrameSetup(int controlscheme, int refresh);
void Doom3Quest_setUseScreenLayer(int screen);

View file

@ -2403,7 +2403,7 @@ void idCommonLocal::InitSIMD( void ) {
}
extern "C" void Doom3Quest_FrameSetup(int controlscheme);
extern "C" void Doom3Quest_FrameSetup(int controlscheme, int refresh);
extern "C" void Doom3Quest_Vibrate(int channel, float low, float high );
void idCommonLocal::Vibrate(int channel, float low, float high)
@ -2424,7 +2424,8 @@ void idCommonLocal::Frame( void ) {
// pump all the events
Sys_GenerateEvents();
Doom3Quest_FrameSetup(cvarSystem->GetCVarInteger("vr_weaponHand"));
Doom3Quest_FrameSetup(cvarSystem->GetCVarInteger("vr_weaponHand"),
cvarSystem->GetCVarInteger("vr_refresh"));
if (game) {
game->SetVRClientInfo(pVRClientInfo);

View file

@ -2595,9 +2595,16 @@ void idWeapon::PresentWeapon( bool showViewModel, int hand ) {
// Koz hide weapon and muzzlerise was here, now called as weapon::CalculateHideRise in player->CalculateViewWeaponPosition to allow hand animations
}
//HACKADOODLE-DOOO!
idMat3 axis = viewWeaponAxis;
if (currentWeapon == WEAPON_CHAINSAW)
{
axis = idAngles(45, 0, 0).ToMat3() * viewWeaponAxis;
}
// set the physics position and orientation
GetPhysics()->SetOrigin( viewWeaponOrigin );
GetPhysics()->SetAxis( viewWeaponAxis );
GetPhysics()->SetAxis( axis );
UpdateVisuals();