diff --git a/source/src/md2.h b/source/src/md2.h index f810e942..014c8eba 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -177,14 +177,10 @@ struct md2 : vertmodel } }; - void render(int anim, int varseed, float speed, int basetime, const vec &o, float roll, float yaw, float pitch, dynent *d, modelattach *a, float scale) + void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a, float scale) { if(!loaded) return; - pitch += offsetpitch; - yaw += offsetyaw; - roll += offsetroll; - if(a) for(int i = 0; a[i].tag; i++) { if(a[i].pos) link(NULL, a[i].tag, a[i].pos); @@ -210,7 +206,6 @@ struct md2 : vertmodel matrixstack[0].translate(o); matrixstack[0].rotate_around_z((yaw+180)*RAD); matrixstack[0].rotate_around_y(-pitch*RAD); - matrixstack[0].rotate_around_x(roll*RAD); if(anim&ANIM_MIRROR || scale!=1) matrixstack[0].scale(scale, anim&ANIM_MIRROR ? -scale : scale, scale); parts[0]->render(anim, varseed, speed, basetime, d); @@ -225,7 +220,7 @@ struct md2 : vertmodel if(!m) continue; m->parts[0]->index = parts.length()+i; m->setskin(); - m->render(anim, varseed, speed, basetime, o, roll, yaw, pitch, d, NULL, scale); + m->render(anim, varseed, speed, basetime, o, yaw, pitch, d, NULL, scale); } if(d) d->lastrendered = lastmillis; @@ -338,4 +333,3 @@ void md2emit(char *tag, int *type, int *arg1, int *arg2) COMMAND(md2anim, "siif"); COMMAND(md2tag, "sssss"); COMMAND(md2emit, "siii"); - diff --git a/source/src/md3.h b/source/src/md3.h index bc926cc8..e16cc3e6 100644 --- a/source/src/md3.h +++ b/source/src/md3.h @@ -153,14 +153,10 @@ struct md3 : vertmodel } }; - void render(int anim, int varseed, float speed, int basetime, const vec &o, float roll, float yaw, float pitch, dynent *d, modelattach *a, float scale) + void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a, float scale) { if(!loaded) return; - pitch += offsetpitch; - yaw += offsetyaw; - roll += offsetroll; - if(a) for(int i = 0; a[i].tag; i++) { vertmodel *m = (vertmodel *)a[i].m; @@ -181,7 +177,6 @@ struct md3 : vertmodel shadowdir = vec(0, 1/SQRT2, -1/SQRT2); shadowdir.rotate_around_z((-shadowyaw-yaw-180.0f)*RAD); shadowdir.rotate_around_y(-pitch*RAD); - shadowdir.rotate_around_x(roll*RAD); (shadowpos = shadowdir).mul(shadowdist); } @@ -194,7 +189,6 @@ struct md3 : vertmodel matrixstack[0].translate(o); matrixstack[0].rotate_around_z((yaw+180)*RAD); matrixstack[0].rotate_around_y(-pitch*RAD); - matrixstack[0].rotate_around_x(roll*RAD); if(anim&ANIM_MIRROR || scale!=1) matrixstack[0].scale(scale, anim&ANIM_MIRROR ? -scale : scale, scale); parts[0]->render(anim, varseed, speed, basetime, d); diff --git a/source/src/model.h b/source/src/model.h index f376b09b..033fef5f 100644 --- a/source/src/model.h +++ b/source/src/model.h @@ -42,11 +42,11 @@ class dynent; struct model { bool cullface, vertexlight; - float alphatest, translucency, scale, radius, shadowdist, offsetroll, offsetyaw, offsetpitch; + float alphatest, translucency, scale, radius, shadowdist; vec translate; int cachelimit, batch; - model() : offsetroll(0), offsetyaw(0), offsetpitch(0), cullface(true), vertexlight(false), alphatest(0.9f), translucency(0.25f), scale(1), radius(0), shadowdist(0), translate(0, 0, 0), cachelimit(8), batch(-1) {} + model() : cullface(true), vertexlight(false), alphatest(0.9f), translucency(0.25f), scale(1), radius(0), shadowdist(0), translate(0, 0, 0), cachelimit(8), batch(-1) {} virtual ~model() {} virtual bool load() = 0; @@ -55,7 +55,7 @@ struct model virtual void cleanup() = 0; - virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float roll, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0; + virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0; virtual void setskin(int tex = 0) = 0; virtual void genshadows(float height, float rad) {} diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 3717c8b7..7783d833 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -79,27 +79,6 @@ void mdlcachelimit(int *limit) COMMAND(mdlcachelimit, "i"); -void mdlroll(float *angle) -{ - checkmdl; - loadingmodel->offsetroll = *angle; -} -COMMAND(mdlroll, "f"); - -void mdlyaw(float *angle) -{ - checkmdl; - loadingmodel->offsetyaw = *angle; -} -COMMAND(mdlyaw, "f"); - -void mdlpitch(float *angle) -{ - checkmdl; - loadingmodel->offsetpitch = *angle; -} -COMMAND(mdlpitch, "f"); - vector mapmodels; void mapmodel(int *rad, int *h, int *zoff, char *snap, char *name) @@ -180,7 +159,7 @@ struct batchedmodel { vec o; int anim, varseed, tex; - float roll, yaw, pitch, speed; + float yaw, pitch, speed; int basetime; playerent *d; int attached; @@ -226,7 +205,7 @@ void renderbatchedmodel(model *m, batchedmodel &b) if(stenciling) { - m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale); + m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.yaw, b.pitch, b.d, a, b.scale); return; } @@ -243,7 +222,7 @@ void renderbatchedmodel(model *m, batchedmodel &b) if(b.anim&ANIM_TRANSLUCENT) { glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale); + m->render(b.anim|ANIM_NOSKIN, b.varseed, b.speed, b.basetime, b.o, b.yaw, b.pitch, b.d, a, b.scale); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthFunc(GL_LEQUAL); @@ -255,7 +234,7 @@ void renderbatchedmodel(model *m, batchedmodel &b) glColor4f(color[0], color[1], color[2], m->translucency); } - m->render(b.anim, b.varseed, b.speed, b.basetime, b.o, b.roll, b.yaw, b.pitch, b.d, a, b.scale); + m->render(b.anim, b.varseed, b.speed, b.basetime, b.o, b.yaw, b.pitch, b.d, a, b.scale); if(b.anim&ANIM_TRANSLUCENT) { @@ -427,7 +406,7 @@ void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, fl if(stenciling) { m->startrender(); - m->render(anim|ANIM_NOSKIN, varseed, speed, basetime, o, 0, yaw, pitch, d, a, scale); + m->render(anim|ANIM_NOSKIN, varseed, speed, basetime, o, yaw, pitch, d, a, scale); m->endrender(); return; } @@ -466,7 +445,7 @@ void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, fl if(anim&ANIM_TRANSLUCENT) { glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - m->render(anim|ANIM_NOSKIN, varseed, speed, basetime, o, 0, yaw, pitch, d, a, scale); + m->render(anim|ANIM_NOSKIN, varseed, speed, basetime, o, yaw, pitch, d, a, scale); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthFunc(GL_LEQUAL); @@ -478,7 +457,7 @@ void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, fl glColor4f(color[0], color[1], color[2], m->translucency); } - m->render(anim, varseed, speed, basetime, o, 0, yaw, pitch, d, a, scale); + m->render(anim, varseed, speed, basetime, o, yaw, pitch, d, a, scale); if(anim&ANIM_TRANSLUCENT) { @@ -751,4 +730,3 @@ void renderclients() loopv(players) if((d = players[i]) && d->state!=CS_SPAWNING && d->state!=CS_SPECTATE && (!player1->isspectating() || player1->spectatemode != SM_FOLLOW1ST || player1->followplayercn != i)) renderclient(d); if(player1->state==CS_DEAD || (reflecting && !refracting)) renderclient(player1); } -