mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-25 05:21:00 +00:00
Various changes
- Force Speed FOV changes - Fix skybox - Scoped weapons
This commit is contained in:
parent
3930f6d514
commit
f16e6b2e7e
6 changed files with 43 additions and 20 deletions
|
@ -4369,6 +4369,8 @@ static void CG_Draw2D( void )
|
|||
CG_AdjustFrom640Int( &tempX, &tempY, NULL, NULL );
|
||||
cgi_R_Font_DrawString(tempX, tempY, text, colorTable[CT_WHITE], cgs.media.qhFontSmall, -1, FONT_SCALE);
|
||||
}
|
||||
|
||||
cg.drawingHUD = CG_HUD_NORMAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4520,6 +4522,8 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
|
|||
VectorNormalize( vright_n );
|
||||
VectorNormalize( vup_n );
|
||||
|
||||
vr->cgzoommode = cg.zoomMode;
|
||||
|
||||
switch ( stereoView ) {
|
||||
case STEREO_CENTER:
|
||||
separation = 0;
|
||||
|
|
|
@ -338,6 +338,8 @@ vmCvar_t fx_debug;
|
|||
vmCvar_t cg_missionInfoFlashTime;
|
||||
vmCvar_t cg_hudFiles;
|
||||
|
||||
vmCvar_t cg_forceSpeedFOVAdjust;
|
||||
|
||||
vmCvar_t cg_neverHearThatDumbBeepingSoundAgain;
|
||||
|
||||
vmCvar_t vr_weapon_adjustment_1;
|
||||
|
@ -489,6 +491,8 @@ static cvarTable_t cvarTable[] = {
|
|||
{ &cg_missionInfoFlashTime, "cg_missionInfoFlashTime", "10000", 0 },
|
||||
{ &cg_hudFiles, "cg_hudFiles", "ui/jahud.txt", CVAR_ARCHIVE},
|
||||
|
||||
{ &cg_forceSpeedFOVAdjust, "cg_forceSpeedFOVAdjust", "1", CVAR_ARCHIVE},
|
||||
|
||||
//Default Weapon adjustments - these WILL be overridden
|
||||
// scale,right,up,forward,pitch,yaw,roll
|
||||
{ &vr_weapon_adjustment_1, "vr_weapon_adjustment_1", "0.62,-9.8,11.3,-16.1,0.0,0.0,0.0", CVAR_ARCHIVE},
|
||||
|
|
|
@ -1325,24 +1325,32 @@ qboolean CG_CalcFOVFromX( float fov_x )
|
|||
return (inwater);
|
||||
}
|
||||
|
||||
float CG_ForceSpeedFOV( void )
|
||||
float CG_ForceSpeedFOV( float infov )
|
||||
{
|
||||
if (!cg_forceSpeedFOVAdjust.integer)
|
||||
{
|
||||
return infov;
|
||||
}
|
||||
|
||||
gentity_t *player = &g_entities[0];
|
||||
float fov;
|
||||
float timeLeft = player->client->ps.forcePowerDuration[FP_SPEED] - cg.time;
|
||||
float length = FORCE_SPEED_DURATION*forceSpeedValue[player->client->ps.forcePowerLevel[FP_SPEED]];
|
||||
float amt = forceSpeedFOVMod[player->client->ps.forcePowerLevel[FP_SPEED]];
|
||||
if ( timeLeft < 500 )
|
||||
if ( timeLeft < 200 )
|
||||
{//start going back
|
||||
fov = cg_fov.value + (timeLeft)/500*amt;
|
||||
fov = infov + sinf(DEG2RAD((timeLeft/400)*180))*amt;
|
||||
}
|
||||
else if ( length - timeLeft < 1000 )
|
||||
else if ( length - timeLeft < 300 )
|
||||
{//start zooming in
|
||||
fov = cg_fov.value + (length - timeLeft)/1000*amt;
|
||||
fov = infov + sinf(DEG2RAD(((length - timeLeft)/600)*180))*amt;
|
||||
}
|
||||
else
|
||||
{//stay at this FOV
|
||||
fov = cg_fov.value+amt;
|
||||
fov = infov;//+amt;
|
||||
}
|
||||
|
||||
cg.refdef.override_fov = true;
|
||||
return fov;
|
||||
}
|
||||
/*
|
||||
|
@ -1390,13 +1398,13 @@ static qboolean CG_CalcFov( void ) {
|
|||
else
|
||||
{
|
||||
//fov_x = 120;//FIXME: read from the NPC's fov stats?
|
||||
fov_x = vr ? vr->fov_x : 90.0f;
|
||||
fov_x = vr ? vr->fov_x : cg_fov.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( (!cg.zoomMode || cg.zoomMode > 2) && (cg.snap->ps.forcePowersActive&(1<<FP_SPEED)) && player->client->ps.forcePowerDuration[FP_SPEED] )//cg.renderingThirdPerson &&
|
||||
{
|
||||
fov_x = CG_ForceSpeedFOV();
|
||||
fov_x = CG_ForceSpeedFOV(vr ? vr->fov_x : cg_fov.value);
|
||||
//fov_x = vr ? vr->fov : 90.0f;
|
||||
} else {
|
||||
/*
|
||||
|
@ -1415,10 +1423,10 @@ static qboolean CG_CalcFov( void ) {
|
|||
fov_x = 160;
|
||||
}*/
|
||||
|
||||
fov_x = vr ? vr->fov_x : 90.0f;
|
||||
fov_x = vr ? vr->fov_x : cg_fov.value;
|
||||
|
||||
// Disable zooming when in third person
|
||||
if ( cg.zoomMode && cg.zoomMode < 3 )//&& !cg.renderingThirdPerson ) // light amp goggles do none of the zoom silliness
|
||||
if (( cg.zoomMode && cg.zoomMode < 3 ) || cg.zoomMode == 4)//&& !cg.renderingThirdPerson ) // light amp goggles do none of the zoom silliness
|
||||
{
|
||||
if ( !cg.zoomLocked )
|
||||
{
|
||||
|
@ -1430,7 +1438,7 @@ static qboolean CG_CalcFov( void ) {
|
|||
else
|
||||
{
|
||||
// disruptor zooming in faster
|
||||
cg_zoomFov -= cg.frametime * 0.075f;
|
||||
cg_zoomFov += vr->cgzoomdir * cg.frametime * 0.075f;
|
||||
}
|
||||
|
||||
// Clamp zoomFov
|
||||
|
@ -1931,6 +1939,11 @@ static void CG_DrawSkyBoxPortal(void)
|
|||
cg.refdef.fov_x = fov_x;
|
||||
cg.refdef.fov_y = fov_y;
|
||||
*/
|
||||
|
||||
//Don't need any special adjustment for the sky box afaik
|
||||
VectorCopy(vr->hmdorientation, cg.refdef.viewangles);
|
||||
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
|
||||
|
||||
//inherit fov and axis from whatever the player is doing (regular, camera overrides or zoomed, whatever)
|
||||
if ( !cg.hyperspace )
|
||||
{
|
||||
|
@ -1945,9 +1958,6 @@ static void CG_DrawSkyBoxPortal(void)
|
|||
|
||||
cgi_CM_SnapPVS( cg.refdef.vieworg, cg.refdef.areamask ); //fill in my areamask for this view origin
|
||||
|
||||
//Don't need any special adjustment for the sky box afaik
|
||||
VectorCopy(vr->hmdorientation, cg.refdef.viewangles);
|
||||
|
||||
// draw the skybox
|
||||
cgi_R_RenderScene( &cg.refdef );
|
||||
|
||||
|
@ -2125,6 +2135,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
|
|||
);
|
||||
|
||||
vr->third_person = cg.renderingThirdPerson;
|
||||
vr->dualsabers = player->client->ps.dualSabers;
|
||||
|
||||
if ( cg.zoomMode )
|
||||
{
|
||||
|
|
|
@ -1053,7 +1053,7 @@ Add the weapon, and flash for the player's view
|
|||
==============
|
||||
*/
|
||||
extern int PM_TorsoAnimForFrame( gentity_t *ent, int torsoFrame );
|
||||
extern float CG_ForceSpeedFOV( void );
|
||||
extern float CG_ForceSpeedFOV( float infov );
|
||||
|
||||
void CG_AddViewWeapon( playerState_t *ps )
|
||||
{
|
||||
|
@ -1150,7 +1150,7 @@ void CG_AddViewWeapon( playerState_t *ps )
|
|||
float actualFOV;
|
||||
if ( (cg.snap->ps.forcePowersActive&(1<<FP_SPEED)) && player->client->ps.forcePowerDuration[FP_SPEED] )//cg.renderingThirdPerson &&
|
||||
{
|
||||
actualFOV = CG_ForceSpeedFOV();
|
||||
actualFOV = CG_ForceSpeedFOV(cg_fov.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -714,7 +714,7 @@ void rotateAboutOrigin(float x, float y, float rotation, vec2_t out)
|
|||
|
||||
float getHMDYawForCalc()
|
||||
{
|
||||
if (!vr->third_person) {
|
||||
if (!vr->third_person && vr->cgzoommode != 2 && vr->cgzoommode != 4 ) {
|
||||
return vr->hmdorientation[YAW];
|
||||
}
|
||||
return 0.0f;
|
||||
|
|
|
@ -27,6 +27,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|||
#include "w_local.h"
|
||||
|
||||
#include "bg_local.h"
|
||||
#include <JKXR/VrClientInfo.h>
|
||||
|
||||
|
||||
//---------------
|
||||
|
@ -153,9 +154,12 @@ void WP_FireBlaster( gentity_t *ent, qboolean alt_fire )
|
|||
}
|
||||
else
|
||||
{
|
||||
// add some slop to the main-fire direction
|
||||
angs[PITCH] += Q_flrand(-1.0f, 1.0f) * BLASTER_MAIN_SPREAD;
|
||||
angs[YAW] += Q_flrand(-1.0f, 1.0f) * BLASTER_MAIN_SPREAD;
|
||||
if (vr->cgzoommode != 4)
|
||||
{ // much more accurate if using the scope
|
||||
// add some slop to the main-fire direction
|
||||
angs[PITCH] += Q_flrand(-1.0f, 1.0f) * BLASTER_MAIN_SPREAD;
|
||||
angs[YAW] += Q_flrand(-1.0f, 1.0f) * BLASTER_MAIN_SPREAD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue