summaryrefslogtreecommitdiff
path: root/src/cgame/cg_weapons.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-11-24 19:00:52 +0000
committerTim Angus <tim@ngus.net>2005-11-24 19:00:52 +0000
commit63f0272dd145b10c349163ba465fcbcf5ac48e0d (patch)
tree0c34ea6411a1056213f2b0923d771a2726901313 /src/cgame/cg_weapons.c
parente80ad4bf122eb05a5ed0c920e36cf656f98dc6e5 (diff)
* 3D particles
* Brass ejections now done via particle system * static_tranform particle move type * thirdPersonOnly particle and trail system property * Trail jitter now done in two dimensions
Diffstat (limited to 'src/cgame/cg_weapons.c')
-rw-r--r--src/cgame/cg_weapons.c171
1 files changed, 0 insertions, 171 deletions
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 935342ac..7df8b0fa 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -18,147 +18,6 @@
#include "cg_local.h"
/*
-==========================
-CG_MachineGunEjectBrass
-==========================
-*/
-static void CG_MachineGunEjectBrass( centity_t *cent )
-{
- localEntity_t *le;
- refEntity_t *re;
- vec3_t velocity, xvelocity;
- vec3_t offset, xoffset;
- float waterScale = 1.0f;
- vec3_t v[ 3 ];
-
- if( cg_brassTime.integer <= 0 )
- return;
-
- le = CG_AllocLocalEntity( );
- re = &le->refEntity;
-
- velocity[ 0 ] = 0;
- velocity[ 1 ] = -50 + 40 * crandom( );
- velocity[ 2 ] = 100 + 50 * crandom( );
-
- le->leType = LE_FRAGMENT;
- le->startTime = cg.time;
- le->endTime = le->startTime + cg_brassTime.integer + ( cg_brassTime.integer / 4 ) * random( );
-
- le->pos.trType = TR_GRAVITY;
- le->pos.trTime = cg.time - ( rand( ) & 15 );
-
- AnglesToAxis( cent->lerpAngles, v );
-
- offset[ 0 ] = 8;
- offset[ 1 ] = -4;
- offset[ 2 ] = 24;
-
- xoffset[ 0 ] = offset[ 0 ] * v[ 0 ][ 0 ] + offset[ 1 ] * v[ 1 ][ 0 ] + offset[ 2 ] * v[ 2 ][ 0 ];
- xoffset[ 1 ] = offset[ 0 ] * v[ 0 ][ 1 ] + offset[ 1 ] * v[ 1 ][ 1 ] + offset[ 2 ] * v[ 2 ][ 1 ];
- xoffset[ 2 ] = offset[ 0 ] * v[ 0 ][ 2 ] + offset[ 1 ] * v[ 1 ][ 2 ] + offset[ 2 ] * v[ 2 ][ 2 ];
- VectorAdd( cent->lerpOrigin, xoffset, re->origin );
-
- VectorCopy( re->origin, le->pos.trBase );
-
- if( CG_PointContents( re->origin, -1 ) & CONTENTS_WATER )
- waterScale = 0.10f;
-
- xvelocity[ 0 ] = velocity[ 0 ] * v[ 0 ][ 0 ] + velocity[ 1 ] * v[ 1 ][ 0 ] + velocity[ 2 ] * v[ 2 ][ 0 ];
- xvelocity[ 1 ] = velocity[ 0 ] * v[ 0 ][ 1 ] + velocity[ 1 ] * v[ 1 ][ 1 ] + velocity[ 2 ] * v[ 2 ][ 1 ];
- xvelocity[ 2 ] = velocity[ 0 ] * v[ 0 ][ 2 ] + velocity[ 1 ] * v[ 1 ][ 2 ] + velocity[ 2 ] * v[ 2 ][ 2 ];
- VectorScale( xvelocity, waterScale, le->pos.trDelta );
-
- AxisCopy( axisDefault, re->axis );
- re->hModel = cgs.media.machinegunBrassModel;
-
- le->bounceFactor = 0.4 * waterScale;
-
- le->angles.trType = TR_LINEAR;
- le->angles.trTime = cg.time;
- le->angles.trBase[ 0 ] = rand( ) & 31;
- le->angles.trBase[ 1 ] = rand( ) & 31;
- le->angles.trBase[ 2 ] = rand( ) & 31;
- le->angles.trDelta[ 0 ] = 2;
- le->angles.trDelta[ 1 ] = 1;
- le->angles.trDelta[ 2 ] = 0;
-
- le->leFlags = LEF_TUMBLE;
- le->leBounceSoundType = LEBS_BRASS;
- le->leMarkType = LEMT_NONE;
-}
-
-/*
-==========================
-CG_ShotgunEjectBrass
-==========================
-*/
-static void CG_ShotgunEjectBrass( centity_t *cent )
-{
- localEntity_t *le;
- refEntity_t *re;
- vec3_t velocity, xvelocity;
- vec3_t offset, xoffset;
- vec3_t v[ 3 ];
- float waterScale = 1.0f;
-
- if( cg_brassTime.integer <= 0 )
- return;
-
- le = CG_AllocLocalEntity( );
- re = &le->refEntity;
-
- velocity[ 0 ] = 60 + 60 * crandom( );
- velocity[ 1 ] = 40 + 10 * crandom( );
- velocity[ 2 ] = 100 + 50 * crandom( );
-
- le->leType = LE_FRAGMENT;
- le->startTime = cg.time;
- le->endTime = le->startTime + cg_brassTime.integer * 3 + cg_brassTime.integer * random( );
-
- le->pos.trType = TR_GRAVITY;
- le->pos.trTime = cg.time;
-
- AnglesToAxis( cent->lerpAngles, v );
-
- offset[ 0 ] = 8;
- offset[ 1 ] = 0;
- offset[ 2 ] = 24;
-
- xoffset[ 0 ] = offset[ 0 ] * v[ 0 ][ 0 ] + offset[ 1 ] * v[ 1 ][ 0 ] + offset[ 2 ] * v[ 2 ][ 0 ];
- xoffset[ 1 ] = offset[ 0 ] * v[ 0 ][ 1 ] + offset[ 1 ] * v[ 1 ][ 1 ] + offset[ 2 ] * v[ 2 ][ 1 ];
- xoffset[ 2 ] = offset[ 0 ] * v[ 0 ][ 2 ] + offset[ 1 ] * v[ 1 ][ 2 ] + offset[ 2 ] * v[ 2 ][ 2 ];
- VectorAdd( cent->lerpOrigin, xoffset, re->origin );
- VectorCopy( re->origin, le->pos.trBase );
-
- if( CG_PointContents( re->origin, -1 ) & CONTENTS_WATER )
- waterScale = 0.10f;
-
- xvelocity[ 0 ] = velocity[ 0 ] * v[ 0 ][ 0 ] + velocity[ 1 ] * v[ 1 ][ 0 ] + velocity[ 2 ] * v[ 2 ][ 0 ];
- xvelocity[ 1 ] = velocity[ 0 ] * v[ 0 ][ 1 ] + velocity[ 1 ] * v[ 1 ][ 1 ] + velocity[ 2 ] * v[ 2 ][ 1 ];
- xvelocity[ 2 ] = velocity[ 0 ] * v[ 0 ][ 2 ] + velocity[ 1 ] * v[ 1 ][ 2 ] + velocity[ 2 ] * v[ 2 ][ 2 ];
- VectorScale( xvelocity, waterScale, le->pos.trDelta );
-
- AxisCopy( axisDefault, re->axis );
- re->hModel = cgs.media.shotgunBrassModel;
- le->bounceFactor = 0.3f;
-
- le->angles.trType = TR_LINEAR;
- le->angles.trTime = cg.time;
- le->angles.trBase[ 0 ] = rand( )&31;
- le->angles.trBase[ 1 ] = rand( )&31;
- le->angles.trBase[ 2 ] = rand( )&31;
- le->angles.trDelta[ 0 ] = 1;
- le->angles.trDelta[ 1 ] = 0.5;
- le->angles.trDelta[ 2 ] = 0;
-
- le->leFlags = LEF_TUMBLE;
- le->leBounceSoundType = LEBS_BRASS;
- le->leMarkType = LEMT_NONE;
-}
-
-
-/*
=================
CG_RegisterUpgrade
@@ -809,19 +668,6 @@ void CG_RegisterWeapon( int weaponNum )
//FIXME:
for( i = WPM_NONE + 1; i < WPM_NUM_WEAPONMODES; i++ )
weaponInfo->wim[ i ].loopFireSound = qfalse;
-
- switch( weaponNum )
- {
- case WP_MACHINEGUN:
- case WP_MGTURRET:
- case WP_CHAINGUN:
- weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
- break;
-
- case WP_SHOTGUN:
- weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
- break;
- }
}
/*
@@ -1670,23 +1516,6 @@ void CG_FireWeapon( centity_t *cent, weaponMode_t weaponMode )
if( wi->wim[ weaponMode ].flashSound[ c ] )
trap_S_StartSound( NULL, es->number, CHAN_WEAPON, wi->wim[ weaponMode ].flashSound[ c ] );
}
-
- // do brass ejection
- if( wi->ejectBrassFunc && cg_brassTime.integer > 0 )
- {
- if( es->eType == ET_BUILDABLE )
- {
- //yucko hack to get turret brass ejecting with the barrel instead of the base
- vec3_t temp;
-
- VectorCopy( cent->lerpAngles, temp );
- VectorCopy( es->angles2, cent->lerpAngles );
- wi->ejectBrassFunc( cent );
- VectorCopy( temp, cent->lerpAngles );
- }
- else
- wi->ejectBrassFunc( cent );
- }
}