summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-14 00:57:46 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:14 +0100
commite52255589bcd37a841cf275e13ae1abf427c7c79 (patch)
tree5045c7cca6553ef0879ae37f3ce2b82ad6b6efc2
parentc823eaf3beb186dc4cf42fb4a41be1291069d77a (diff)
drop the use of the origin and angles fields of entityState_t in the cgame module (use lerp values instead)
-rw-r--r--src/cgame/cg_animmapobj.c1
-rw-r--r--src/cgame/cg_buildable.c4
-rw-r--r--src/cgame/cg_ents.c5
-rw-r--r--src/cgame/cg_players.c2
-rw-r--r--src/cgame/cg_predict.c2
-rw-r--r--src/cgame/cg_snapshot.c4
6 files changed, 5 insertions, 13 deletions
diff --git a/src/cgame/cg_animmapobj.c b/src/cgame/cg_animmapobj.c
index 4bc94a41..e02d1756 100644
--- a/src/cgame/cg_animmapobj.c
+++ b/src/cgame/cg_animmapobj.c
@@ -147,7 +147,6 @@ void CG_AnimMapObj( centity_t *cent )
memset( &ent, 0, sizeof( ent ) );
- VectorCopy( es->angles, cent->lerpAngles );
AnglesToAxis( cent->lerpAngles, ent.axis );
ent.hModel = cgs.gameModels[ es->modelindex ];
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 33a3cc0e..256f9816 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -1288,7 +1288,6 @@ void CG_Buildable( centity_t *cent )
{
refEntity_t ent;
entityState_t *es = &cent->currentState;
- vec3_t angles;
vec3_t surfNormal, xNormal, mins, maxs;
vec3_t refNormal = { 0.0f, 0.0f, 1.0f };
float rotAngle;
@@ -1313,7 +1312,6 @@ void CG_Buildable( centity_t *cent )
VectorCopy( es->origin2, surfNormal );
- VectorCopy( es->angles, angles );
BG_BuildableBoundingBox( es->modelindex, mins, maxs );
if( es->pos.trType == TR_STATIONARY )
@@ -1332,7 +1330,7 @@ void CG_Buildable( centity_t *cent )
}
else
{
- CG_PositionAndOrientateBuildable( angles, cent->lerpOrigin, surfNormal,
+ CG_PositionAndOrientateBuildable( cent->lerpAngles, cent->lerpOrigin, surfNormal,
es->number, mins, maxs, ent.axis,
ent.origin );
VectorCopy( ent.axis[ 0 ], cent->buildableCache.axis[ 0 ] );
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index d32318e7..e8d60f4d 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -408,9 +408,6 @@ static void CG_Missile( centity_t *cent )
wim = &wi->wim[ weaponMode ];
- // calculate the axis
- VectorCopy( es->angles, cent->lerpAngles );
-
// add dynamic light
if( wim->missileDlight )
{
@@ -655,7 +652,7 @@ static void CG_LightFlare( centity_t *cent )
flare.renderfx |= RF_DEPTHHACK;
//bunch of geometry
- AngleVectors( es->angles, forward, NULL, NULL );
+ AngleVectors( cent->lerpAngles, forward, NULL, NULL );
VectorCopy( cent->lerpOrigin, flare.origin );
VectorSubtract( flare.origin, cg.refdef.vieworg, delta );
len = VectorLength( delta );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 6338ceaf..9038a94f 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2176,8 +2176,6 @@ void CG_Corpse( centity_t *cent )
BG_ClassBoundingBox( es->clientNum, aliveZ, NULL, NULL, deadZ, NULL );
origin[ 2 ] -= ( aliveZ[ 2 ] - deadZ[ 2 ] );
- VectorCopy( es->angles, cent->lerpAngles );
-
// get the rotation information
if( !ci->nonsegmented )
CG_PlayerAngles( cent, cent->lerpAngles, legs.axis, torso.axis, head.axis );
diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c
index c2e2e113..af48bf96 100644
--- a/src/cgame/cg_predict.c
+++ b/src/cgame/cg_predict.c
@@ -273,7 +273,7 @@ int CG_PointContents( const vec3_t point, int passEntityNum )
if( !cmodel )
continue;
- contents |= trap_CM_TransformedPointContents( point, cmodel, ent->origin, ent->angles );
+ contents |= trap_CM_TransformedPointContents( point, cmodel, cent->lerpOrigin, cent->lerpAngles );
}
return contents;
diff --git a/src/cgame/cg_snapshot.c b/src/cgame/cg_snapshot.c
index 3862c787..5567884b 100644
--- a/src/cgame/cg_snapshot.c
+++ b/src/cgame/cg_snapshot.c
@@ -41,8 +41,8 @@ static void CG_ResetEntity( centity_t *cent )
cent->trailTime = cg.snap->serverTime;
- VectorCopy( cent->currentState.origin, cent->lerpOrigin );
- VectorCopy( cent->currentState.angles, cent->lerpAngles );
+ VectorCopy( cent->currentState.pos.trBase, cent->lerpOrigin );
+ VectorCopy( cent->currentState.apos.trBase, cent->lerpAngles );
if( cent->currentState.eType == ET_PLAYER )
CG_ResetPlayerEntity( cent );