Many improvements

Added cvar g_saberAutoDeflect1stPerson so saber is only ever used to deflect lasers in first person
Made selector always draw using HMD YAW so it remains in front when turning i.r.l
Updated the hand model (@baggyg)
Updated the crawler text with the patron credits
Added @MuadDib's menu changes
Aligned all weapons
Scaled the saber hilt down a little bit

Co-Authored-By: Grant Bagwell <general@grantbagwell.co.uk>
This commit is contained in:
Simon 2022-10-13 23:19:44 +01:00
parent d0185c169c
commit ed658dfffa
23 changed files with 10230 additions and 36 deletions

View file

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

View file

@ -133,6 +133,12 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
handleTrackedControllerButton(pDominantTrackedRemoteNew, pDominantTrackedRemoteOld, domButton1, A_MOUSE1);
handleTrackedControllerButton(pDominantTrackedRemoteNew, pDominantTrackedRemoteOld, ovrButton_Trigger, A_MOUSE1);
handleTrackedControllerButton(pDominantTrackedRemoteNew, pDominantTrackedRemoteOld, domButton2, A_ESCAPE);
//To skip flatscreen cinematic
if ((pDominantTrackedRemoteNew->Buttons & primaryThumb) !=
(pDominantTrackedRemoteOld->Buttons & primaryThumb)) {
sendButtonAction("+use", (pDominantTrackedRemoteNew->Buttons & primaryThumb));
}
}
else
{

View file

@ -2025,7 +2025,6 @@ void CL_PlayInGameCinematic_f(void)
#define TC_PLANE_TOP 0
#define TC_PLANE_BOTTOM 1100
#define TC_DELAY 9000
#define TC_STOPTIME 81000
void SCR_AddCreditTextCrawl()
{
@ -2063,7 +2062,7 @@ void SCR_AddCreditTextCrawl()
VectorScaleM( verts[2].modulate, 0.1f, verts[2].modulate ); // darken at the top??
VectorScaleM( verts[3].modulate, 0.1f, verts[3].modulate );
float timeoffset = (cls.realtime-startTime)*0.000015f -1;
float timeoffset = (cls.realtime-startTime)*0.00003f -1;
VectorSet( verts[0].xyz, TC_PLANE_NEAR, -TC_PLANE_WIDTH, TC_PLANE_TOP );
verts[0].st[0] = 1;
verts[0].st[1] = 1 +timeoffset;
@ -2082,7 +2081,7 @@ void SCR_AddCreditTextCrawl()
// render it out
re.ClearScene();
re.AddPolyToScene( re.RegisterShaderNoMip( "menu/video/tc_demo" ), 4, verts );
re.AddPolyToScene( re.RegisterShaderNoMip( "menu/video/beef_crawl" ), 4, verts );
re.RenderScene( &refdef );
}

View file

@ -419,6 +419,7 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
re.BeginFrame( stereoFrame );
qboolean uiFullscreen = _UI_IsFullscreen();
static bool drawCreditsCrawl = true;
// if the menu is going to cover the entire screen, we
// don't need to render anything under it
@ -446,6 +447,7 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
CL_CGameRendering( stereoFrame );
break;
case CA_ACTIVE:
drawCreditsCrawl = false;
if (CL_IsRunningInGameCinematic() || CL_InGameCinematicOnStandBy())
{
SCR_DrawCinematic();
@ -472,7 +474,7 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
SCR_DrawDebugGraph ();
}
if ( uiFullscreen )
if ( uiFullscreen && drawCreditsCrawl)
{
SCR_AddCreditTextCrawl();
}

View file

@ -146,6 +146,7 @@ extern cvar_t *g_debugMelee;
extern cvar_t *g_saberNewControlScheme;
extern cvar_t *g_stepSlideFix;
extern cvar_t *g_saberAutoBlocking;
extern cvar_t *g_saberAutoDeflect1stPerson;
static void PM_SetWaterLevelAtPoint( vec3_t org, int *waterlevel, int *watertype );

View file

@ -186,6 +186,7 @@ cvar_t *g_AIsurrender;
cvar_t *g_numEntities;
//cvar_t *g_iscensored;
cvar_t *g_saberAutoDeflect1stPerson;
cvar_t *g_saberAutoBlocking;
cvar_t *g_saberRealisticCombat;
cvar_t *debug_subdivision;
@ -659,6 +660,7 @@ void G_InitCvars( void ) {
g_subtitles = gi.cvar( "g_subtitles", "0", CVAR_ARCHIVE );
com_buildScript = gi.cvar ("com_buildscript", "0", 0);
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_CHEAT );//Whether the saber will auto deflect missiles in first person
g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "0", CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberMoreRealistic", "1", CVAR_ARCHIVE );//makes collision more precise, increases damage
debug_subdivision = gi.cvar( "debug_subdivision", "0", CVAR_ARCHIVE );//debug for dismemberment

View file

@ -3456,6 +3456,9 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, centity_t *cen
VectorSubtract(vec3_origin, axis[2], hiltEnt.axis[0]);
VectorCopy(axis[1], hiltEnt.axis[1]);
VectorCopy(axis[0], hiltEnt.axis[2]);
for (int i = 0; i < 3; ++i)
VectorScale(hiltEnt.axis[i], 0.85f, hiltEnt.axis[i]);
cgi_R_AddRefEntityToScene(&hiltEnt);
static int playingSaberSwingSound = 0;

View file

@ -2010,6 +2010,7 @@ wasForceSpeed=isForceSpeed;
if (!in_camera
&& !cg.renderingThirdPerson
&& cg.predicted_player_state.stats[STAT_HEALTH] > 0
&& cg.snap->ps.weapon != WP_MELEE
&& !vr->weapon_stabilised
&& !cg_pano.integer
&& (cg.snap->ps.viewEntity == 0 || cg.snap->ps.viewEntity >= ENTITYNUM_WORLD))
@ -2018,23 +2019,17 @@ wasForceSpeed=isForceSpeed;
refEntity_t handEnt;
memset( &handEnt, 0, sizeof(refEntity_t) );
BG_CalculateVROffHandPosition(handEnt.origin, handEnt.angles);
AngleVectors(handEnt.angles, forward, NULL, NULL);
VectorMA( handEnt.origin, 8.0f, forward, end );
//If the current force power is directional, show the nav arrow from off-hand for now
if (showPowers[cg.forcepowerSelect] >= FP_PUSH) {
vec3_t color = {0.0f, 1.0f, 0.0f};
FX_AddLine(handEnt.origin, end, 0.1f, 1.0f, 0.0f,
1.0f, 0.0f, 0.0f,
color, color, 0.0f,
60, cgi_R_RegisterShader("gfx/misc/nav_line"),
FX_SIZE_LINEAR | FX_ALPHA_LINEAR);
}
//Move it back a bit?
AngleVectors(handEnt.angles, forward, NULL, NULL);
VectorMA( handEnt.origin, -1.0f, forward, handEnt.origin );
handEnt.renderfx = RF_DEPTHHACK;
handEnt.hModel = cgi_R_RegisterModel( "models/hands/left_hand_relaxed.md3" );
handEnt.hModel = cgi_R_RegisterModel( "models/players/kyle/lhand_r.md3" );
VectorCopy(handEnt.origin, handEnt.oldorigin);
AnglesToAxis(handEnt.angles, handEnt.axis);
cgi_R_AddRefEntityToScene(&handEnt);
}
}

