Corrected world scale issues

Align lightning with gun
This commit is contained in:
Simon 2019-06-03 22:38:47 +01:00
parent af4fa71858
commit 0a177b90c2
4 changed files with 9 additions and 7 deletions

View file

@ -1725,6 +1725,7 @@ void CL_Beam_CalculatePositions(const beam_t *b, vec3_t start, vec3_t end)
//Use gun location as beam origin //Use gun location as beam origin
VectorCopy(gunorg, start); VectorCopy(gunorg, start);
start[2] -= 5.0f; // Hack to align lightning with gun
if (cl_beams_instantaimhack.integer) if (cl_beams_instantaimhack.integer)
{ {

View file

@ -46,11 +46,11 @@ static qboolean r_loaddds;
static qboolean r_savedds; static qboolean r_savedds;
static qboolean r_gpuskeletal; static qboolean r_gpuskeletal;
cvar_t r_worldscale = {CVAR_SAVE, "r_worldscale", "40", "World scale multiplier (default is 40)"}; cvar_t r_worldscale = {CVAR_SAVE, "r_worldscale", "30", "World scale multiplier (default is 30)"};
float GetStereoSeparation() float GetStereoSeparation()
{ {
return r_worldscale.value * 0.065; return r_worldscale.value * 0.065f;
} }

View file

@ -75,7 +75,7 @@ cvar_t cl_followmodel_up_highpass1 = {CVAR_SAVE, "cl_followmodel_up_highpass1",
cvar_t cl_followmodel_up_highpass = {CVAR_SAVE, "cl_followmodel_up_highpass", "2", "gun following upward highpass in 1/s"}; cvar_t cl_followmodel_up_highpass = {CVAR_SAVE, "cl_followmodel_up_highpass", "2", "gun following upward highpass in 1/s"};
cvar_t cl_followmodel_up_lowpass = {CVAR_SAVE, "cl_followmodel_up_lowpass", "10", "gun following upward lowpass in 1/s"}; cvar_t cl_followmodel_up_lowpass = {CVAR_SAVE, "cl_followmodel_up_lowpass", "10", "gun following upward lowpass in 1/s"};
cvar_t cl_viewmodel_scale = {0, "cl_viewmodel_scale", "0.65", "changes size of gun model, lower values prevent poking into walls but cause strange artifacts on lighting and especially r_stereo/vid_stereobuffer options where the size of the gun becomes visible"}; cvar_t cl_viewmodel_scale = {0, "cl_viewmodel_scale", "0.45", "changes size of gun model, lower values prevent poking into walls but cause strange artifacts on lighting and especially r_stereo/vid_stereobuffer options where the size of the gun becomes visible"};
cvar_t v_kicktime = {0, "v_kicktime", "0.0", "how long a view kick from damage lasts"}; cvar_t v_kicktime = {0, "v_kicktime", "0.0", "how long a view kick from damage lasts"};
cvar_t v_kickroll = {0, "v_kickroll", "0.0", "how much a view kick from damage rolls your view"}; cvar_t v_kickroll = {0, "v_kickroll", "0.0", "how much a view kick from damage rolls your view"};
@ -880,7 +880,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
{ {
vieworg[0] += (weaponOffset[2] * r_worldscale.value); // Forward/Back vieworg[0] += (weaponOffset[2] * r_worldscale.value); // Forward/Back
vieworg[1] += (weaponOffset[0] * r_worldscale.value); // Left/Right vieworg[1] += (weaponOffset[0] * r_worldscale.value); // Left/Right
vieworg[2] += (((hmdPosition[1] - playerHeight) + 0.4f) * r_worldscale.value); // Up/Down - Make played a bit taller vieworg[2] += ((hmdPosition[1] - playerHeight) * r_worldscale.value); // Up/Down
} }
Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2], Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2],
@ -897,7 +897,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix_withbob, gunorg[0], Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix_withbob, gunorg[0],
gunorg[1], gunorg[1],
gunorg[2], gunorg[2],
gunangles[0], gunangles[0] - 3.0f,
gunangles[1], 0.0f, cl_viewmodel_scale.value); gunangles[1], 0.0f, cl_viewmodel_scale.value);

View file

@ -1556,6 +1556,7 @@ static void ovrApp_HandleInput( ovrApp * app )
controllerYawHeading = controllerAngles[YAW] - gunangles[YAW] + yawOffset; controllerYawHeading = controllerAngles[YAW] - gunangles[YAW] + yawOffset;
hmdYawHeading = hmdorientation[YAW] - gunangles[YAW] + yawOffset; hmdYawHeading = hmdorientation[YAW] - gunangles[YAW] + yawOffset;
#ifndef NDEBUG
//Change heading mode on click of off=hand joystick //Change heading mode on click of off=hand joystick
if ((offHandTrackedRemoteState->Buttons & ovrButton_Joystick) && bigScreen == 0 && if ((offHandTrackedRemoteState->Buttons & ovrButton_Joystick) && bigScreen == 0 &&
(offHandTrackedRemoteState->Buttons & ovrButton_Joystick) != (offHandTrackedRemoteStateOld->Buttons & ovrButton_Joystick)) (offHandTrackedRemoteState->Buttons & ovrButton_Joystick) != (offHandTrackedRemoteStateOld->Buttons & ovrButton_Joystick))
@ -1567,7 +1568,7 @@ static void ovrApp_HandleInput( ovrApp * app )
SCR_CenterPrint("Heading Mode: Direction of off-hand controller"); SCR_CenterPrint("Heading Mode: Direction of off-hand controller");
} }
} }
#endif
} }
//Right-hand specific stuff //Right-hand specific stuff
@ -1577,7 +1578,7 @@ static void ovrApp_HandleInput( ovrApp * app )
//This section corrects for the fact that the controller actually controls direction of movement, but we want to move relative to the direction the //This section corrects for the fact that the controller actually controls direction of movement, but we want to move relative to the direction the
//player is facing for positional tracking //player is facing for positional tracking
float multiplier = /*arbitrary value that works ->*/ float multiplier = /*arbitrary value that works ->*/
(2500.0f * cl_postrackmultiplier.value) / cl_forwardspeed.value; (2200.0f * cl_postrackmultiplier.value) / cl_forwardspeed.value;
vec2_t v; vec2_t v;
rotateAboutOrigin(-positionDeltaThisFrame[0] * multiplier, positionDeltaThisFrame[2] * multiplier, -hmdorientation[YAW], v); rotateAboutOrigin(-positionDeltaThisFrame[0] * multiplier, positionDeltaThisFrame[2] * multiplier, -hmdorientation[YAW], v);