chasing/embodying the followed player (currently with translucent display of client during "embodiment")
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1868 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+12
-3
@@ -328,6 +328,7 @@ void recomputecamera()
|
||||
camera1 = player1;
|
||||
break;
|
||||
case SM_FOLLOWPLAYER:
|
||||
case SM_EMBODYPLAYER:
|
||||
if(!players.inrange(player1->followplayercn) || !players[player1->followplayercn])
|
||||
{
|
||||
toggledeathcam();
|
||||
@@ -347,9 +348,16 @@ void recomputecamera()
|
||||
camera1 = &followcam;
|
||||
}
|
||||
followcam.o = p->o;
|
||||
followcam.o.x -= (float)(cosf(RAD*(p->yaw-90)))*p->radius*1.5f;
|
||||
followcam.o.y -= (float)(sinf(RAD*(p->yaw-90)))*p->radius*1.5f;
|
||||
followcam.o.z += p->eyeheight/3.0f;
|
||||
if(player1->spectating == SM_FOLLOWPLAYER)
|
||||
{
|
||||
followcam.o.x -= (float)(cosf(RAD*(p->yaw-90)))*p->radius*1.5f;
|
||||
followcam.o.y -= (float)(sinf(RAD*(p->yaw-90)))*p->radius*1.5f;
|
||||
followcam.o.z += p->eyeheight/3.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
followcam.o.z += p->eyeheight/6.0f;
|
||||
}
|
||||
followcam.yaw = p->yaw;
|
||||
break;
|
||||
}
|
||||
@@ -655,6 +663,7 @@ void drawhudgun(int w, int h, float aspect, int farplane)
|
||||
sethudgunperspective(true);
|
||||
|
||||
if(hudgun && player1->state==CS_ALIVE) player1->weaponsel->renderhudmodel();
|
||||
//if(hudgun && player1->state==CS_SPECTATE && players[player1->followplayercn]) players[player1->followplayercn]->weaponsel->renderhudmodel();
|
||||
rendermenumdl();
|
||||
|
||||
sethudgunperspective(false);
|
||||
|
||||
@@ -439,6 +439,7 @@ void renderclient(playerent *d, const char *mdlname, const char *vwepname, int t
|
||||
vec o(d->o);
|
||||
o.z -= d->dyneyeheight();
|
||||
int basetime = -((int)(size_t)d&0xFFF);
|
||||
//if(player1->state == CS_SPECTATE && d->clientnum == player1->followplayercn) return; // don't draw followed player (or see below for "see through")
|
||||
if(d->state==CS_DEAD)
|
||||
{
|
||||
if(d==player1 && d->allowmove()) return;
|
||||
@@ -473,6 +474,7 @@ void renderclient(playerent *d, const char *mdlname, const char *vwepname, int t
|
||||
a[0].name = vwepname;
|
||||
a[0].tag = "tag_weapon";
|
||||
}
|
||||
if(player1->state == CS_SPECTATE && d->clientnum == player1->followplayercn && player1->spectating == SM_EMBODYPLAYER) anim |= ANIM_TRANSLUCENT; // see through followed player
|
||||
rendermodel(mdlname, anim, tex, 1.5f, o, d->yaw+90, d->pitch/4, speed, basetime, d, a);
|
||||
if(isteam(player1->team, d->team)) renderaboveheadicon(d);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user