View file

@ -2704,7 +2704,6 @@ void CG_ItemSelectorSelect_f( void )
}
//reset ready for next time
cg.itemSelectorType = 0;
cg.itemSelectorSelection = -1;
}
@ -2752,6 +2751,7 @@ void CG_DrawItemSelector( void )
VectorSubtract(vr->weaponposition, cg.itemSelectorOrigin, controllerOffset);
vec3_t wheelAngles, wheelOrigin, beamOrigin, wheelForward, wheelRight, wheelUp;
cg.itemSelectorAngles[YAW] = vr->hmdorientation[YAW];
BG_CalculateVRPositionInWorld(cg.itemSelectorOrigin, cg.itemSelectorOffset, cg.itemSelectorAngles, wheelOrigin, wheelAngles);
AngleVectors(wheelAngles, wheelForward, wheelRight, wheelUp);
@ -2884,6 +2884,7 @@ void CG_DrawItemSelector( void )
sprite.reType = RT_SPRITE;
sprite.customShader = cgs.media.binocularArrow;
sprite.radius = 0.6f;
sprite.rotation = -90.0f;
sprite.shaderRGBA[0] = 255;
sprite.shaderRGBA[1] = 255;
sprite.shaderRGBA[2] = 255;

View file

@ -164,6 +164,7 @@ cvar_t *g_AIsurrender;
cvar_t *g_numEntities;
cvar_t *g_iscensored;
cvar_t *g_saberAutoDeflect1stPerson;
cvar_t *g_saberAutoBlocking;
cvar_t *g_saberRealisticCombat;
cvar_t *g_saberMoveSpeed;
@ -583,6 +584,7 @@ void G_InitCvars( void ) {
g_subtitles = gi.cvar( "g_subtitles", "0", CVAR_ARCHIVE );
com_buildScript = gi.cvar ("com_buildscript", "0", 0);
g_saberAutoDeflect1stPerson = gi.cvar( "g_saberAutoDeflect1stPerson", "0", CVAR_ARCHIVE|CVAR_CHEAT );//Whether the saber will auto deflect missiles in first person
g_saberAutoBlocking = gi.cvar( "g_saberAutoBlocking", "0", CVAR_ARCHIVE|CVAR_CHEAT );//must press +block button to do any blocking
g_saberRealisticCombat = gi.cvar( "g_saberRealisticCombat", "1", CVAR_ARCHIVE );//makes collision more precise, increases damage
g_saberMoveSpeed = gi.cvar( "g_saberMoveSpeed", "1", CVAR_ARCHIVE|CVAR_CHEAT );//how fast you run while attacking with a saber

View file

@ -116,6 +116,7 @@ void ForceThrow( gentity_t *self, qboolean pull );
qboolean WP_ForcePowerAvailable( gentity_t *self, forcePowers_t forcePower, int overrideAmt );
void WP_ForcePowerDrain( gentity_t *self, forcePowers_t forcePower, int overrideAmt );
extern cvar_t *g_saberAutoDeflect1stPerson;
extern cvar_t *g_saberAutoBlocking;
extern cvar_t *g_saberRealisticCombat;
extern int g_crosshairEntNum;
@ -4624,6 +4625,12 @@ void WP_SaberBlockNonRandom( gentity_t *self, vec3_t hitloc, qboolean missileBlo
return;
}
if (self->client->ps.clientNum == 0 && missileBlock && !cg_thirdPerson.integer &&
!g_saberAutoDeflect1stPerson->integer)
{
return;
}
VectorSubtract( hitloc, self->client->renderInfo.eyePoint, diff );
diff[2] = 0;
VectorNormalize( diff );
@ -4901,10 +4908,18 @@ void WP_SaberStartMissileBlockCheck( gentity_t *self, usercmd_t *ucmd )
return;
}
if ( !self->s.number && !g_saberAutoBlocking->integer && self->client->ps.saberBlockingTime<level.time )
{
if (cg_thirdPerson.integer) {
if (!self->s.number && !g_saberAutoBlocking->integer &&
self->client->ps.saberBlockingTime < level.time) {
return;
}
} else // first person
{
if (!self->s.number && !g_saberAutoDeflect1stPerson->integer &&
self->client->ps.saberBlockingTime < level.time) {
return;
}
}
fwdangles[1] = self->client->ps.viewangles[1];
AngleVectors( fwdangles, forward, NULL, NULL );
@ -5197,8 +5212,11 @@ void WP_SaberUpdate( gentity_t *self, usercmd_t *ucmd )
}
else if ( self->client->ps.saberBlocking == BLK_TIGHT || self->client->ps.saberBlocking == BLK_WIDE )
{//FIXME: keep bbox in front of player, even when wide?
bool autoBlocking = (cg_thirdPerson.integer && g_saberAutoBlocking->integer) ||
(!cg_thirdPerson.integer && g_saberAutoDeflect1stPerson->integer);
vec3_t saberOrg;
if ( ( (self->s.number&&!Jedi_SaberBusy(self)&&!g_saberRealisticCombat->integer) || (self->s.number == 0 && self->client->ps.saberBlocking == BLK_WIDE && (g_saberAutoBlocking->integer||self->client->ps.saberBlockingTime>level.time)) )
if ( ( (self->s.number&&!Jedi_SaberBusy(self)&&!g_saberRealisticCombat->integer) || (self->s.number == 0 && self->client->ps.saberBlocking == BLK_WIDE &&
(autoBlocking||self->client->ps.saberBlockingTime>level.time)) )
&& self->client->ps.weaponTime <= 0 )
{//full-size blocking for non-attacking player with g_saberAutoBlocking on
vec3_t saberang={0,0,0}, fwd, sabermins={-8,-8,-8}, sabermaxs={8,8,8};

View file

@ -4,20 +4,21 @@
// Values are: scale,right,up,forward,pitch,yaw,roll
seta vr_weapon_adjustment_1 "0.55,-4.89,8.12,-12.36,-28.60,10.80,-199.50"
seta vr_weapon_adjustment_2 "0.952,-3.908,4.874,-9.349,0.000,0.000,0.000"
seta vr_weapon_adjustment_3 "0.884,-4.140,7.036,-10.204,-0.000,0.000,0.000"
seta vr_weapon_adjustment_4 "0.44,-8.75,12.50,-2.31,-0.00,-1.80,5.00"
seta vr_weapon_adjustment_5 "1.500,-2.747,5.707,-7.827,1.800,0.000,0.000"
seta vr_weapon_adjustment_6 "0.700,-4.029,10.714,-6.771,0.000,0.000,0.000"
seta vr_weapon_adjustment_7 "1.22,-5.65,6.81,-3.40,0.00,0.20,0.70"
seta vr_weapon_adjustment_8 "1.000,-4.780,8.240,-10.440,0.000,0.000,0.000"
seta vr_weapon_adjustment_9 "1.000,-4.780,8.240,-10.440,0.000,0.000,0.000"
seta vr_weapon_adjustment_10 "1.500,-3.600,5.973,-8.640,0.000,0.000,0.000"
seta vr_weapon_adjustment_11 "0.44,-9.55,12.79,-23.06,0.30,-1.40,-0.40"
seta vr_weapon_adjustment_20 "0.44,-13.55,12.79,-26.06,0.30,-1.40,-0.40"
seta vr_weapon_adjustment_12 "0.83,-7.61,10.14,-11.47,-2.60,-0.00,0.80"
seta vr_weapon_adjustment_10 "1.624,-3.042,6.823,-9.175,24.600,0.000,-26.400"
seta vr_weapon_adjustment_11 "0.998,-5.711,9.158,-9.740,29.900,0.000,-15.200"
seta vr_weapon_adjustment_12 "1.424,-2.107,6.236,-8.006,29.900,0.000,-23.100"
seta vr_weapon_adjustment_13 "1.000,-6.500,9.240,-12.680,15.300,0.000,0.000"
seta vr_weapon_adjustment_14 "0.52,-12.87,13.29,-22.09,11.30,26.60,-3.40"
seta vr_weapon_adjustment_18 "0.510,-8.235,10.706,-3.922,-5.600,0.400,0.000"
seta vr_weapon_adjustment_19 "0.43,-8.97,13.22,-21.68,-4.80,-4.50,-0.40"
seta vr_weapon_adjustment_2 "0.952,-3.908,4.874,-9.349,0.000,0.000,0.000"
seta vr_weapon_adjustment_20 "0.44,-13.55,12.79,-26.06,0.30,-1.40,-0.40"
seta vr_weapon_adjustment_22 "0.64,-12.59,12.94,-20.44,11.30,26.60,-3.40"
seta vr_weapon_adjustment_3 "0.884,-4.140,7.036,-10.204,-0.000,0.000,0.000"
seta vr_weapon_adjustment_4 "0.844,-3.555,9.526,-3.246,0.000,0.000,0.000"
seta vr_weapon_adjustment_5 "1.500,-2.747,5.707,-7.827,1.800,0.000,0.000"
seta vr_weapon_adjustment_6 "0.700,-4.029,10.714,-6.771,0.000,0.000,0.000"
seta vr_weapon_adjustment_7 "0.844,-4.787,9.526,-9.550,0.000,0.000,0.000"
seta vr_weapon_adjustment_8 "1.000,-4.780,8.240,-10.440,0.000,0.000,0.000"
seta vr_weapon_adjustment_9 "1.100,-4.036,7.309,-7.836,0.000,0.000,0.000"

Binary file not shown.

6
make_z_vr_assets_pk3.bat Normal file
View file

@ -0,0 +1,6 @@
cd assets
del z_vr_assets.pk3
cd ..
powershell Compress-Archive z_vr_assets/* z_vr_assets.zip
rename z_vr_assets.zip z_vr_assets.pk3
move z_vr_assets.pk3 assets/

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

1442
z_vr_assets/ui/controls.menu Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

2538
z_vr_assets/ui/setup.menu Normal file

File diff suppressed because it is too large Load diff