offsetyaw cleanups

master
Lee Salzman 2013-05-10 15:27:59 +03:00
parent a46d9ee122
commit 5ae640eb56
4 changed files with 5 additions and 7 deletions

View File

@ -1048,7 +1048,7 @@ struct animmodel : model
{
if(!loaded) return -1;
yaw += spinyaw*lastmillis/1000.0f;
yaw += offsetyaw + spinyaw*lastmillis/1000.0f;
pitch += offsetpitch + spinpitch*lastmillis/1000.0f;
vec axis(0, -1, 0), forward(1, 0, 0);
@ -1061,7 +1061,6 @@ struct animmodel : model
matrixstack[0].rotate_around_z(yaw*RAD);
matrixstack[0].transformnormal(vec(axis), axis);
matrixstack[0].transformnormal(vec(forward), forward);
if(offsetyaw) matrixstack[0].rotate_around_z(offsetyaw*RAD);
}
else
{
@ -1166,7 +1165,7 @@ struct animmodel : model
{
if(!loaded) return;
yaw += spinyaw*lastmillis/1000.0f;
yaw += offsetyaw + spinyaw*lastmillis/1000.0f;
pitch += offsetpitch + spinpitch*lastmillis/1000.0f;
vec axis(0, -1, 0), forward(1, 0, 0);
@ -1179,7 +1178,6 @@ struct animmodel : model
matrixstack[0].rotate_around_z(yaw*RAD);
matrixstack[0].transformnormal(vec(axis), axis);
matrixstack[0].transformnormal(vec(forward), forward);
if(offsetyaw) matrixstack[0].rotate_around_z(offsetyaw*RAD);
}
else
{

View File

@ -1091,7 +1091,7 @@ VAR(testpitch, -90, 0, 90);
void renderclient(dynent *d, const char *mdlname, modelattach *attachments, int hold, int attack, int attackdelay, int lastaction, int lastpain, float scale, bool ragdoll, float trans)
{
int anim = hold ? hold : ANIM_IDLE|ANIM_LOOP;
float yaw = testanims && d==player ? 0 : d->yaw+90,
float yaw = testanims && d==player ? 0 : d->yaw,
pitch = testpitch && d==player ? testpitch : d->pitch;
vec o = d->feetpos();
int basetime = 0;

View File

@ -539,7 +539,7 @@ struct collectclientmode : clientmode
int dteam = collectteambase(d->team);
loopj(d->tokens)
{
rendermodel(dteam != team ? "skull/blue" : "skull/red", ANIM_MAPMODEL|ANIM_LOOP, pos, d->yaw+90, 0, MDL_CULL_VFC | MDL_CULL_DIST | MDL_CULL_OCCLUDED);
rendermodel(dteam != team ? "skull/blue" : "skull/red", ANIM_MAPMODEL|ANIM_LOOP, pos, d->yaw, 0, MDL_CULL_VFC | MDL_CULL_DIST | MDL_CULL_OCCLUDED);
pos.z += TOKENHEIGHT + 1;
}
}

View File

@ -310,7 +310,7 @@ namespace game
base = 0;
interp = &guninterp;
}
rendermodel(gunname, anim, sway, testhudgun ? 0 : d->yaw+90, testhudgun ? 0 : d->pitch, MDL_NOBATCH, interp, a, base, (int)ceil(speed));
rendermodel(gunname, anim, sway, testhudgun ? 0 : d->yaw, testhudgun ? 0 : d->pitch, MDL_NOBATCH, interp, a, base, (int)ceil(speed));
if(d->muzzle.x >= 0) d->muzzle = calcavatarpos(d->muzzle, 12);
}