diff --git a/.gitignore b/.gitignore index 497be31e..22b67020 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ Windows/build -id1 -Id1 +Debug/id1 +Debug/Id1 +Linux/CodeBlocks/id1 +Linux/CodeBlocks/Id1 Build-qu* *.so *.dbg diff --git a/QC/pak3.pak b/QC/pak3.pak index 5cf48bb7..218b5b0b 100644 Binary files a/QC/pak3.pak and b/QC/pak3.pak differ diff --git a/QC/progs.dat b/QC/progs.dat index 51c649fd..ff63a2ef 100644 Binary files a/QC/progs.dat and b/QC/progs.dat differ diff --git a/QC/weapons.qc b/QC/weapons.qc index 4375a26b..6bad4124 100644 --- a/QC/weapons.qc +++ b/QC/weapons.qc @@ -55,8 +55,22 @@ vector() vrProjectileVelocity = return VEC_ORIGIN; }; +float(float v) VRMeleeDmg = +{ + return (v * self.handvelmag) * cvar("vr_melee_dmg_multiplier"); +} + +float(float v) VRMeleeOffHandDmg = +{ + return (v * self.offhandvelmag) * cvar("vr_melee_dmg_multiplier"); +} +float(float v) VRMeleeRange = +{ + return v * cvar("vr_melee_range_multiplier"); +} + /* ================ W_FireAxe @@ -70,8 +84,7 @@ void() W_FireAxe = local string s; local float playedsound; - // TODO VR: add damage multiplier cvar - xdmg = 0.73 * self.handvelmag; + xdmg = VRMeleeDmg(0.73); // s = ftos(xdmg); // sprint (self, "DMG: "); @@ -80,8 +93,7 @@ void() W_FireAxe = makevectors (self.v_angle); source = self.handpos + '0 0 0'; - // TODO VR: add range multiplier cvar - traceline (source - v_forward*24, source + v_forward*28, FALSE, self); + traceline (source - v_forward*24, source + v_forward * VRMeleeRange(28), FALSE, self); if (trace_fraction == 1.0) return; @@ -137,7 +149,7 @@ void() W_GunMelee = local string s; local float playedsound; - xdmg = 0.43 * self.handvelmag; + xdmg = VRMeleeDmg(0.43); // s = ftos(xdmg); // sprint (self, "DMG: "); @@ -146,7 +158,7 @@ void() W_GunMelee = makevectors (self.v_angle); source = self.handpos + '0 0 0'; - traceline (source - v_forward*24, source + v_forward*26, FALSE, self); + traceline (source - v_forward*24, source + v_forward * VRMeleeRange(26), FALSE, self); if (trace_fraction == 1.0) return; @@ -203,7 +215,7 @@ void() W_FistMelee = local string s; local float playedsound; - xdmg = 0.53 * self.offhandvelmag; + xdmg = VRMeleeOffHandDmg(0.53); // s = ftos(xdmg); // sprint (self, "OFFHANDDMG: "); @@ -212,7 +224,7 @@ void() W_FistMelee = makevectors (self.v_angle); source = self.offhandpos + '0 0 0'; - traceline (source - v_forward*24, source + v_forward*24, FALSE, self); + traceline (source - v_forward*24, source + v_forward * VRMeleeRange(24), FALSE, self); if (trace_fraction == 1.0) return; diff --git a/Quake/cl_input.cpp b/Quake/cl_input.cpp index e6e87cf1..a00a785d 100644 --- a/Quake/cl_input.cpp +++ b/Quake/cl_input.cpp @@ -367,7 +367,7 @@ cvar_t cl_forwardspeed = {"cl_forwardspeed", "200", CVAR_ARCHIVE}; cvar_t cl_backspeed = {"cl_backspeed", "200", CVAR_ARCHIVE}; cvar_t cl_sidespeed = {"cl_sidespeed", "350", CVAR_NONE}; -cvar_t cl_movespeedkey = {"cl_movespeedkey", "2.0", CVAR_NONE}; +cvar_t cl_movespeedkey = {"cl_movespeedkey", "0.5", CVAR_ARCHIVE}; cvar_t cl_yawspeed = {"cl_yawspeed", "140", CVAR_NONE}; cvar_t cl_pitchspeed = {"cl_pitchspeed", "150", CVAR_NONE}; diff --git a/Quake/cl_tent.cpp b/Quake/cl_tent.cpp index ef5312e6..293ca1e0 100644 --- a/Quake/cl_tent.cpp +++ b/Quake/cl_tent.cpp @@ -347,19 +347,11 @@ void CL_UpdateTEnts() { if(vr_enabled.value) { - // TODO VR: deal with offset in non-vr mode ? - // - // vec3_t adj; - // VectorCopy(cl.handpos[1], adj); - // adj[2] += vr_projectilespawn_z_offset.value; - // VectorCopy(adj, b->start); - // TODO VR: hardcoded lightning gun muzzle position for beam // effect - vec3_t forward; + vec3_t forward; vec3_t right; - vec3_t up; AngleVectors(cl.handrot[1], forward, right, up); diff --git a/Quake/gl_rmain.cpp b/Quake/gl_rmain.cpp index 56579338..a08f8278 100644 --- a/Quake/gl_rmain.cpp +++ b/Quake/gl_rmain.cpp @@ -981,28 +981,25 @@ void R_ShowTris() } } + const auto doViewmodel = + [&](entity_t* ent) { + currententity = ent; + if (r_drawviewmodel.value && !chase_active.value && + cl.stats[STAT_HEALTH] > 0 && + !(cl.items & IT_INVISIBILITY) && currententity->model && + currententity->model->type == mod_alias) + { + glDepthRange(0, 0.3); + R_DrawAliasModel_ShowTris(currententity); + glDepthRange(0, 1); + } + }; + // viewmodel - currententity = &cl.viewent; - if(r_drawviewmodel.value && !chase_active.value && - cl.stats[STAT_HEALTH] > 0 && !(cl.items & IT_INVISIBILITY) && - currententity->model && currententity->model->type == mod_alias) - { - glDepthRange(0, 0.3); - R_DrawAliasModel_ShowTris(currententity); - glDepthRange(0, 1); - } + doViewmodel(&cl.viewent); - // TODO VR: not needed? // offhand viewmodel - /* currententity = &cl.offhand_viewent; - if(r_drawviewmodel.value && !chase_active.value && - cl.stats[STAT_HEALTH] > 0 && !(cl.items & IT_INVISIBILITY) && - currententity->model && currententity->model->type == mod_alias) - { - glDepthRange(0, 0.3); - R_DrawAliasModel_ShowTris(currententity); - glDepthRange(0, 1); - } */ + doViewmodel(&cl.offhand_viewent); } if(r_particles.value) diff --git a/Quake/main_sdl.cpp b/Quake/main_sdl.cpp index edae888d..99006576 100644 --- a/Quake/main_sdl.cpp +++ b/Quake/main_sdl.cpp @@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include + #include "quakedef.hpp" #if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) #if defined(USE_SDL2) @@ -104,8 +107,17 @@ static quakeparms_t parms; #define main SDL_main #endif +// TODO VR: +extern std::string vr_working_directory; + int main(int argc, char* argv[]) { + // TODO VR: more portable/reliable way of doing this + assert(argc >= 1); + vr_working_directory = argv[0]; + vr_working_directory = vr_working_directory.substr(0, vr_working_directory.find_last_of("\\")); + Sys_Printf("Working directory: '%s'\n", vr_working_directory.c_str()); + int t; double time; @@ -152,6 +164,7 @@ int main(int argc, char* argv[]) Sys_Printf("FitzQuake SDL port (c) SleepwalkR, Baker\n"); Sys_Printf("QuakeSpasm " QUAKESPASM_VER_STRING " (c) Ozkan Sezer, Eric Wasylishen & others\n"); + Sys_Printf("Quake VR " QUAKEVR_VERSION " by Vittorio Romeo & others\n"); Sys_Printf("Host_Init\n"); Host_Init(); diff --git a/Quake/menu.cpp b/Quake/menu.cpp index ee251a26..25196896 100644 --- a/Quake/menu.cpp +++ b/Quake/menu.cpp @@ -1066,9 +1066,10 @@ void M_Net_Key(int k) enum { - OPT_CUSTOMIZE = 0, - OPT_CONSOLE, // 1 - OPT_DEFAULTS, // 2 + // TODO VR: + // OPT_CUSTOMIZE = 0, + OPT_CONSOLE = 0, + OPT_DEFAULTS, OPT_SCALE, OPT_SCRSIZE, OPT_GAMMA, @@ -1101,7 +1102,7 @@ enum { ALWAYSRUN_OFF = 0, ALWAYSRUN_VANILLA, - ALWAYSRUN_QUAKESPASM, + // ALWAYSRUN_QUAKESPASM, ALWAYSRUN_ITEMS }; @@ -1120,7 +1121,8 @@ void M_Menu_Options_f() void M_AdjustSliders(int dir) { - int curr_alwaysrun; + // TODO VR: + // int curr_alwaysrun; int target_alwaysrun; float f; @@ -1235,39 +1237,36 @@ void M_AdjustSliders(int dir) break; case OPT_ALWAYRUN: // always run - if(cl_alwaysrun.value) + // TODO VR: + /*if(cl_alwaysrun.value) { curr_alwaysrun = ALWAYSRUN_QUAKESPASM; } - else if(cl_forwardspeed.value > 200) + else */ + /*if(cl_forwardspeed.value > 200) { curr_alwaysrun = ALWAYSRUN_VANILLA; } else { curr_alwaysrun = ALWAYSRUN_OFF; - } + }*/ target_alwaysrun = - (ALWAYSRUN_ITEMS + curr_alwaysrun + dir) % ALWAYSRUN_ITEMS; + (ALWAYSRUN_ITEMS + (int)cl_alwaysrun.value + dir) % + ALWAYSRUN_ITEMS; if(target_alwaysrun == ALWAYSRUN_VANILLA) - { - Cvar_SetValue("cl_alwaysrun", 0); - Cvar_SetValue("cl_forwardspeed", 400); - Cvar_SetValue("cl_backspeed", 400); - } - else if(target_alwaysrun == ALWAYSRUN_QUAKESPASM) { Cvar_SetValue("cl_alwaysrun", 1); - Cvar_SetValue("cl_forwardspeed", 200); - Cvar_SetValue("cl_backspeed", 200); } + // TODO VR: + // else if(target_alwaysrun == ALWAYSRUN_QUAKESPASM) + // { + // } else // ALWAYSRUN_OFF { Cvar_SetValue("cl_alwaysrun", 0); - Cvar_SetValue("cl_forwardspeed", 200); - Cvar_SetValue("cl_backspeed", 200); } break; @@ -1348,8 +1347,9 @@ void M_Options_Draw() M_DrawPic((320 - p->width) / 2, 4, p); // Draw the items in the order of the enum defined above: + // TODO VR: // OPT_CUSTOMIZE: - M_Print(16, 32, " Controls"); + // M_Print(16, 32, " Controls"); // OPT_CONSOLE: M_Print(16, 32 + 8 * OPT_CONSOLE, " Goto console"); // OPT_DEFAULTS: @@ -1404,11 +1404,7 @@ void M_Options_Draw() M_Print(16, 32 + 8 * OPT_ALWAYRUN, " Always Run"); if(cl_alwaysrun.value) { - M_Print(220, 32 + 8 * OPT_ALWAYRUN, "quakespasm"); - } - else if(cl_forwardspeed.value > 200.0) - { - M_Print(220, 32 + 8 * OPT_ALWAYRUN, "vanilla"); + M_Print(220, 32 + 8 * OPT_ALWAYRUN, "on"); } else { @@ -1465,7 +1461,8 @@ void M_Options_Key(int k) m_entersound = true; switch(options_cursor) { - case OPT_CUSTOMIZE: M_Menu_Keys_f(); break; + // TODO VR: + // case OPT_CUSTOMIZE: M_Menu_Keys_f(); break; case OPT_CONSOLE: m_state = m_none; Con_ToggleConsole_f(); @@ -1896,8 +1893,9 @@ bool M_Quit_TextEntry() void M_Quit_Draw() // johnfitz -- modified for new quit message { char msg1[40]; - char msg2[] = "by Ozkan Sezer, Eric Wasylishen, others"; /* msg2/msg3 are - mostly [40] */ + char msg2[] = + "by Vittorio Romeo, Ozkan Sezer, Eric Wasylishen, others"; /* msg2/msg3 + are mostly [40] */ char msg3[] = "Press y to quit"; int boxlen; diff --git a/Quake/quakedef.hpp b/Quake/quakedef.hpp index 39d2babf..da7b577d 100644 --- a/Quake/quakedef.hpp +++ b/Quake/quakedef.hpp @@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define FITZQUAKE_VERSION 0.85 // johnfitz #define QUAKESPASM_VERSION 0.93 +#define QUAKEVR_VERSION "0.0.2" #define QUAKESPASM_VER_PATCH 2 // helper to print a string like 0.93.2 #ifndef QUAKESPASM_VER_SUFFIX #define QUAKESPASM_VER_SUFFIX // optional version suffix string literal like @@ -49,7 +50,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // combined version string like "0.92.1-beta1" #define QUAKESPASM_VER_STRING \ QS_STRINGIFY(QUAKESPASM_VERSION) \ - "." QS_STRINGIFY(QUAKESPASM_VER_PATCH) QUAKESPASM_VER_SUFFIX + "." QS_STRINGIFY(QUAKESPASM_VER_PATCH) QUAKESPASM_VER_SUFFIX \ + " | Quake VR " QUAKEVR_VERSION // define PARANOID // speed sapping error checking diff --git a/Quake/r_alias.cpp b/Quake/r_alias.cpp index 2a6ed566..cbd8312b 100644 --- a/Quake/r_alias.cpp +++ b/Quake/r_alias.cpp @@ -651,7 +651,7 @@ void R_SetupAliasLighting(entity_t* e) } // minimum light value on gun (24) - if(e == &cl.viewent) + if(e == &cl.viewent || e == &cl.offhand_viewent) { add = 72.0f - (lightcolor[0] + lightcolor[1] + lightcolor[2]); if(add > 0.0f) diff --git a/Quake/sv_phys.cpp b/Quake/sv_phys.cpp index 51f4c0f9..934a71ae 100644 --- a/Quake/sv_phys.cpp +++ b/Quake/sv_phys.cpp @@ -355,7 +355,7 @@ int SV_FlyMove(edict_t* ent, float time, trace_t* steptrace) // SV_Impact(ent, trace.ent, &entvars_t::touch); - if(!vr_enabled.value) + if(!vr_enabled.value || vr_body_interactions.value) { SV_Impact(ent, trace.ent, &entvars_t::handtouch); } @@ -507,7 +507,7 @@ trace_t SV_PushEntity(edict_t* ent, vec3_t push) { SV_Impact(ent, trace.ent, &entvars_t::touch); - if(!vr_enabled.value) + if(!vr_enabled.value || vr_body_interactions.value) { SV_Impact(ent, trace.ent, &entvars_t::handtouch); } @@ -1064,7 +1064,8 @@ Trigger hand-touching actions (e.g. pick up an item, press a button) */ void SV_Handtouch(edict_t* ent) { - // TODO VR: this is still fucking broken, buttons don't work sometimes + // TODO VR: cleanup, too much unnecessary tracing and work + using namespace quake::util; diff --git a/Quake/util.hpp b/Quake/util.hpp index 83360e7f..eaf35747 100644 --- a/Quake/util.hpp +++ b/Quake/util.hpp @@ -60,7 +60,10 @@ namespace quake::util template [[nodiscard]] constexpr auto makeAdjustedMenuLabels(const Ts&... labels) { - return std::array{(std::string(24 - strlen(labels), ' ') + labels)...}; + constexpr auto maxLen = 25; + + assert(((strlen(labels) <= maxLen) && ...)); + return std::array{(std::string(maxLen - strlen(labels), ' ') + labels)...}; } [[nodiscard]] constexpr bool boxIntersection(const vec3_t& aMin, diff --git a/Quake/vr.cpp b/Quake/vr.cpp index 7ec98e4d..341e055b 100644 --- a/Quake/vr.cpp +++ b/Quake/vr.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef WIN32 #define UNICODE 1 @@ -128,6 +129,8 @@ extern int glx, gly, glwidth, glheight; static float vrYaw; static bool readbackYaw; +std::string vr_working_directory; + vec3_t vr_viewOffset; glm::vec3 lastHudPosition{}; glm::vec3 lastMenuPosition{}; @@ -145,6 +148,8 @@ static bool vr_initialized = false; static vec3_t headOrigin; static vec3_t lastHeadOrigin; +static vr::HmdVector3_t headPos; +static vr::HmdVector3_t headVelocity; vec3_t vr_room_scale_move; @@ -183,8 +188,6 @@ DEFINE_CVAR(vr_gunangle, 32, CVAR_ARCHIVE); DEFINE_CVAR(vr_gunmodelpitch, 0, CVAR_ARCHIVE); DEFINE_CVAR(vr_gunmodelscale, 1.0, CVAR_ARCHIVE); DEFINE_CVAR(vr_gunmodely, 0, CVAR_ARCHIVE); -// TODO VR: consider restoring for custom QC? -// DEFINE_CVAR(vr_projectilespawn_z_offset, 24, CVAR_ARCHIVE); DEFINE_CVAR(vr_crosshairy, 0, CVAR_ARCHIVE); DEFINE_CVAR(vr_world_scale, 1.0, CVAR_ARCHIVE); DEFINE_CVAR(vr_floor_offset, -16, CVAR_ARCHIVE); @@ -193,11 +196,6 @@ DEFINE_CVAR(vr_enable_joystick_turn, 1, CVAR_ARCHIVE); DEFINE_CVAR(vr_turn_speed, 1, CVAR_ARCHIVE); DEFINE_CVAR(vr_msaa, 4, CVAR_ARCHIVE); DEFINE_CVAR(vr_movement_mode, 0, CVAR_ARCHIVE); -DEFINE_CVAR(vr_joystick_yaw_multi, 1.0, CVAR_ARCHIVE); -DEFINE_CVAR(vr_joystick_axis_deadzone, 0.25, CVAR_ARCHIVE); -DEFINE_CVAR(vr_joystick_axis_menu_deadzone_extra, 0.25, CVAR_ARCHIVE); -DEFINE_CVAR(vr_joystick_axis_exponent, 1.0, CVAR_ARCHIVE); -DEFINE_CVAR(vr_joystick_deadzone_trunc, 1, CVAR_ARCHIVE); DEFINE_CVAR(vr_hud_scale, 0.025, CVAR_ARCHIVE); DEFINE_CVAR(vr_menu_scale, 0.13, CVAR_ARCHIVE); DEFINE_CVAR(vr_melee_threshold, 7, CVAR_ARCHIVE); @@ -210,6 +208,13 @@ DEFINE_CVAR(vr_sbar_offset_z, 0, CVAR_ARCHIVE); DEFINE_CVAR(vr_sbar_offset_pitch, 0, CVAR_ARCHIVE); DEFINE_CVAR(vr_sbar_offset_yaw, 0, CVAR_ARCHIVE); DEFINE_CVAR(vr_sbar_offset_roll, 0, CVAR_ARCHIVE); +DEFINE_CVAR(vr_roomscale_jump, 1, CVAR_ARCHIVE); +DEFINE_CVAR(vr_height_calibration, 1.6, CVAR_ARCHIVE); +DEFINE_CVAR(vr_roomscale_jump_threshold, 1.0, CVAR_ARCHIVE); +DEFINE_CVAR(vr_menu_distance, 76, CVAR_ARCHIVE); +DEFINE_CVAR(vr_melee_dmg_multiplier, 1.0, CVAR_ARCHIVE); +DEFINE_CVAR(vr_melee_range_multiplier, 1.0, CVAR_ARCHIVE); +DEFINE_CVAR(vr_body_interactions, 0, CVAR_ARCHIVE); [[nodiscard]] static bool InitOpenGLExtensions() { @@ -708,6 +713,68 @@ void VR_InitGame() InitAllWeaponCVars(); } +// ---------------------------------------------------------------------------- +// VR Action Handles +// ---------------------------------------------------------------------------- + +vr::VRActiveActionSet_t vrActiveActionSet; +vr::VRActionSetHandle_t vrashDefault; +vr::VRActionHandle_t vrahLocomotion; +vr::VRActionHandle_t vrahTurn; +vr::VRActionHandle_t vrahFire; +vr::VRActionHandle_t vrahJump; +vr::VRActionHandle_t vrahPrevWeapon; +vr::VRActionHandle_t vrahNextWeapon; +vr::VRActionHandle_t vrahEscape; +vr::VRActionHandle_t vrahSpeed; + +// TODO VR: implement haptic feedback +vr::VRActionHandle_t vrahHaptic; + +static void VR_InitActionHandles() +{ + // ----------------------------------------------------------------------- + // VR: Read "default" action set handle. + { + const auto rc = vr::VRInput()->GetActionSetHandle( + "/actions/default", &vrashDefault); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR action set handle, rc = %d", (int)rc); + } + } + + // ----------------------------------------------------------------------- + // VR: Read all action handles. + const auto readHandle = [](const char* name, vr::VRActionHandle_t& handle) { + const auto rc = vr::VRInput()->GetActionHandle(name, &handle); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR action handle, rc = %d", (int)rc); + } + }; + + readHandle("/actions/default/in/Locomotion", vrahLocomotion); + readHandle("/actions/default/in/Turn", vrahTurn); + readHandle("/actions/default/in/Fire", vrahFire); + readHandle("/actions/default/in/Jump", vrahJump); + readHandle("/actions/default/in/PrevWeapon", vrahPrevWeapon); + readHandle("/actions/default/in/NextWeapon", vrahNextWeapon); + readHandle("/actions/default/in/Escape", vrahEscape); + readHandle("/actions/default/in/Speed", vrahSpeed); + readHandle("/actions/default/out/Haptic", vrahHaptic); + + vrActiveActionSet.ulActionSet = vrashDefault; + vrActiveActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle; + vrActiveActionSet.nPriority = 0; +} + +// ---------------------------------------------------------------------------- + bool VR_Enable() { if(vr_initialized) @@ -720,11 +787,32 @@ bool VR_Enable() if(eInit != vr::VRInitError_None) { - Con_Printf("%s\nFailed to Initialize Steam VR", + Con_Printf("%s\nFailed to initialize Steam VR", VR_GetVRInitErrorAsEnglishDescription(eInit)); return false; } + { + static std::string manifestPath = + vr_working_directory + "/actions.json"; + + Con_Printf( + "Set Steam VR action manifest path to: '%s'", manifestPath.c_str()); + + const auto rc = + vr::VRInput()->SetActionManifestPath(manifestPath.c_str()); + + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR action manifest, rc = %d", (int)rc); + } + else + { + VR_InitActionHandles(); + } + } + if(!InitOpenGLExtensions()) { Con_Printf("Failed to initialize OpenGL extensions"); @@ -879,6 +967,9 @@ static void RenderScreenForCurrentEye_OVR() void SetHandPos(int index, entity_t* player) { + // ----------------------------------------------------------------------- + // VR: Figure out position of hand controllers in the game world. + vec3_t headLocalPreRot; _VectorSubtract(controllers[index].position, headOrigin, headLocalPreRot); @@ -888,36 +979,52 @@ void SetHandPos(int index, entity_t* player) vec3_t finalPre, finalVec; + const auto handZOrigin = + player->origin[2] + vr_floor_offset.value + vr_gun_z_offset.value; + finalPre[0] = -headLocal[0] + player->origin[0]; finalPre[1] = -headLocal[1] + player->origin[1]; - finalPre[2] = headLocal[2] + player->origin[2] + vr_floor_offset.value + - vr_gun_z_offset.value; + finalPre[2] = headLocal[2] + handZOrigin; - // TODO VR: + // ----------------------------------------------------------------------- + // VR: Detect & resolve hand collisions against the world or entities. - vec3_t mins{-4.f, -4.f, -4.f}; - vec3_t maxs{4.f, 4.f, 4.f}; + // Size of hand hitboxes. + vec3_t mins{-1.f, -1.f, -1.f}; + vec3_t maxs{1.f, 1.f, 1.f}; - trace_t SV_Move2(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, - int type, edict_t* passedict); - // trace_t trace = - // SV_Move2(player->origin, mins, maxs, finalPre, MOVE_NORMAL, sv_player); + // Start around the upper torso, not actual center of the player. + vec3_t adjPlayerOrigin; + VectorCopy(player->origin, adjPlayerOrigin); + adjPlayerOrigin[2] = handZOrigin + 40; - // TODO VR: collide with entities - vec3_t dummy; - trace_t trace = TraceLine(player->origin, finalPre, dummy); + // Trace from upper torso to desired final location. `SV_Move` detects + // entities as well, not just geometry. + const trace_t trace = + SV_Move(adjPlayerOrigin, mins, maxs, finalPre, MOVE_NORMAL, sv_player); - const auto orig = quake::util::toVec3(player->origin); + // Origin of the trace. + const auto orig = quake::util::toVec3(adjPlayerOrigin); + + // Final position before collision resolution. const auto pre = quake::util::toVec3(finalPre); + + // Final position after full collision resolution. const auto crop = quake::util::toVec3(trace.endpos); - if(glm::length(pre - orig) < glm::length(crop - orig)) + // Compute final collision resolution position, starting from the desired + // position and resolving only against the collision plane's normal vector. + VectorCopy(finalPre, finalVec); + if(glm::length(pre - orig) >= glm::length(crop - orig)) { VectorCopy(finalPre, finalVec); - } - else - { - VectorCopy(trace.endpos, finalVec); + for(int i = 0; i < 3; ++i) + { + if(trace.plane.normal[i] != 0) + { + finalVec[i] = trace.endpos[i]; + } + } } // handpos @@ -940,7 +1047,11 @@ void SetHandPos(int index, entity_t* player) VectorCopy(controllers[index].velocity, cl.handvel[index]); // handvelmag - // TODO VR: document + // VR: This helps direct punches being registered. This calculation works + // because the controller velocity is always absolute (not oriented where + // the player is looking). + // TODO VR: this still needs to be oriented to the headset's rotation, + // otherwise diagonal punches will still not register. const auto length = VectorLength(controllers[index].velocity); const auto bestSingle = std::max({std::abs(controllers[index].velocity[0]), std::abs(controllers[index].velocity[1]), @@ -949,8 +1060,6 @@ void SetHandPos(int index, entity_t* player) cl.handvelmag[index] = std::max(length, bestSingle); } -void IdentifyAxes(int device); - void VR_UpdateScreenContent() { GLint w; @@ -984,7 +1093,9 @@ void VR_UpdateScreenContent() ovrHMD->GetTrackedDeviceClass(iDevice) == vr::TrackedDeviceClass_HMD) { - vr::HmdVector3_t headPos = + headVelocity = ovr_DevicePose->vVelocity; + + headPos = Matrix34ToVector(ovr_DevicePose->mDeviceToAbsoluteTracking); headOrigin[0] = headPos.v[2]; headOrigin[1] = headPos.v[0]; @@ -1054,8 +1165,6 @@ void VR_UpdateScreenContent() { vr_controller* controller = &controllers[controllerIndex]; - IdentifyAxes(iDevice); - controller->lastState = controller->state; vr::VRSystem()->GetControllerState( iDevice, &controller->state, sizeof(controller->state)); @@ -1285,7 +1394,8 @@ void VR_UpdateScreenContent() // BModels cannot be scaled, doesnt work // qmodel_t* test = Mod_ForName("maps/b_shell1.bsp", true); // auto* testhdr = (aliashdr_t*)Mod_Extradata(test); - // VectorScale(testhdr->scale_origin, 0.5f, testhdr->scale_origin); + // VectorScale(testhdr->scale_origin, 0.5f, + // testhdr->scale_origin); } if(cl.offhand_viewent.model) @@ -1359,6 +1469,12 @@ void VR_SetMatrices() glLoadMatrixf((GLfloat*)projection.m); } +void VR_CalibrateHeight() +{ + const auto height = headPos.v[1]; + Cvar_SetValue("vr_height_calibration", height); + Con_Printf("Calibrated height to %.2f\n", height); +} void VR_AddOrientationToViewAngles(vec3_t angles) { @@ -1555,9 +1671,7 @@ void VR_Draw2D() } AngleVectors(menu_angles, forward, right, up); - - // TODO VR: make the distance a cvar - VectorMA(r_refdef.vieworg, 76, forward, target); + VectorMA(r_refdef.vieworg, vr_menu_distance.value, forward, target); } // TODO VR: control smoothing with cvar @@ -1747,141 +1861,134 @@ void VR_ResetOrientation() } } -int axisTrackpad = -1; -int axisJoystick = -1; -int axisTrigger = -1; -bool identified = false; +struct VRAxisResult +{ + float fwdMove; + float sideMove; + float yawMove; +}; -void IdentifyAxes(int device) +[[nodiscard]] static VRAxisResult VR_GetInputAxes( + const vr::InputAnalogActionData_t& locomotion, + const vr::InputAnalogActionData_t& turn) { - if(identified) - { - return; - } + return {locomotion.y, locomotion.x, turn.x}; +} - for(uint32_t i = 0; i < vr::k_unControllerStateAxisCount; i++) +[[nodiscard]] static VRAxisResult VR_DoInput() +{ { - switch(vr::VRSystem()->GetInt32TrackedDeviceProperty(device, - (vr::ETrackedDeviceProperty)(vr::Prop_Axis0Type_Int32 + i), - nullptr)) + const auto rc = vr::VRInput()->UpdateActionState( + &vrActiveActionSet, sizeof(vr::VRActiveActionSet_t), 1); + + if(rc != vr::EVRInputError::VRInputError_None) { - case vr::k_eControllerAxis_TrackPad: - if(axisTrackpad == -1) - { - axisTrackpad = i; - } - break; - case vr::k_eControllerAxis_Joystick: - if(axisJoystick == -1) - { - axisJoystick = i; - } - break; - case vr::k_eControllerAxis_Trigger: - if(axisTrigger == -1) - { - axisTrigger = i; - } - break; + Con_Printf( + "Failed to update Steam VR action state, rc = %d", (int)rc); } } - identified = true; -} + const auto readAnalogAction = [](const vr::VRActionHandle_t& actionHandle) { + vr::InputAnalogActionData_t out; -float GetAxis(vr::VRControllerState_t* state, int axis, double deadzoneExtra) -{ - float v = 0; + const auto rc = vr::VRInput()->GetAnalogActionData(actionHandle, &out, + sizeof(vr::InputAnalogActionData_t), + vr::k_ulInvalidInputValueHandle); - if(axis == 0) - { - if(axisTrackpad != -1) - { - v += state->rAxis[axisTrackpad].x; - } - if(axisJoystick != -1) + if(rc != vr::EVRInputError::VRInputError_None) { - v += state->rAxis[axisJoystick].x; + Con_Printf( + "Failed to read Steam VR analog action data, rc = %d", (int)rc); } - } - else - { - if(axisTrackpad != -1) - { - v += state->rAxis[axisTrackpad].y; - } - if(axisJoystick != -1) - { - v += state->rAxis[axisJoystick].y; - } - } - int sign = (v > 0) - (v < 0); - v = fabsf(v); + return out; + }; - if(v < vr_joystick_axis_deadzone.value + deadzoneExtra) - { - return 0.0f; - } + const auto readDigitalAction = + [](const vr::VRActionHandle_t& actionHandle) { + vr::InputDigitalActionData_t out; - if(vr_joystick_deadzone_trunc.value == 0) - { - v = (v - vr_joystick_axis_deadzone.value) / - (1 - vr_joystick_axis_deadzone.value); - } + const auto rc = vr::VRInput()->GetDigitalActionData(actionHandle, + &out, sizeof(vr::InputDigitalActionData_t), + vr::k_ulInvalidInputValueHandle); - if(vr_joystick_axis_exponent.value >= 0) - { - v = powf(v, vr_joystick_axis_exponent.value); - } + if(rc != vr::EVRInputError::VRInputError_None) + { + Con_Printf( + "Failed to read Steam VR digital action data, rc = %d", + (int)rc); + } - return sign * v; -} + return out; + }; -void DoKey(vr_controller* controller, vr::EVRButtonId vrButton, int quakeKey) -{ - bool wasDown = (controller->lastState.ulButtonPressed & - vr::ButtonMaskFromId(vrButton)) != 0; - bool isDown = (controller->state.ulButtonPressed & - vr::ButtonMaskFromId(vrButton)) != 0; - if(isDown != wasDown) - { - Key_Event(quakeKey, isDown); - } -} + const auto inpLocomotion = readAnalogAction(vrahLocomotion); + const auto inpTurn = readAnalogAction(vrahTurn); + const auto inpFire = readDigitalAction(vrahFire); + const auto inpJump = readDigitalAction(vrahJump); + const auto inpPrevWeapon = readDigitalAction(vrahPrevWeapon); + const auto inpNextWeapon = readDigitalAction(vrahNextWeapon); + const auto inpEscape = readDigitalAction(vrahEscape); + const auto inpSpeed = readDigitalAction(vrahSpeed); -void DoTrigger(vr_controller* controller, int quakeKey) -{ - if(axisTrigger != -1) - { - bool triggerWasDown = controller->lastState.rAxis[axisTrigger].x > 0.5f; - bool triggerDown = controller->state.rAxis[axisTrigger].x > 0.5f; - if(triggerDown != triggerWasDown) - { - Key_Event(quakeKey, triggerDown); - } - } -} + const auto isRisingEdge = [](const vr::InputDigitalActionData_t& data) { + return data.bState && data.bChanged; + }; -void DoAxis(vr_controller* controller, int axis, int quakeKeyNeg, - int quakeKeyPos, double deadzoneExtra) -{ - float lastVal = GetAxis(&controller->lastState, axis, deadzoneExtra); - float val = GetAxis(&controller->state, axis, deadzoneExtra); + const bool mustFire = inpFire.bState; + + const bool isRoomscaleJump = + vr_roomscale_jump.value && + headVelocity.v[1] > vr_roomscale_jump_threshold.value && + headPos.v[1] > vr_height_calibration.value; - bool posWasDown = lastVal > 0.0f; - bool posDown = val > 0.0f; - if(posDown != posWasDown) + // TODO VR: make nice `Menu` class with declarative syntax + const bool mustJump = isRisingEdge(inpJump) || isRoomscaleJump; + const bool mustPrevWeapon = isRisingEdge(inpPrevWeapon); + const bool mustNextWeapon = isRisingEdge(inpNextWeapon); + const bool mustEscape = isRisingEdge(inpEscape); + const bool mustSpeed = inpSpeed.bState; + + in_speed.state = mustSpeed; + + if(key_dest == key_menu) { - Key_Event(quakeKeyPos, posDown); - } + Key_Event(K_ENTER, mustJump); + Key_Event(K_ESCAPE, mustEscape); + Key_Event(K_LEFTARROW, mustPrevWeapon); + Key_Event(K_RIGHTARROW, mustNextWeapon); + + const auto doAxis = [&](const int quakeKeyNeg, const int quakeKeyPos) { + const float lastVal = inpLocomotion.y - inpLocomotion.deltaY; + const float val = inpLocomotion.y; + + const bool posWasDown = lastVal > 0.0f; + const bool posDown = val > 0.0f; + if(posDown != posWasDown) + { + Key_Event(quakeKeyNeg, posDown); + } + + const bool negWasDown = lastVal < 0.0f; + const bool negDown = val < 0.0f; + if(negDown != negWasDown) + { + Key_Event(quakeKeyPos, negDown); + } + }; - bool negWasDown = lastVal < 0.0f; - bool negDown = val < 0.0f; - if(negDown != negWasDown) + doAxis(K_UPARROW, K_DOWNARROW); + } + else { - Key_Event(quakeKeyNeg, negDown); + Key_Event(K_MOUSE1, mustFire); + Key_Event(K_SPACE, mustJump); + Key_Event(K_ESCAPE, mustEscape); + Key_Event('3', mustPrevWeapon); + Key_Event('1', mustNextWeapon); } + + return VR_GetInputAxes(inpLocomotion, inpTurn); } void VR_Move(usercmd_t* cmd) @@ -1891,186 +1998,111 @@ void VR_Move(usercmd_t* cmd) return; } - // TODO VR: repetition of ofs calculation - // TODO VR: adj unused? could be used to find position of muzzle - // - /* - vec3_t adj; - _VectorCopy(cl.handpos[1], adj); - - vec3_t ofs = {vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON].value, - vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON + 1].value, - vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON + 2].value + - vr_gunmodely.value}; - - vec3_t fwd2, right, up; - AngleVectors(cl.handrot[1], fwd2, right, up); - fwd2[0] *= vr_gunmodelscale.value * ofs[2]; - fwd2[1] *= vr_gunmodelscale.value * ofs[2]; - fwd2[2] *= vr_gunmodelscale.value * ofs[2]; - VectorAdd(adj, fwd2, adj); - */ - - // TODO VR: not needed anymore, changing QC - what to do? - // - // vec3_t adjhandpos; - // VectorCopy(cl.handpos[1], adjhandpos); - // adjhandpos[2] -= vr_projectilespawn_z_offset.value; - - // main hand: handpos, handrot, handvel, handvelmag + // VR: Main hand: `handpos`, `handrot`, `handvel`, `handvelmag`. VectorCopy(cl.handpos[1], cmd->handpos); VectorCopy(cl.handrot[1], cmd->handrot); VectorCopy(cl.handvel[1], cmd->handvel); cmd->handvelmag = cl.handvelmag[1]; - // off hand: offhandpos, offhandrot, offhandvel, offhandvelmag + // VR: Off hand: `offhandpos`, `offhandrot`, `offhandvel`, `offhandvelmag`. VectorCopy(cl.handpos[0], cmd->offhandpos); VectorCopy(cl.handrot[0], cmd->offhandrot); VectorCopy(cl.handvel[0], cmd->offhandvel); cmd->offhandvelmag = cl.handvelmag[0]; - // TODO VR: - /* - if(cmd->offhandvelmag > 4) { - Con_Printf("%.2f %.2f %.2f -> %.2f\n", - controllers[0].velocity[0], - controllers[0].velocity[1], - controllers[0].velocity[2], - cl.handvelmag[0]); - } - */ - - DoTrigger(&controllers[0], K_SPACE); - - // TODO VR: what to do with grips? - // DoKey(&controllers[0], vr::k_EButton_Grip, K_MWHEELUP); - // DoKey(&controllers[1], vr::k_EButton_Grip, K_MWHEELDOWN); + // VR: Buttons and instant controller actions. + // VR: Query state of controller axes. + const auto [fwdMove, sideMove, yawMove] = VR_DoInput(); - DoKey(&controllers[0], vr::k_EButton_SteamVR_Touchpad, K_SHIFT); - DoKey(&controllers[1], vr::k_EButton_SteamVR_Touchpad, K_ALT); + if(key_dest == key_menu) + { + return; + } - DoKey(&controllers[0], vr::k_EButton_ApplicationMenu, '1'); - DoKey(&controllers[0], vr::k_EButton_A, '2'); - DoKey(&controllers[1], vr::k_EButton_A, '3'); + vec3_t lfwd; + vec3_t lright; + vec3_t lup; + AngleVectors(cl.handrot[0], lfwd, lright, lup); - DoKey(&controllers[1], vr::k_EButton_ApplicationMenu, K_ESCAPE); - if(key_dest == key_menu) + if(vr_movement_mode.value == VrMovementMode::e_RAW_INPUT) { - for(int i = 0; i < 2; i++) - { - DoAxis(&controllers[i], 0, K_LEFTARROW, K_RIGHTARROW, - vr_joystick_axis_menu_deadzone_extra.value); - DoAxis(&controllers[i], 1, K_DOWNARROW, K_UPARROW, - vr_joystick_axis_menu_deadzone_extra.value); - DoTrigger(&controllers[i], K_ENTER); - } + cmd->forwardmove += cl_forwardspeed.value * fwdMove; + cmd->sidemove += cl_forwardspeed.value * sideMove; } else { - DoTrigger(&controllers[1], K_MOUSE1); - - vec3_t lfwd; + vec3_t playerYawOnly = {0, sv_player->v.v_viewangle[YAW], 0}; - vec3_t lright; + vec3_t vfwd; + vec3_t vright; + vec3_t vup; + AngleVectors(playerYawOnly, vfwd, vright, vup); - vec3_t lup; - AngleVectors(cl.handrot[0], lfwd, lright, lup); - - if(vr_movement_mode.value == VrMovementMode::e_RAW_INPUT) + // avoid gimbal by using up if we are point up/down + if(fabsf(lfwd[2]) > 0.8f) { - cmd->forwardmove += - cl_forwardspeed.value * GetAxis(&controllers[0].state, 1, 0.0); - - cmd->sidemove += - cl_forwardspeed.value * GetAxis(&controllers[0].state, 0, 0.0); - } - else - { - vec3_t vfwd; - - vec3_t vright; - - vec3_t vup; - vec3_t playerYawOnly = {0, sv_player->v.v_viewangle[YAW], 0}; - - AngleVectors(playerYawOnly, vfwd, vright, vup); - - // avoid gimbal by using up if we are point up/down - if(fabsf(lfwd[2]) > 0.8f) + if(lfwd[2] < -0.8f) { - if(lfwd[2] < -0.8f) - { - lfwd[0] *= -1; - lfwd[1] *= -1; - lfwd[2] *= -1; - } - else - { - lup[0] *= -1; - lup[1] *= -1; - lup[2] *= -1; - } - - VectorSwap(lup, lfwd); + lfwd[0] *= -1; + lfwd[1] *= -1; + lfwd[2] *= -1; } - - // Scale up directions so tilting doesn't affect speed - float fac = 1.0f / lup[2]; - for(int i = 0; i < 3; i++) + else { - lfwd[i] *= fac; - lright[i] *= fac; + lup[0] *= -1; + lup[1] *= -1; + lup[2] *= -1; } - vec3_t move = {0, 0, 0}; - VectorMA(move, GetAxis(&controllers[0].state, 1, 0.0), lfwd, move); - VectorMA( - move, GetAxis(&controllers[0].state, 0, 0.0), lright, move); - - float fwd = DotProduct(move, vfwd); - float right = DotProduct(move, vright); - - // Quake run doesn't affect the value of cl_sidespeed.value, so - // just use forward speed here for consistency - cmd->forwardmove += cl_forwardspeed.value * fwd; - cmd->sidemove += cl_forwardspeed.value * right; + VectorSwap(lup, lfwd); } - AngleVectors(cl.handrot[0], lfwd, lright, lup); - cmd->upmove += - cl_upspeed.value * GetAxis(&controllers[0].state, 1, 0.0) * lfwd[2]; - - if(cl_forwardspeed.value > 200 && cl_movespeedkey.value) - { - cmd->forwardmove /= cl_movespeedkey.value; - } - if((cl_forwardspeed.value > 200) ^ (in_speed.state & 1)) + // Scale up directions so tilting doesn't affect speed + float fac = 1.0f / lup[2]; + for(int i = 0; i < 3; i++) { - cmd->forwardmove *= cl_movespeedkey.value; - cmd->sidemove *= cl_movespeedkey.value; - cmd->upmove *= cl_movespeedkey.value; + lfwd[i] *= fac; + lright[i] *= fac; } - if(vr_enable_joystick_turn.value == 1) - { - const float yawMove = GetAxis(&controllers[1].state, 0, 0.0); + vec3_t move = {0, 0, 0}; + VectorMA(move, fwdMove, lfwd, move); + VectorMA(move, sideMove, lright, move); - if(vr_snap_turn.value != 0) - { - static int lastSnap = 0; - int snap = yawMove > 0.0f ? 1 : yawMove < 0.0f ? -1 : 0; - if(snap != lastSnap) - { - vrYaw -= snap * vr_snap_turn.value; - lastSnap = snap; - } - } - else + const float fwd = DotProduct(move, vfwd); + const float right = DotProduct(move, vright); + + // Quake run doesn't affect the value of cl_sidespeed.value, so + // just use forward speed here for consistency + cmd->forwardmove += cl_forwardspeed.value * fwd; + cmd->sidemove += cl_forwardspeed.value * right; + } + + AngleVectors(cl.handrot[0], lfwd, lright, lup); + cmd->upmove += cl_upspeed.value * fwdMove * lfwd[2]; + + if((in_speed.state & 1) ^ (cl_alwaysrun.value == 0.0)) + { + cmd->forwardmove *= cl_movespeedkey.value; + cmd->sidemove *= cl_movespeedkey.value; + cmd->upmove *= cl_movespeedkey.value; + } + + if(vr_enable_joystick_turn.value == 1) + { + if(vr_snap_turn.value != 0) + { + static int lastSnap = 0; + int snap = yawMove > 0.0f ? 1 : yawMove < 0.0f ? -1 : 0; + if(snap != lastSnap) { - vrYaw -= (yawMove * host_frametime * 100.0f * - vr_joystick_yaw_multi.value) * - vr_turn_speed.value; + vrYaw -= snap * vr_snap_turn.value; + lastSnap = snap; } } + else + { + vrYaw -= (yawMove * host_frametime * 100.0f) * vr_turn_speed.value; + } } } diff --git a/Quake/vr.hpp b/Quake/vr.hpp index faa3014f..6a0938f4 100644 --- a/Quake/vr.hpp +++ b/Quake/vr.hpp @@ -80,7 +80,7 @@ void VR_AddOrientationToViewAngles(vec3_t angles); void VR_SetAngles(vec3_t angles); void VR_ResetOrientation(); void VR_SetMatrices(); -void VR_SetTrackingSpace(int n); +void VR_CalibrateHeight(); extern cvar_t vr_aimmode; extern cvar_t vr_crosshair_alpha; @@ -102,8 +102,6 @@ extern cvar_t vr_melee_threshold; extern cvar_t vr_menu_scale; extern cvar_t vr_movement_mode; extern cvar_t vr_msaa; -// TODO VR: consider restoring for custom QC? -// extern cvar_t vr_projectilespawn_z_offset; extern cvar_t vr_enable_joystick_turn; extern cvar_t vr_snap_turn; extern cvar_t vr_turn_speed; @@ -116,6 +114,13 @@ extern cvar_t vr_sbar_offset_z; extern cvar_t vr_sbar_offset_pitch; extern cvar_t vr_sbar_offset_yaw; extern cvar_t vr_sbar_offset_roll; +extern cvar_t vr_roomscale_jump; +extern cvar_t vr_height_calibration; +extern cvar_t vr_roomscale_jump_threshold; +extern cvar_t vr_menu_distance; +extern cvar_t vr_melee_dmg_multiplier; +extern cvar_t vr_melee_range_multiplier; +extern cvar_t vr_body_interactions; // TODO VR: not sure what this number should actually be... #define MAX_WEAPONS 20 diff --git a/Quake/vr_menu.cpp b/Quake/vr_menu.cpp index 4066cbfe..448199e9 100644 --- a/Quake/vr_menu.cpp +++ b/Quake/vr_menu.cpp @@ -41,9 +41,10 @@ static void VR_MenuPrintOptionValue(int cx, int cy, VRMenuOpt option) switch(option) { - case VRMenuOpt::VR_ENABLED: - M_DrawCheckbox(cx, cy, (int)vr_enabled.value); - break; + // TODO VR: + // case VRMenuOpt::VR_ENABLED: + // M_DrawCheckbox(cx, cy, (int)vr_enabled.value); + // break; case VRMenuOpt::VR_AIMMODE: switch((int)vr_aimmode.value) { @@ -167,9 +168,6 @@ static void VR_MenuPrintOptionValue(int cx, int cy, VRMenuOpt option) case VRMenuOpt::VR_GUNMODELSCALE: printAsStr(vr_gunmodelscale); break; case VRMenuOpt::VR_GUNMODELY: printAsStr(vr_gunmodely); break; case VRMenuOpt::VR_CROSSHAIRY: printAsStr(vr_crosshairy); break; - // TODO VR: consider restoring for custom QC? - // case VRMenuOpt::VR_PROJECTILESPAWN_Z_OFFSET: - // printAsStr(vr_projectilespawn_z_offset); break; case VRMenuOpt::VR_HUD_SCALE: printAsStr(vr_hud_scale); break; case VRMenuOpt::VR_MENU_SCALE: printAsStr(vr_menu_scale); break; case VRMenuOpt::VR_GUNYAW: printAsStr(vr_gunyaw); break; @@ -177,6 +175,7 @@ static void VR_MenuPrintOptionValue(int cx, int cy, VRMenuOpt option) case VRMenuOpt::VR_VIEWKICK: value_string = vr_viewkick.value == 0 ? "Off" : "On"; break; + case VRMenuOpt::VR_MENU_DISTANCE: printAsStr(vr_menu_distance); break; default: assert(false); break; } @@ -216,13 +215,14 @@ static void M_VR_KeyOption(int key, VRMenuOpt option) switch(option) { - case VRMenuOpt::VR_ENABLED: - // TODO VR: fix and restore - // Cvar_SetValue( "vr_enabled", ! (int)vr_enabled.value ); - // if ( (int)vr_enabled.value ) { - // VR_MenuPlaySound( "items/r_item2.wav", 0.5 ); - // } - break; + // TODO VR: + // case VRMenuOpt::VR_ENABLED: + // TODO VR: fix and restore + // Cvar_SetValue( "vr_enabled", ! (int)vr_enabled.value ); + // if ( (int)vr_enabled.value ) { + // VR_MenuPlaySound( "items/r_item2.wav", 0.5 ); + // } + // break; case VRMenuOpt::VR_AIMMODE: intValue = (int)vr_aimmode.value; intValue = CLAMP(aimmode[0], isLeft ? intValue - 1 : intValue + 1, @@ -283,9 +283,6 @@ static void M_VR_KeyOption(int key, VRMenuOpt option) case VRMenuOpt::VR_CROSSHAIRY: adjustF(vr_crosshairy, 0.05f, -10.0f, 10.f); break; - // TODO VR: consider restoring for custom QC? - // case VRMenuOpt::VR_PROJECTILESPAWN_Z_OFFSET: - // adjustF(vr_projectilespawn_z_offset, 0.5f, -24.0f, 24.f); break; case VRMenuOpt::VR_HUD_SCALE: adjustF(vr_hud_scale, 0.005f, 0.01f, 0.1f); break; @@ -300,6 +297,9 @@ static void M_VR_KeyOption(int key, VRMenuOpt option) break; case VRMenuOpt::VR_SBAR_MODE: adjustI(vr_sbar_mode, 1, 0, 1); break; case VRMenuOpt::VR_VIEWKICK: adjustI(vr_viewkick, 1, 0, 1); break; + case VRMenuOpt::VR_MENU_DISTANCE: + adjustI(vr_menu_distance, 1, 24, 256); + break; default: assert(false); break; } @@ -372,15 +372,19 @@ void M_VR_Draw() int idx = 0; static const auto adjustedLabels = quake::util::makeAdjustedMenuLabels( - "VR Enabled", "Aim Mode", "Deadzone", "Crosshair", "Crosshair Depth", + // TODO VR: + // "VR Enabled", + + + "Aim Mode", "Deadzone", "Crosshair", "Crosshair Depth", "Crosshair Size", "Crosshair Alpha", "World Scale", "Movement mode", "Enable Joystick Turn", "Turn", "Turn Speed", "MSAA", "Gun Angle", "Floor Offset", "Gun Model Pitch", "Gun Model Scale", "Gun Model Z Offset", "Crosshair Z Offset", // TODO VR: consider restoring for custom QC? // "Projectile Spawn Z", - "HUD Scale", "Menu Scale", "Gun Yaw", "Gun Z Offset", - "Status Bar Mode", "Viewkick"); + "HUD Scale", "Menu Scale", "Gun Yaw", "Gun Z Offset", "Status Bar Mode", + "Viewkick", "Menu Distance"); static_assert(adjustedLabels.size() == (int)VRMenuOpt::VR_MAX); diff --git a/Quake/vr_menu.hpp b/Quake/vr_menu.hpp index a73bda8f..ca0fdba2 100644 --- a/Quake/vr_menu.hpp +++ b/Quake/vr_menu.hpp @@ -2,7 +2,8 @@ enum class VRMenuOpt { - VR_ENABLED, + // TODO VR: + // VR_ENABLED, VR_AIMMODE, VR_DEADZONE, @@ -22,14 +23,13 @@ enum class VRMenuOpt VR_GUNMODELSCALE, VR_GUNMODELY, VR_CROSSHAIRY, - // TODO VR: consider restoring for custom QC? - // VR_PROJECTILESPAWN_Z_OFFSET, VR_HUD_SCALE, VR_MENU_SCALE, VR_GUNYAW, VR_GUN_Z_OFFSET, VR_SBAR_MODE, VR_VIEWKICK, + VR_MENU_DISTANCE, VR_MAX }; diff --git a/Quake/vrgameplay_menu.cpp b/Quake/vrgameplay_menu.cpp index 6835facc..fdb217c8 100644 --- a/Quake/vrgameplay_menu.cpp +++ b/Quake/vrgameplay_menu.cpp @@ -33,9 +33,33 @@ static void VRGameplay_MenuPrintOptionValue( switch(option) { - case VRGameplayMenuOpt::e_Melee_Threshold: + case VRGameplayMenuOpt::e_MeleeThreshold: printAsStr(vr_melee_threshold); break; + case VRGameplayMenuOpt::e_RoomscaleJump: + M_Print(cx, cy, vr_roomscale_jump.value == 0 ? "Off" : "On"); + break; + case VRGameplayMenuOpt::e_RoomscaleJumpThreshold: + printAsStr(vr_roomscale_jump_threshold); + break; + case VRGameplayMenuOpt::e_CalibrateHeight: + printAsStr(vr_height_calibration); + break; + case VRGameplayMenuOpt::e_MeleeDmgMultiplier: + printAsStr(vr_melee_dmg_multiplier); + break; + case VRGameplayMenuOpt::e_MeleeRangeMultiplier: + printAsStr(vr_melee_range_multiplier); + break; + case VRGameplayMenuOpt::e_BodyInteractions: + M_Print(cx, cy, vr_body_interactions.value == 0 ? "Off" : "On"); + break; + case VRGameplayMenuOpt::e_ForwardSpeed: + printAsStr(cl_forwardspeed); + break; + case VRGameplayMenuOpt::e_SpeedBtnMultiplier: + printAsStr(cl_movespeedkey); + break; default: assert(false); break; } @@ -55,11 +79,40 @@ static void M_VRGameplay_KeyOption(int key, VRGameplayMenuOpt option) CLAMP(min, isLeft ? cvar.value - incr : cvar.value + incr, max)); }; + const auto adjustI = [&isLeft](const cvar_t& cvar, auto incr, auto min, + auto max) { + Cvar_SetValue(cvar.name, + (int)CLAMP( + min, isLeft ? cvar.value - incr : cvar.value + incr, max)); + }; + switch(option) { - case VRGameplayMenuOpt::e_Melee_Threshold: + case VRGameplayMenuOpt::e_MeleeThreshold: adjustF(vr_melee_threshold, 0.5f, 4.f, 18.f); break; + case VRGameplayMenuOpt::e_RoomscaleJump: + adjustI(vr_roomscale_jump, 1, 0, 1); + break; + case VRGameplayMenuOpt::e_RoomscaleJumpThreshold: + adjustF(vr_roomscale_jump_threshold, 0.05f, 0.05f, 3.f); + break; + case VRGameplayMenuOpt::e_CalibrateHeight: VR_CalibrateHeight(); break; + case VRGameplayMenuOpt::e_MeleeDmgMultiplier: + adjustF(vr_melee_dmg_multiplier, 0.25f, 0.25f, 15.f); + break; + case VRGameplayMenuOpt::e_MeleeRangeMultiplier: + adjustF(vr_melee_range_multiplier, 0.25f, 0.25f, 15.f); + break; + case VRGameplayMenuOpt::e_BodyInteractions: + adjustI(vr_body_interactions, 1, 0, 1); + break; + case VRGameplayMenuOpt::e_ForwardSpeed: + adjustI(cl_forwardspeed, 25, 100, 400); + break; + case VRGameplayMenuOpt::e_SpeedBtnMultiplier: + adjustF(cl_movespeedkey, 0.05f, 0.1f, 1.f); + break; default: assert(false); break; } } @@ -130,8 +183,10 @@ void M_VRGameplay_Draw() y += 16; int idx = 0; - static const auto adjustedLabels = - quake::util::makeAdjustedMenuLabels("Melee Threshold"); + static const auto adjustedLabels = quake::util::makeAdjustedMenuLabels( + "Melee Threshold", "Roomscale Jump", "Roomscale Jump Threshold", + "Calibrate Height", "Melee Damage Multiplier", "Melee Range Multiplier", + "Body-Item Interactions", "Movement Speed", "Speed Button Multiplier"); static_assert(adjustedLabels.size() == (int)VRGameplayMenuOpt::k_Max); diff --git a/Quake/vrgameplay_menu.hpp b/Quake/vrgameplay_menu.hpp index e91827e3..199c051a 100644 --- a/Quake/vrgameplay_menu.hpp +++ b/Quake/vrgameplay_menu.hpp @@ -2,7 +2,15 @@ enum class VRGameplayMenuOpt { - e_Melee_Threshold, + e_MeleeThreshold, + e_RoomscaleJump, + e_RoomscaleJumpThreshold, + e_CalibrateHeight, + e_MeleeDmgMultiplier, + e_MeleeRangeMultiplier, + e_BodyInteractions, + e_ForwardSpeed, + e_SpeedBtnMultiplier, k_Max }; diff --git a/Quake/world.cpp b/Quake/world.cpp index 4d0ffe10..49d0b437 100644 --- a/Quake/world.cpp +++ b/Quake/world.cpp @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "util.hpp" extern cvar_t vr_enabled; +extern cvar_t vr_body_interactions; /* @@ -334,7 +335,6 @@ static void SV_AreaTriggerEdicts(edict_t* ent, areanode_t* node, edict_t** list, const bool canBeTouched = (target->v.touch || target->v.handtouch) && target->v.solid == SOLID_TRIGGER; - // TODO VR: re-enabled check, testing... (remove comment if it works) if(!canBeTouched || !quake::util::boxIntersection(ent->v.absmin, ent->v.absmax, target->v.absmin, target->v.absmax)) @@ -398,8 +398,8 @@ void SV_TouchLinks(edict_t* ent) continue; } - const bool canBeTouched = - target->v.touch && target->v.solid == SOLID_TRIGGER; + const bool canBeTouched = (target->v.touch || target->v.handtouch) && + target->v.solid == SOLID_TRIGGER; if(!canBeTouched || !quake::util::boxIntersection(ent->v.absmin, ent->v.absmax, @@ -415,7 +415,15 @@ void SV_TouchLinks(edict_t* ent) pr_global_struct->other = EDICT_TO_PROG(ent); pr_global_struct->time = sv.time; - PR_ExecuteProgram(target->v.touch); + if(target->v.touch) + { + PR_ExecuteProgram(target->v.touch); + } + + if(target->v.handtouch && vr_body_interactions.value) + { + PR_ExecuteProgram(target->v.handtouch); + } pr_global_struct->self = old_self; pr_global_struct->other = old_other; @@ -473,7 +481,7 @@ void SV_TouchLinks(edict_t* ent) pr_global_struct->other = EDICT_TO_PROG(ent); pr_global_struct->time = sv.time; - // TODO VR: this is for ammo and slipgates, I think... + // VR: This is for things like ammo pickups and slipgates. PR_ExecuteProgram(target->v.handtouch); pr_global_struct->self = old_self; @@ -927,7 +935,6 @@ qboolean SV_RecursiveHullCheck(hull_t* hull, int num, float p1f, float p2f, return false; } - /* ================== SV_ClipMoveToEntity @@ -975,48 +982,6 @@ trace_t SV_ClipMoveToEntity( return trace; } -// TODO VR: -trace_t SV_ClipMoveToEntity2( - edict_t* ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end) -{ - vec3_t offset; - vec3_t start_l; - vec3_t end_l; - - // fill in a default trace - trace_t trace; - memset(&trace, 0, sizeof(trace_t)); - trace.fraction = 1; - trace.allsolid = true; - VectorCopy(end, trace.endpos); - - // get the clipping hull - hull_t* hull = SV_HullForEntity(ent, mins, maxs, offset); - - VectorSubtract(start, offset, start_l); - VectorSubtract(end, offset, end_l); - - // trace a line through the apropriate clipping hull - // SV_RecursiveHullCheck(cl.worldmodel->hulls, 0, 0, 1, start, end, - // &clip.trace); - SV_RecursiveHullCheck( - hull, hull->firstclipnode, 0, 1, start_l, end_l, &trace); - - // fix trace up by the offset - if(trace.fraction != 1) - { - VectorAdd(trace.endpos, offset, trace.endpos); - } - - // did we clip the move? - if(trace.fraction < 1 || trace.startsolid) - { - trace.ent = ent; - } - - return trace; -} - //=========================================================================== /* @@ -1213,35 +1178,3 @@ trace_t SV_Move(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, return clip.trace; } - -// TODO VR: -trace_t SV_Move2(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, - edict_t* passedict) -{ - moveclip_t clip; - memset(&clip, 0, sizeof(moveclip_t)); - - // clip to world - // SV_RecursiveHullCheck(cl.worldmodel->hulls, 0, 0, 1, start, end, - // &clip.trace); - clip.trace = SV_ClipMoveToEntity2(sv.edicts, start, mins, maxs, end); - - clip.start = start; - clip.end = end; - clip.mins = mins; - clip.maxs = maxs; - clip.type = type; - clip.passedict = passedict; - - VectorCopy(mins, clip.mins2); - VectorCopy(maxs, clip.maxs2); - - // create the bounding box of the entire move - SV_MoveBounds( - start, clip.mins2, clip.maxs2, end, clip.boxmins, clip.boxmaxs); - - // clip to entities - SV_ClipToLinks(sv_areanodes, &clip); - - return clip.trace; -} diff --git a/README.md b/README.md index ef0c98d6..6286224d 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,13 @@ ## Main Features * Smooth locomotion -* Fully room-scale +* Fully room-scale *(including jumping)* * Hand tracking * Weapon models with hands and ironsights * VR interactions *(melee, pick up items, press buttons)* * Rebalanced for VR *(hitboxes, difficulty, projectile speed)* +* Steam VR Input API support *(can rebind inputs in Steam VR settings)* +* Many customization options *(e.g. melee damage/range, hand/body item pickup, and more)* ## Disclaimer @@ -69,10 +71,7 @@ * `vr_world_scale` - 1: Size of the player compared to normal quake character. * `vr_floor_offset` - -16: height (in Quake units) of the player's origin off the ground (probably not useful to change) * `vr_snap_turn` - 0: If 0, smooth turning, otherwise the size in degrees of each snap turn. -* `vr_joystick_yaw_multi` - 1.0: Adjusts turn speed when using VR controllers, suggested 2.0-3.0 -* `vr_joystick_axis_deadzone` - 0.25: Deadzone value for joysticks, suggested 0.1-0.2 -* `vr_joystick_axis_exponent` - 1.0: Exponent for axis input, suggested 2.0. Larger numbers increase the 'low speed' portion of the movement range, numbers under 1.0: decrease it, 1.0 is linear response. 2.0 makes it easier to make fine adjustments at low speed -* `vr_joystick_deadzone_trunc` - 1 If enabled (value 1) then minimum movement speed will be given by the deadzone value, so it will be impossible to move at speeds below the deadzone value. When disabled (value 0) movement speed will ramp up from complete standstill to maximum speed while above the deadzone, so any speed is possible. Suggest setting to 0 to disable +* `vr_turn_speed` - 1.0: Adjusts turn speed when using VR controllers, suggested 2.0-3.0 ### Weapon Offsets diff --git a/ReleaseFiles/Id1/config.cfg b/ReleaseFiles/Id1/config.cfg new file mode 100644 index 00000000..5bca8ef0 --- /dev/null +++ b/ReleaseFiles/Id1/config.cfg @@ -0,0 +1,334 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 12" +bind "4" "impulse 4" +bind "5" "impulse 5" +bind "6" "impulse 6" +bind "7" "impulse 7" +bind "8" "impulse 8" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+forward" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "0" +_cl_name "player" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "0" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "400" +cl_maxpitch "90" +cl_minpitch "-90" +cl_movespeedkey "0.5" +contrast "1" +crosshair "0" +external_ents "1" +fov_adapt "1" +gamma "1" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_novis "0" +r_oldwater "1" +r_particles "1" +r_quadparticles "1" +r_scale "1" +r_shadows "0" +r_viewmodel_quake "0" +r_wateralpha "1" +saved1 "0" +saved2 "0" +saved3 "0" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1" +scr_conspeed "500" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1" +scr_sbaralpha "0.7" +scr_sbarscale "1" +sensitivity "2.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "0" +vid_height "900" +vid_refreshrate "144" +vid_vsync "0" +vid_width "1600" +viewsize "100" +volume "0.8" +vr_aimmode "7" +vr_body_interactions "0" +vr_crosshair "0" +vr_crosshair_alpha "0.65" +vr_crosshair_depth "0" +vr_crosshair_size "2" +vr_crosshairy "0" +vr_deadzone "10" +vr_enable_joystick_turn "1" +vr_floor_offset "-21" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_height_calibration "1.576243" +vr_hud_scale "0.025" +vr_melee_dmg_multiplier "1.0" +vr_melee_range_multiplier "1.0" +vr_melee_threshold "7" +vr_menu_distance "76" +vr_menu_scale "0.2" +vr_movement_mode "1" +vr_msaa "9" +vr_roomscale_jump "1" +vr_roomscale_jump_threshold "1" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_snap_turn "0" +vr_turn_speed "3.25" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "-1" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_pitch_01 "0" +vr_wofs_pitch_02 "0" +vr_wofs_pitch_03 "0.0" +vr_wofs_pitch_04 "0.0" +vr_wofs_pitch_05 "0.0" +vr_wofs_pitch_06 "0.0" +vr_wofs_pitch_07 "0.0" +vr_wofs_pitch_08 "0.0" +vr_wofs_pitch_09 "0.0" +vr_wofs_pitch_10 "0.0" +vr_wofs_pitch_11 "0.0" +vr_wofs_pitch_12 "0.0" +vr_wofs_pitch_13 "0.0" +vr_wofs_pitch_14 "0.0" +vr_wofs_pitch_15 "0.0" +vr_wofs_pitch_16 "0.0" +vr_wofs_pitch_17 "-4" +vr_wofs_pitch_18 "0.0" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_roll_01 "-8" +vr_wofs_roll_02 "-6.5" +vr_wofs_roll_03 "-8" +vr_wofs_roll_04 "-5" +vr_wofs_roll_05 "-6.5" +vr_wofs_roll_06 "-8.5" +vr_wofs_roll_07 "-4.5" +vr_wofs_roll_08 "-7" +vr_wofs_roll_09 "0.0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-19.5" +vr_wofs_roll_18 "0.0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.46" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.33" +vr_wofs_scale_10 "0.33" +vr_wofs_scale_11 "0.5" +vr_wofs_scale_12 "0.5" +vr_wofs_scale_13 "0.5" +vr_wofs_scale_14 "0.5" +vr_wofs_scale_15 "0.5" +vr_wofs_scale_16 "0.5" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.5" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_x_01 "2.8" +vr_wofs_x_02 "4.6" +vr_wofs_x_03 "8.399998" +vr_wofs_x_04 "4.9" +vr_wofs_x_05 "4.8" +vr_wofs_x_06 "13.300018" +vr_wofs_x_07 "11.700012" +vr_wofs_x_08 "5.6" +vr_wofs_x_09 "-4" +vr_wofs_x_10 "65" +vr_wofs_x_11 "10" +vr_wofs_x_12 "-5" +vr_wofs_x_13 "0" +vr_wofs_x_14 "10" +vr_wofs_x_15 "10" +vr_wofs_x_16 "3" +vr_wofs_x_17 "2.3" +vr_wofs_x_18 "1.5" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_y_01 "2.2" +vr_wofs_y_02 "1.9" +vr_wofs_y_03 "1.65" +vr_wofs_y_04 "2.9" +vr_wofs_y_05 "4.5" +vr_wofs_y_06 "2.3" +vr_wofs_y_07 "7.2" +vr_wofs_y_08 "6.1" +vr_wofs_y_09 "18" +vr_wofs_y_10 "3.7" +vr_wofs_y_11 "1.5" +vr_wofs_y_12 "3" +vr_wofs_y_13 "3" +vr_wofs_y_14 "1.5" +vr_wofs_y_15 "7" +vr_wofs_y_16 "4" +vr_wofs_y_17 "2.4" +vr_wofs_y_18 "1" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_yaw_01 "-2.5" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "0.0" +vr_wofs_yaw_10 "0.0" +vr_wofs_yaw_11 "0.0" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.0" +vr_wofs_yaw_15 "0.0" +vr_wofs_yaw_16 "0.0" +vr_wofs_yaw_17 "-1" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "0.999979" +vr_wofs_z_03 "-1.900011" +vr_wofs_z_04 "0.399975" +vr_wofs_z_05 "2.1" +vr_wofs_z_06 "1.499972" +vr_wofs_z_07 "4.699956" +vr_wofs_z_08 "-0.7" +vr_wofs_z_09 "37" +vr_wofs_z_10 "17" +vr_wofs_z_11 "13" +vr_wofs_z_12 "15" +vr_wofs_z_13 "19" +vr_wofs_z_14 "13" +vr_wofs_z_15 "19" +vr_wofs_z_16 "13" +vr_wofs_z_17 "-1.2" +vr_wofs_z_18 "10" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_world_scale "1.25" +vid_restart ++mlook diff --git a/ReleaseFiles/Id1/pak3.pak b/ReleaseFiles/Id1/pak3.pak new file mode 100644 index 00000000..218b5b0b Binary files /dev/null and b/ReleaseFiles/Id1/pak3.pak differ diff --git a/ReleaseFiles/actions.json b/ReleaseFiles/actions.json new file mode 100644 index 00000000..84fc7ade --- /dev/null +++ b/ReleaseFiles/actions.json @@ -0,0 +1,66 @@ +{ + "actions": [ + { + "name": "/actions/default/in/Locomotion", + "type": "vector2" + }, + { + "name": "/actions/default/in/Turn", + "type": "vector2" + }, + { + "name": "/actions/default/in/Fire", + "type": "boolean" + }, + { + "name": "/actions/default/in/Jump", + "type": "boolean" + }, + { + "name": "/actions/default/in/PrevWeapon", + "type": "boolean" + }, + { + "name": "/actions/default/in/NextWeapon", + "type": "boolean" + }, + { + "name": "/actions/default/in/Escape", + "type": "boolean" + }, + { + "name": "/actions/default/in/Speed", + "type": "boolean" + }, + { + "name": "/actions/default/out/Haptic", + "type": "vibration" + } + ], + "action_sets": [ + { + "name": "/actions/default", + "usage": "leftright" + } + ], + "default_bindings": [ + { + "controller_type": "knuckles", + "binding_url": "bindings_knuckles.json" + } + ], + "localization": [ + { + "language_tag": "en_US", + "/actions/default/in/Locomotion": "Locomotion", + "/actions/default/in/Turn": "Turn", + "/actions/default/in/Fire": "Fire", + "/actions/default/in/Jump": "Jump", + "/actions/default/in/PrevWeapon": "Previous Weapon", + "/actions/default/in/NextWeapon": "Next Weapon", + "/actions/default/in/Escape": "Escape", + "/actions/default/in/Speed": "Speed Modifier", + "/actions/default/out/Haptic": "Haptic" + } + ] +} diff --git a/ReleaseFiles/bindings_knuckles.json b/ReleaseFiles/bindings_knuckles.json new file mode 100644 index 00000000..2414aaf4 --- /dev/null +++ b/ReleaseFiles/bindings_knuckles.json @@ -0,0 +1,101 @@ +{ + "action_manifest_version" : 0, + "alias_info" : {}, + "bindings" : { + "/actions/default" : { + "chords" : [], + "haptics" : [ + { + "output" : "/actions/default/out/Haptic", + "path" : "/user/hand/left/output/haptic" + }, + { + "output" : "/actions/default/out/Haptic", + "path" : "/user/hand/right/output/haptic" + } + ], + "poses" : [], + "skeleton" : [], + "sources" : [ + { + "inputs" : { + "position" : { + "output" : "/actions/default/in/Locomotion" + } + }, + "mode" : "joystick", + "path" : "/user/hand/left/input/thumbstick" + }, + { + "inputs" : { + "position" : { + "output" : "/actions/default/in/Turn" + } + }, + "mode" : "joystick", + "path" : "/user/hand/right/input/thumbstick" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/Fire" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/trigger" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/Jump" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/a" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/NextWeapon" + } + }, + "mode" : "button", + "path" : "/user/hand/right/input/b" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/Escape" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/a" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/PrevWeapon" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/b" + }, + { + "inputs" : { + "click" : { + "output" : "/actions/default/in/speed" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/trigger" + } + ] + } + }, + "category" : "steamvr_input", + "controller_type" : "knuckles", + "description" : "The default binding for Valve Index controllers", + "name": "Default Index Controller Binding", + "options" : {}, + "simulated_actions" : [] +} diff --git a/Windows/VisualStudio/quakespasm-sdl2.vcproj b/Windows/VisualStudio/quakespasm-sdl2.vcproj deleted file mode 100644 index fa0abccc..00000000 --- a/Windows/VisualStudio/quakespasm-sdl2.vcproj +++ /dev/null @@ -1,908 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Windows/VisualStudio/quakespasm-sdl2.vcxproj b/Windows/VisualStudio/quakespasm-sdl2.vcxproj index df4aeb32..cdf79dfa 100644 --- a/Windows/VisualStudio/quakespasm-sdl2.vcxproj +++ b/Windows/VisualStudio/quakespasm-sdl2.vcxproj @@ -22,7 +22,7 @@ {AE77266F-0A23-4F08-A491-369DE664B273} quakespasm-sdl2 Win32Proj - 10.0.17763.0 + 10.0 @@ -38,7 +38,7 @@ Application - v142 + ClangCL NotSet true @@ -104,7 +104,7 @@ openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;wsock32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - ..\codecs\x86;..\SDL2\lib;F:\stuf\quakevr\Windows\OpenVR\lib\Win32;%(AdditionalLibraryDirectories) + ..\codecs\x86;..\SDL2\lib;C:\OHWorkspace\quakevr\Windows\OpenVR\lib\Win32;%(AdditionalLibraryDirectories) msvcrt.lib;%(IgnoreSpecificDefaultLibraries) true Windows @@ -127,6 +127,7 @@ copy "$(SolutionDir)\..\SDL2\lib\*.dll" "$(TargetDir)" Level3 ProgramDatabase CompileAsC + stdcpp17 openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;wsock32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) @@ -162,7 +163,7 @@ copy "$(SolutionDir)\..\SDL2\lib\*.dll" "$(TargetDir)" openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - F:\stuf\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories) + C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories) msvcrt.lib;%(IgnoreSpecificDefaultLibraries) true Console @@ -173,7 +174,7 @@ copy "$(SolutionDir)\..\SDL2\lib\*.dll" "$(TargetDir)" copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)" - F:\stuf\quakevr\make_pak.bat + C:\OHWorkspace\quakevr\make_pak.bat @@ -196,9 +197,9 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)" openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - F:\stuf\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories) + C:\OHWorkspace\openvr\lib\win64;..\codecs\x64;..\SDL2\lib64;%(AdditionalLibraryDirectories) true - Windows + Console true true MachineX64 @@ -375,4 +376,4 @@ copy "$(SolutionDir)\..\SDL2\lib64\*.dll" "$(TargetDir)" - + \ No newline at end of file diff --git a/Windows/VisualStudio/quakespasm.sln b/Windows/VisualStudio/quakespasm.sln index 683f8be8..dbcfe9f3 100644 --- a/Windows/VisualStudio/quakespasm.sln +++ b/Windows/VisualStudio/quakespasm.sln @@ -7,18 +7,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quakespasm-sdl2", "quakespa EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AE77266F-0A23-4F08-A491-369DE664B273}.Debug|Win32.ActiveCfg = Debug|Win32 - {AE77266F-0A23-4F08-A491-369DE664B273}.Debug|Win32.Build.0 = Debug|Win32 {AE77266F-0A23-4F08-A491-369DE664B273}.Debug|x64.ActiveCfg = Debug|x64 {AE77266F-0A23-4F08-A491-369DE664B273}.Debug|x64.Build.0 = Debug|x64 - {AE77266F-0A23-4F08-A491-369DE664B273}.Release|Win32.ActiveCfg = Release|Win32 - {AE77266F-0A23-4F08-A491-369DE664B273}.Release|Win32.Build.0 = Release|Win32 {AE77266F-0A23-4F08-A491-369DE664B273}.Release|x64.ActiveCfg = Release|x64 {AE77266F-0A23-4F08-A491-369DE664B273}.Release|x64.Build.0 = Release|x64 EndGlobalSection diff --git a/Windows/VisualStudio/quakespasm.vcproj b/Windows/VisualStudio/quakespasm.vcproj deleted file mode 100644 index 8d86aea2..00000000 --- a/Windows/VisualStudio/quakespasm.vcproj +++ /dev/null @@ -1,912 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Windows/VisualStudio/quakespasm.vcxproj b/Windows/VisualStudio/quakespasm.vcxproj deleted file mode 100644 index 9c64c9e8..00000000 --- a/Windows/VisualStudio/quakespasm.vcxproj +++ /dev/null @@ -1,357 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {C0F747A3-D796-4EC0-BF2A-53722CAA3B6A} - quakespasm - Win32Proj - 10.0.17763.0 - - - - Application - v142 - NotSet - true - - - Application - v142 - NotSet - - - Application - v142 - NotSet - true - - - Application - v142 - NotSet - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>15.0.28127.55 - - - $(SolutionDir)Build-$(ProjectName)\x86\$(Configuration)\ - Build-$(ProjectName)\x86\$(Configuration)\ - true - - - $(SolutionDir)Build-$(ProjectName)\x86\$(Configuration)\ - Build-$(ProjectName)\x86\$(Configuration)\ - false - - - $(SolutionDir)Build-$(ProjectName)\$(Platform)\$(Configuration)\ - Build-$(ProjectName)\$(Platform)\$(Configuration)\ - true - - - $(SolutionDir)Build-$(ProjectName)\$(Platform)\$(Configuration)\ - Build-$(ProjectName)\$(Platform)\$(Configuration)\ - false - - - - Disabled - ..\SDL\include;..\codecs\include;..\misc\include;..\..\Quake;..\..\..\openvr\lib\$(platform);..\..\..\openvr\headers\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - EditAndContinue - CompileAsC - - - openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;wsock32.lib;opengl32.lib;winmm.lib;SDL.lib;SDLmain.lib;%(AdditionalDependencies) - ..\codecs\x86;..\SDL\lib;..\..\..\openvr\lib\$(platform);F:\stuf\quakevr\Windows\OpenVR\lib\Win32;%(AdditionalLibraryDirectories) - msvcrt.lib;%(IgnoreSpecificDefaultLibraries) - true - Windows - MachineX86 - - - copy "$(SolutionDir)\..\codecs\x86\*.dll" "$(TargetDir)" -copy "$(SolutionDir)\..\SDL\lib\*.dll" "$(TargetDir)" - - - - - MaxSpeed - true - ..\SDL\include;..\codecs\include;..\misc\include;..\..\Quake;..\..\..\openvr\lib\$(platform);..\..\..\openvr\headers\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - CompileAsC - - - openvr_api.lib;libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;wsock32.lib;opengl32.lib;winmm.lib;SDL.lib;SDLmain.lib;%(AdditionalDependencies) - ..\codecs\x86;..\SDL\lib;..\..\..\openvr\lib\$(platform);%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - copy "$(SolutionDir)\..\codecs\x86\*.dll" "$(TargetDir)" -copy "$(SolutionDir)\..\SDL\lib\*.dll" "$(TargetDir)" - - - - - X64 - - - Disabled - ..\SDL\include;..\codecs\include;..\misc\include;..\..\Quake;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - ProgramDatabase - CompileAsC - - - libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL.lib;SDLmain.lib;openvr_api.lib;%(AdditionalDependencies) - ..\codecs\x64;..\SDL\lib64;..\OpenVR\openvr_api.lib;%(AdditionalLibraryDirectories) - msvcrt.lib;%(IgnoreSpecificDefaultLibraries) - true - Windows - MachineX64 - - - copy "$(SolutionDir)\..\codecs\x64\*.dll" "$(TargetDir)" -copy "$(SolutionDir)\..\SDL\lib64\*.dll" "$(TargetDir)" - - - - - X64 - - - MaxSpeed - true - ..\SDL\include;..\codecs\include;..\misc\include;..\..\Quake;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USE_WINSOCK2;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;USE_CODEC_MP3;USE_CODEC_VORBIS;USE_CODEC_WAVE;USE_CODEC_FLAC;USE_CODEC_OPUS;USE_CODEC_MIKMOD;USE_CODEC_UMX;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - CompileAsC - - - libvorbisfile.lib;libvorbis.lib;libopusfile.lib;libopus.lib;libFLAC.lib;libogg.lib;libmad.lib;libmikmod.lib;ws2_32.lib;opengl32.lib;winmm.lib;SDL.lib;%(AdditionalDependencies) - ..\codecs\x64;..\SDL\lib64;%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX64 - - - copy "$(SolutionDir)\..\codecs\x64\*.dll" "$(TargetDir)" -copy "$(SolutionDir)\..\SDL\lib64\*.dll" "$(TargetDir)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CompileAsCpp - CompileAsCpp - CompileAsCpp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Windows/VisualStudio/quakespasm.vcxproj.filters b/Windows/VisualStudio/quakespasm.vcxproj.filters deleted file mode 100644 index 904940be..00000000 --- a/Windows/VisualStudio/quakespasm.vcxproj.filters +++ /dev/null @@ -1,452 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/make_pak.bat b/make_pak.bat index a4215c08..55a0d991 100644 --- a/make_pak.bat +++ b/make_pak.bat @@ -1,5 +1,6 @@ -F: -cd F:\stuf\quakevr\QC +C: +cd C:\OHWorkspace\quakevr\QC .\frikqcc.exe -summary -nolog -nopause -Ot -Oi -Op -Oc -Od -Os -Ol -On -Of -Ou -Oo -Or -Oa +warn 2 -cos pak.exe -c -v pak3.pak progs.dat -cp F:\stuf\quakevr\QC\pak3.pak F:\stuf\quakevr\Windows\VisualStudio\Build-quakespasm-sdl2\x64\Debug\Id1 +xcopy /y C:\OHWorkspace\quakevr\QC\pak3.pak C:\OHWorkspace\quakevr\Windows\VisualStudio\Build-quakespasm-sdl2\x64\Debug\Id1 +xcopy /y C:\OHWorkspace\quakevr\QC\pak3.pak C:\OHWorkspace\quakevr\ReleaseFiles\Id1 diff --git a/old/config.cfg b/old/config1.cfg similarity index 100% rename from old/config.cfg rename to old/config1.cfg diff --git a/old/config3.cfg b/old/config3.cfg new file mode 100644 index 00000000..cdb5372b --- /dev/null +++ b/old/config3.cfg @@ -0,0 +1,331 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 3" +bind "4" "impulse 4" +bind "5" "impulse 5" +bind "6" "impulse 6" +bind "7" "impulse 7" +bind "8" "impulse 8" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+forward" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "0" +_cl_name "player" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "0" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "200" +cl_maxpitch "90" +cl_minpitch "-90" +contrast "1" +crosshair "0" +external_ents "1" +fov_adapt "1" +gamma "1" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_novis "0" +r_oldwater "1" +r_particles "1" +r_quadparticles "1" +r_scale "1" +r_shadows "0" +r_viewmodel_quake "0" +r_wateralpha "1" +saved1 "0" +saved2 "0" +saved3 "0" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1" +scr_conspeed "500" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1" +scr_sbaralpha "0.7" +scr_sbarscale "1" +sensitivity "2.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "1" +vid_height "1080" +vid_refreshrate "144" +vid_vsync "0" +vid_width "1920" +viewsize "100" +volume "0.8" +vr_aimmode "7" +vr_crosshair "0" +vr_crosshair_alpha "0.65" +vr_crosshair_depth "0" +vr_crosshair_size "2" +vr_crosshairy "0" +vr_deadzone "10" +vr_enable_joystick_turn "1" +vr_floor_offset "-21" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_hud_scale "0.025" +vr_joystick_axis_deadzone "0.25" +vr_joystick_axis_exponent "1.0" +vr_joystick_axis_menu_deadzone_extra "0.25" +vr_joystick_deadzone_trunc "1" +vr_joystick_yaw_multi "1.0" +vr_melee_threshold "7" +vr_menu_scale "0.2" +vr_movement_mode "1" +vr_msaa "9" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_snap_turn "0" +vr_turn_speed "3.25" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "-1" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_pitch_01 "0" +vr_wofs_pitch_02 "0" +vr_wofs_pitch_03 "0.0" +vr_wofs_pitch_04 "0.0" +vr_wofs_pitch_05 "0.0" +vr_wofs_pitch_06 "0.0" +vr_wofs_pitch_07 "0.0" +vr_wofs_pitch_08 "0.0" +vr_wofs_pitch_09 "0.0" +vr_wofs_pitch_10 "0.0" +vr_wofs_pitch_11 "0.0" +vr_wofs_pitch_12 "0.0" +vr_wofs_pitch_13 "0.0" +vr_wofs_pitch_14 "0.0" +vr_wofs_pitch_15 "0.0" +vr_wofs_pitch_16 "0.0" +vr_wofs_pitch_17 "-4" +vr_wofs_pitch_18 "0.0" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_roll_01 "-8" +vr_wofs_roll_02 "-6.5" +vr_wofs_roll_03 "-8" +vr_wofs_roll_04 "-5" +vr_wofs_roll_05 "-6.5" +vr_wofs_roll_06 "-8.5" +vr_wofs_roll_07 "-4.5" +vr_wofs_roll_08 "-7" +vr_wofs_roll_09 "0.0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-19.5" +vr_wofs_roll_18 "0.0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.46" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.33" +vr_wofs_scale_10 "0.33" +vr_wofs_scale_11 "0.5" +vr_wofs_scale_12 "0.5" +vr_wofs_scale_13 "0.5" +vr_wofs_scale_14 "0.5" +vr_wofs_scale_15 "0.5" +vr_wofs_scale_16 "0.5" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.5" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_x_01 "2.8" +vr_wofs_x_02 "4.6" +vr_wofs_x_03 "8.399998" +vr_wofs_x_04 "4.9" +vr_wofs_x_05 "4.8" +vr_wofs_x_06 "13.300018" +vr_wofs_x_07 "11.700012" +vr_wofs_x_08 "5.6" +vr_wofs_x_09 "-4" +vr_wofs_x_10 "65" +vr_wofs_x_11 "10" +vr_wofs_x_12 "-5" +vr_wofs_x_13 "0" +vr_wofs_x_14 "10" +vr_wofs_x_15 "10" +vr_wofs_x_16 "3" +vr_wofs_x_17 "2.3" +vr_wofs_x_18 "1.5" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_y_01 "2.2" +vr_wofs_y_02 "1.9" +vr_wofs_y_03 "1.65" +vr_wofs_y_04 "2.9" +vr_wofs_y_05 "4.5" +vr_wofs_y_06 "2.3" +vr_wofs_y_07 "7.2" +vr_wofs_y_08 "6.1" +vr_wofs_y_09 "18" +vr_wofs_y_10 "3.7" +vr_wofs_y_11 "1.5" +vr_wofs_y_12 "3" +vr_wofs_y_13 "3" +vr_wofs_y_14 "1.5" +vr_wofs_y_15 "7" +vr_wofs_y_16 "4" +vr_wofs_y_17 "2.4" +vr_wofs_y_18 "1" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_yaw_01 "-2.5" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "0.0" +vr_wofs_yaw_10 "0.0" +vr_wofs_yaw_11 "0.0" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.0" +vr_wofs_yaw_15 "0.0" +vr_wofs_yaw_16 "0.0" +vr_wofs_yaw_17 "-1" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "0.999979" +vr_wofs_z_03 "-1.900011" +vr_wofs_z_04 "0.399975" +vr_wofs_z_05 "2.1" +vr_wofs_z_06 "1.499972" +vr_wofs_z_07 "4.699956" +vr_wofs_z_08 "-0.7" +vr_wofs_z_09 "37" +vr_wofs_z_10 "17" +vr_wofs_z_11 "13" +vr_wofs_z_12 "15" +vr_wofs_z_13 "19" +vr_wofs_z_14 "13" +vr_wofs_z_15 "19" +vr_wofs_z_16 "13" +vr_wofs_z_17 "-1.2" +vr_wofs_z_18 "10" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_world_scale "1.25" +vid_restart ++mlook diff --git a/old/config4.cfg b/old/config4.cfg new file mode 100644 index 00000000..4e62ae22 --- /dev/null +++ b/old/config4.cfg @@ -0,0 +1,333 @@ +unbindall +bind "TAB" "+showscores" +bind "ENTER" "+jump" +bind "ESCAPE" "togglemenu" +bind "SPACE" "+jump" +bind "+" "sizeup" +bind "," "+moveleft" +bind "-" "sizedown" +bind "." "+moveright" +bind "/" "impulse 10" +bind "0" "impulse 0" +bind "1" "impulse 10" +bind "2" "impulse 2" +bind "3" "impulse 12" +bind "4" "impulse 4" +bind "5" "impulse 5" +bind "6" "impulse 6" +bind "7" "impulse 7" +bind "8" "impulse 8" +bind "=" "sizeup" +bind "\" "+mlook" +bind "`" "toggleconsole" +bind "a" "+moveleft" +bind "c" "+movedown" +bind "d" "+moveright" +bind "s" "+back" +bind "t" "messagemode" +bind "w" "+forward" +bind "z" "+lookdown" +bind "~" "toggleconsole" +bind "UPARROW" "+forward" +bind "DOWNARROW" "+back" +bind "LEFTARROW" "impulse 10" +bind "RIGHTARROW" "+right" +bind "ALT" "+strafe" +bind "CTRL" "+attack" +bind "SHIFT" "+speed" +bind "F1" "help" +bind "F2" "menu_save" +bind "F3" "menu_load" +bind "F4" "menu_options" +bind "F5" "menu_multiplayer" +bind "F6" "echo Quicksaving...; wait; save quick" +bind "F9" "echo Quickloading...; wait; load quick" +bind "F10" "quit" +bind "F11" "zoom_in" +bind "F12" "screenshot" +bind "INS" "+klook" +bind "DEL" "+lookdown" +bind "PGDN" "+lookup" +bind "END" "centerview" +bind "MOUSE1" "+attack" +bind "MOUSE2" "+forward" +bind "MOUSE3" "+mlook" +bind "MWHEELDOWN" "impulse 12" +bind "PAUSE" "pause" +_cl_color "0" +_cl_name "player" +_snd_mixahead "0.1" +bgm_extmusic "1" +bgmvolume "0" +cfg_unbindall "1" +cl_alwaysrun "1" +cl_backspeed "200" +cl_forwardspeed "200" +cl_maxpitch "90" +cl_minpitch "-90" +contrast "1" +crosshair "0" +external_ents "1" +fov_adapt "1" +gamma "1" +gl_farclip "16384" +gl_flashblend "0" +gl_fullbrights "1" +gl_overbright "1" +gl_overbright_models "1" +gl_subdivide_size "128" +gl_texture_anisotropy "1" +gl_texturemode "GL_LINEAR_MIPMAP_LINEAR" +gl_triplebuffer "1" +host_maxfps "72" +joy_deadzone "0.175" +joy_deadzone_trigger "0.2" +joy_enable "1" +joy_exponent "3" +joy_exponent_move "3" +joy_invert "0" +joy_sensitivity_pitch "150" +joy_sensitivity_yaw "300" +joy_swapmovelook "0" +lookspring "1" +lookstrafe "0" +m_forward "1" +m_pitch "0.022" +m_side "0.8" +m_yaw "0.022" +r_clearcolor "2" +r_dynamic "1" +r_novis "0" +r_oldwater "1" +r_particles "1" +r_quadparticles "1" +r_scale "1" +r_shadows "0" +r_viewmodel_quake "0" +r_wateralpha "1" +saved1 "0" +saved2 "0" +saved3 "0" +saved4 "0" +savedgamecfg "0" +scr_conalpha "0.5" +scr_conscale "1" +scr_conspeed "500" +scr_conwidth "0" +scr_crosshairscale "1" +scr_menuscale "1" +scr_sbaralpha "0.7" +scr_sbarscale "1" +sensitivity "2.5" +sv_altnoclip "1" +sys_throttle "0.02" +vid_borderless "0" +vid_bpp "24" +vid_desktopfullscreen "0" +vid_fsaa "0" +vid_fullscreen "0" +vid_height "900" +vid_refreshrate "144" +vid_vsync "0" +vid_width "1600" +viewsize "100" +volume "0.8" +vr_aimmode "7" +vr_body_interactions "0" +vr_crosshair "0" +vr_crosshair_alpha "0.65" +vr_crosshair_depth "0" +vr_crosshair_size "2" +vr_crosshairy "0" +vr_deadzone "10" +vr_enable_joystick_turn "1" +vr_floor_offset "-21" +vr_gun_z_offset "-1" +vr_gunangle "39.5" +vr_gunmodelpitch "7" +vr_gunmodelscale "0.7" +vr_gunmodely "1.3" +vr_gunyaw "4" +vr_height_calibration "1.576243" +vr_hud_scale "0.025" +vr_melee_dmg_multiplier "1.0" +vr_melee_range_multiplier "1.0" +vr_melee_threshold "7" +vr_menu_distance "76" +vr_menu_scale "0.2" +vr_movement_mode "1" +vr_msaa "9" +vr_roomscale_jump "1" +vr_roomscale_jump_threshold "1" +vr_sbar_mode "1" +vr_sbar_offset_pitch "1" +vr_sbar_offset_roll "-0.3" +vr_sbar_offset_x "-12" +vr_sbar_offset_y "1" +vr_sbar_offset_yaw "1.6" +vr_sbar_offset_z "-3" +vr_snap_turn "0" +vr_turn_speed "3.25" +vr_wofs_id_01 "progs/v_axe.mdl" +vr_wofs_id_02 "progs/v_shot.mdl" +vr_wofs_id_03 "progs/v_shot2.mdl" +vr_wofs_id_04 "progs/v_nail.mdl" +vr_wofs_id_05 "progs/v_nail2.mdl" +vr_wofs_id_06 "progs/v_rock.mdl" +vr_wofs_id_07 "progs/v_rock2.mdl" +vr_wofs_id_08 "progs/v_light.mdl" +vr_wofs_id_09 "progs/v_hammer.mdl" +vr_wofs_id_10 "progs/v_laserg.mdl" +vr_wofs_id_11 "progs/v_prox.mdl" +vr_wofs_id_12 "progs/v_lava.mdl" +vr_wofs_id_13 "progs/v_lava2.mdl" +vr_wofs_id_14 "progs/v_multi.mdl" +vr_wofs_id_15 "progs/v_multi2.mdl" +vr_wofs_id_16 "progs/v_plasma.mdl" +vr_wofs_id_17 "progs/hand.mdl" +vr_wofs_id_18 "-1" +vr_wofs_id_19 "-1" +vr_wofs_id_20 "-1" +vr_wofs_pitch_01 "0" +vr_wofs_pitch_02 "0" +vr_wofs_pitch_03 "0.0" +vr_wofs_pitch_04 "0.0" +vr_wofs_pitch_05 "0.0" +vr_wofs_pitch_06 "0.0" +vr_wofs_pitch_07 "0.0" +vr_wofs_pitch_08 "0.0" +vr_wofs_pitch_09 "0.0" +vr_wofs_pitch_10 "0.0" +vr_wofs_pitch_11 "0.0" +vr_wofs_pitch_12 "0.0" +vr_wofs_pitch_13 "0.0" +vr_wofs_pitch_14 "0.0" +vr_wofs_pitch_15 "0.0" +vr_wofs_pitch_16 "0.0" +vr_wofs_pitch_17 "-4" +vr_wofs_pitch_18 "0.0" +vr_wofs_pitch_19 "0.0" +vr_wofs_pitch_20 "0.0" +vr_wofs_roll_01 "-8" +vr_wofs_roll_02 "-6.5" +vr_wofs_roll_03 "-8" +vr_wofs_roll_04 "-5" +vr_wofs_roll_05 "-6.5" +vr_wofs_roll_06 "-8.5" +vr_wofs_roll_07 "-4.5" +vr_wofs_roll_08 "-7" +vr_wofs_roll_09 "0.0" +vr_wofs_roll_10 "0.0" +vr_wofs_roll_11 "0.0" +vr_wofs_roll_12 "0.0" +vr_wofs_roll_13 "0.0" +vr_wofs_roll_14 "0.0" +vr_wofs_roll_15 "0.0" +vr_wofs_roll_16 "0.0" +vr_wofs_roll_17 "-19.5" +vr_wofs_roll_18 "0.0" +vr_wofs_roll_19 "0.0" +vr_wofs_roll_20 "0.0" +vr_wofs_scale_01 "0.34" +vr_wofs_scale_02 "0.46" +vr_wofs_scale_03 "0.48" +vr_wofs_scale_04 "0.48" +vr_wofs_scale_05 "0.38" +vr_wofs_scale_06 "0.38" +vr_wofs_scale_07 "0.34" +vr_wofs_scale_08 "0.35" +vr_wofs_scale_09 "0.33" +vr_wofs_scale_10 "0.33" +vr_wofs_scale_11 "0.5" +vr_wofs_scale_12 "0.5" +vr_wofs_scale_13 "0.5" +vr_wofs_scale_14 "0.5" +vr_wofs_scale_15 "0.5" +vr_wofs_scale_16 "0.5" +vr_wofs_scale_17 "0.34" +vr_wofs_scale_18 "0.5" +vr_wofs_scale_19 "0.5" +vr_wofs_scale_20 "0.5" +vr_wofs_x_01 "2.8" +vr_wofs_x_02 "4.6" +vr_wofs_x_03 "8.399998" +vr_wofs_x_04 "4.9" +vr_wofs_x_05 "4.8" +vr_wofs_x_06 "13.300018" +vr_wofs_x_07 "11.700012" +vr_wofs_x_08 "5.6" +vr_wofs_x_09 "-4" +vr_wofs_x_10 "65" +vr_wofs_x_11 "10" +vr_wofs_x_12 "-5" +vr_wofs_x_13 "0" +vr_wofs_x_14 "10" +vr_wofs_x_15 "10" +vr_wofs_x_16 "3" +vr_wofs_x_17 "2.3" +vr_wofs_x_18 "1.5" +vr_wofs_x_19 "1.5" +vr_wofs_x_20 "1.5" +vr_wofs_y_01 "2.2" +vr_wofs_y_02 "1.9" +vr_wofs_y_03 "1.65" +vr_wofs_y_04 "2.9" +vr_wofs_y_05 "4.5" +vr_wofs_y_06 "2.3" +vr_wofs_y_07 "7.2" +vr_wofs_y_08 "6.1" +vr_wofs_y_09 "18" +vr_wofs_y_10 "3.7" +vr_wofs_y_11 "1.5" +vr_wofs_y_12 "3" +vr_wofs_y_13 "3" +vr_wofs_y_14 "1.5" +vr_wofs_y_15 "7" +vr_wofs_y_16 "4" +vr_wofs_y_17 "2.4" +vr_wofs_y_18 "1" +vr_wofs_y_19 "1" +vr_wofs_y_20 "1" +vr_wofs_yaw_01 "-2.5" +vr_wofs_yaw_02 "0" +vr_wofs_yaw_03 "0" +vr_wofs_yaw_04 "0.0" +vr_wofs_yaw_05 "0.0" +vr_wofs_yaw_06 "0.5" +vr_wofs_yaw_07 "0.5" +vr_wofs_yaw_08 "0" +vr_wofs_yaw_09 "0.0" +vr_wofs_yaw_10 "0.0" +vr_wofs_yaw_11 "0.0" +vr_wofs_yaw_12 "0.0" +vr_wofs_yaw_13 "0.0" +vr_wofs_yaw_14 "0.0" +vr_wofs_yaw_15 "0.0" +vr_wofs_yaw_16 "0.0" +vr_wofs_yaw_17 "-1" +vr_wofs_yaw_18 "0.0" +vr_wofs_yaw_19 "0.0" +vr_wofs_yaw_20 "0.0" +vr_wofs_z_01 "-0.8" +vr_wofs_z_02 "0.999979" +vr_wofs_z_03 "-1.900011" +vr_wofs_z_04 "0.399975" +vr_wofs_z_05 "2.1" +vr_wofs_z_06 "1.499972" +vr_wofs_z_07 "4.699956" +vr_wofs_z_08 "-0.7" +vr_wofs_z_09 "37" +vr_wofs_z_10 "17" +vr_wofs_z_11 "13" +vr_wofs_z_12 "15" +vr_wofs_z_13 "19" +vr_wofs_z_14 "13" +vr_wofs_z_15 "19" +vr_wofs_z_16 "13" +vr_wofs_z_17 "-1.2" +vr_wofs_z_18 "10" +vr_wofs_z_19 "10" +vr_wofs_z_20 "10" +vr_world_scale "1.25" +vid_restart ++mlook diff --git a/old/scratchpad.cpp b/old/scratchpad.cpp index dcf04344..5358366e 100644 --- a/old/scratchpad.cpp +++ b/old/scratchpad.cpp @@ -11,6 +11,7 @@ // TODO VR: this kinda works in E1M1 if put inside FlyMove // TODO VR: test, what is this one for? How does it differ from world.cpp? + auto doHandTouch = [&](vec3_t handpos, vec3_t handrot, int type) { vec3_t fwd, right, up, end; AngleVectors(handrot, fwd, right, up); @@ -64,3 +65,39 @@ doHandTouch(ent->v.handpos, ent->v.handrot, MOVE_NORMAL); doHandTouch(ent->v.offhandpos, ent->v.offhandrot, MOVE_NORMAL); + + + + +void VR_Move(usercmd_t* cmd) +{ + if(!vr_enabled.value) + { + return; + } + + // TODO VR: repetition of ofs calculation + // TODO VR: adj unused? could be used to find position of muzzle + // + /* + vec3_t adj; + _VectorCopy(cl.handpos[1], adj); + + vec3_t ofs = {vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON].value, + vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON + 1].value, + vr_weapon_offset[weaponCVarEntry * VARS_PER_WEAPON + 2].value + + vr_gunmodely.value}; + + vec3_t fwd2, right, up; + AngleVectors(cl.handrot[1], fwd2, right, up); + fwd2[0] *= vr_gunmodelscale.value * ofs[2]; + fwd2[1] *= vr_gunmodelscale.value * ofs[2]; + fwd2[2] *= vr_gunmodelscale.value * ofs[2]; + VectorAdd(adj, fwd2, adj); + */ + + // TODO VR: not needed anymore, changing QC - what to do? + // + // vec3_t adjhandpos; + // VectorCopy(cl.handpos[1], adjhandpos); + // adjhandpos[2] -= vr_projectilespawn_z_offset.value;