mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Adds pitch/roll script rotation for mdsprites (bug 2783065).
git-svn-id: https://svn.eduke32.com/eduke32@1375 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
3cd91a1832
commit
77e873b476
1 changed files with 21 additions and 0 deletions
|
@ -3028,7 +3028,28 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
|||
bglScalef(scale * tspr->xrepeat, scale * tspr->xrepeat, scale * tspr->yrepeat);
|
||||
bglTranslatef(0.0f, 0.0, m->zadd * 64);
|
||||
|
||||
// scripted model rotation
|
||||
if (spriteext[tspr->owner].pitch || spriteext[tspr->owner].roll)
|
||||
{
|
||||
float pitchang, rollang, offsets[3];
|
||||
|
||||
pitchang = (float)(spriteext[tspr->owner].pitch) / (2048.0f / 360.0f);
|
||||
rollang = (float)(spriteext[tspr->owner].roll) / (2048.0f / 360.0f);
|
||||
|
||||
offsets[0] = spriteext[tspr->owner].xoff / (scale * tspr->xrepeat);
|
||||
offsets[1] = spriteext[tspr->owner].yoff / (scale * tspr->xrepeat);
|
||||
offsets[2] = (float)(spriteext[tspr->owner].zoff) / 16.0f / (scale * tspr->yrepeat);
|
||||
|
||||
bglTranslatef(-offsets[0], -offsets[1], -offsets[2]);
|
||||
|
||||
bglRotatef(pitchang, 0.0f, 1.0f, 0.0f);
|
||||
bglRotatef(rollang, -1.0f, 0.0f, 0.0f);
|
||||
|
||||
bglTranslatef(offsets[0], offsets[1], offsets[2]);
|
||||
}
|
||||
|
||||
bglGetFloatv(GL_MODELVIEW_MATRIX, spritemodelview);
|
||||
|
||||
bglPopMatrix();
|
||||
bglPushMatrix();
|
||||
bglMultMatrixf(spritemodelview);
|
||||
|
|
Loading…
Reference in a new issue