mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-25 05:21:28 +00:00
Proper support for left-hand controls
also made the RR pistol a little less terrible, as it is a bit frustrating in VR
This commit is contained in:
parent
74c7a65842
commit
379157708c
4 changed files with 24 additions and 6 deletions
|
@ -344,9 +344,20 @@ VSMatrix VREyeInfo::GetPlayerSpriteProjection(int width, int height) const
|
|||
get_weapon_pos_and_angle(x, y, z, pitch, yaw);
|
||||
new_projection.translate(-x * weapon_stereo_effect, (z-hmdPosition[1]) * weapon_stereo_effect, -y * weapon_stereo_effect);
|
||||
|
||||
new_projection.rotate(weaponangles[YAW] - hmdorientation[YAW], 0, 1, 0);
|
||||
new_projection.rotate(weaponangles[PITCH], 1, 0, 0);
|
||||
new_projection.rotate(weaponangles[ROLL], 0, 0, 1);
|
||||
if (vr_control_scheme < 10)
|
||||
{
|
||||
// Right-handed
|
||||
new_projection.rotate(weaponangles[YAW] - hmdorientation[YAW], 0, 1, 0);
|
||||
new_projection.rotate(weaponangles[PITCH], 1, 0, 0);
|
||||
new_projection.rotate(weaponangles[ROLL], 0, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Left-handed
|
||||
new_projection.rotate(180.0f + weaponangles[YAW] - hmdorientation[YAW], 0, 1, 0);
|
||||
new_projection.rotate(-weaponangles[PITCH], 1, 0, 0);
|
||||
new_projection.rotate(-weaponangles[ROLL], 0, 0, 1);
|
||||
}
|
||||
|
||||
float weapon_scale = 0.6f;
|
||||
new_projection.scale(-weapon_scale, weapon_scale, -weapon_scale);
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
CUSTOM_CVAR(Int, showendoom, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CUSTOM_CVAR(Int, showendoom, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < 0) self = 0;
|
||||
else if (self > 2) self=2;
|
||||
|
|
|
@ -231,9 +231,16 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
|
|||
{
|
||||
if (aimed == nullptr)
|
||||
{
|
||||
//I've adjusted the pistol to be a little less frustratingly random in VR
|
||||
#ifdef _NOTVR
|
||||
ang += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
setFreeAimVelocity(vel, zvel, ps[p].Angles.getPitchWithView(), 16.);
|
||||
zvel += 0.5 - krandf(1);
|
||||
#else
|
||||
ang += DAngle22_5 / 32 - randomAngle(22.5 / 16);
|
||||
setFreeAimVelocity(vel, zvel, ps[p].Angles.getPitchWithView(), 16.);
|
||||
zvel += 0.125 - krandf(0.25);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -540,8 +540,8 @@ OptionValue "DirectionMode"
|
|||
|
||||
OptionValue "ControlScheme"
|
||||
{
|
||||
10, "Right Handed"
|
||||
0, "Left Handed"
|
||||
0, "Right Handed"
|
||||
10, "Left Handed"
|
||||
}
|
||||
|
||||
OptionMenu "VROptionsMenu" protected
|
||||
|
|
Loading…
Reference in a new issue