Make controlling a vehicle (AT-ST) work a lot better - uses 1st person view

This commit is contained in:
Simon 2023-01-28 15:28:24 +00:00
parent bb423c1e37
commit e2902ca3f9
8 changed files with 25 additions and 14 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.jkquest"
android:versionCode="34"
android:versionName="0.5.3" android:installLocation="auto" >
android:versionCode="35"
android:versionName="0.5.4" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>

View file

@ -1,7 +1,3 @@
# MAKEFILE_LIST specifies the current used Makefiles, of which this is the last
# one. I use that to obtain the Application.mk dir then import the root
# Application.mk.
APP_PLATFORM := android-24
APP_CFLAGS += -Wl,--no-undefined

View file

@ -11,6 +11,7 @@ typedef struct {
bool emplaced_gun; // controlling an emplaced gun
bool remote_droid; // controlling a remote droid
bool remote_npc; // controlling a remote NPC (will also be true when controlling a droid)
bool in_vehicle; // controlling a vehicle
vec3_t remote_angles; // The view angles of the remote thing we are controlling
float remote_snapTurn; // how much turn has been applied to the yaw by joystick for a remote controlled entity
int remote_cooldown;

View file

@ -793,7 +793,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
//process force motion controls here
if (vr_force_motion_controlled->integer)
if (vr_force_motion_controlled->integer &&
!vr.weapon_stabilised)
{
if (vr.secondaryswingvelocity > vr_force_velocity_trigger->value)
{
@ -839,7 +840,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
distanceToBody = sqrt(vr.weaponoffset[0]*vr.weaponoffset[0] + vr.weaponoffset[2]*vr.weaponoffset[2]);
}
bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera && !vr.remote_turret && !vr.emplaced_gun;
bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera && !vr.remote_turret && !vr.emplaced_gun && !vr.in_vehicle;
if (gestureUseAllowed && distanceToBody > vr_use_gesture_boundary->value) {
if (!vr.useGestureActive) {
vr.useGestureActive = true;

View file

@ -1877,7 +1877,7 @@ static void CG_DrawCrosshair3D(int type) // 0 - force, 1 - weapons
return;
}
if ( cg.renderingThirdPerson || in_camera) {
if ( in_camera ) {
return;
}
@ -2932,7 +2932,9 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
CG_Error( "CG_DrawActive: Undefined stereoView" );
}
//Only vehicle in JK2 is the AT-ST
vr->in_vehicle = (g_entities[0].client &&
g_entities[0].client->NPC_class == CLASS_ATST);
vr->remote_npc = !Q_stricmp( "NPC", g_entities[cg.snap->ps.viewEntity].classname );
vr->remote_droid = false;
vr->remote_turret = false;

View file

@ -5064,9 +5064,12 @@ Ghoul2 Insert Start
// add a water splash if partially in and out of water
CG_PlayerSplash( cent );
bool playerInATST = (g_entities[0].client &&
g_entities[0].client->NPC_class == CLASS_ATST);
// get the player model information
ent.renderfx = 0;
if ( !cg.renderingThirdPerson || cg.zoomMode )
if ( !playerInATST && (!cg.renderingThirdPerson || cg.zoomMode ))
{//in first person or zoomed in
if ( cg.snap->ps.viewEntity <= 0 || cg.snap->ps.viewEntity >= ENTITYNUM_WORLD)
{//no viewentity

View file

@ -1926,9 +1926,11 @@ wasForceSpeed=isForceSpeed;
// decide on third person view
cg.renderingThirdPerson = (qboolean)(
cg_thirdPerson.integer ||
(cg.snap->ps.stats[STAT_HEALTH] <= 0) ||
(g_entities[0].client &&
g_entities[0].client->NPC_class == CLASS_ATST));
(cg.snap->ps.stats[STAT_HEALTH] <= 0));
//Using the AT-ST in 3rd person is a mess, just use 1st person
// ||
//(g_entities[0].client &&
// g_entities[0].client->NPC_class == CLASS_ATST));
vr->third_person = cg.renderingThirdPerson;

View file

@ -2814,6 +2814,12 @@ qboolean ForcePower_Valid(int index);
void CG_DrawItemSelector( void )
{
if (cg.predicted_player_state.stats[STAT_HEALTH] <= 0 ||
(g_entities[0].client && g_entities[0].client->NPC_class != CLASS_KYLE))
{
return;
}
if (cg.itemSelectorTime == 0)
{
cg.itemSelectorTime = cg.time;