mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- some adjustments for voxels.
This commit is contained in:
parent
379d5bc0c5
commit
37bb816850
3 changed files with 9 additions and 9 deletions
|
@ -421,8 +421,8 @@ void gl_InitModels()
|
|||
memset(&smf, 0, sizeof(smf));
|
||||
smf.models[0] = md;
|
||||
smf.skins[0] = md->GetPaletteTexture();
|
||||
smf.xscale = smf.yscale = smf.zscale = FIXED2FLOAT(VoxelDefs[i]->Scale);
|
||||
smf.angleoffset = VoxelDefs[i]->AngleOffset;
|
||||
smf.xscale = smf.yscale = smf.zscale = VoxelDefs[i]->Scale;
|
||||
smf.angleoffset = VoxelDefs[i]->AngleOffset.Degrees;
|
||||
if (VoxelDefs[i]->PlacedSpin != 0)
|
||||
{
|
||||
smf.yrotate = 1.f;
|
||||
|
@ -523,7 +523,7 @@ void gl_InitModels()
|
|||
else if (sc.Compare("angleoffset"))
|
||||
{
|
||||
sc.MustGetFloat();
|
||||
smf.angleoffset = FLOAT2ANGLE(sc.Float);
|
||||
smf.angleoffset = sc.Float;
|
||||
}
|
||||
else if (sc.Compare("pitchoffset"))
|
||||
{
|
||||
|
@ -919,7 +919,7 @@ void gl_RenderModel(GLSprite * spr)
|
|||
gl_RenderState.mModelMatrix.translate(smf->xoffset / smf->xscale, smf->zoffset / smf->zscale, smf->yoffset / smf->yscale);
|
||||
|
||||
// 5) Applying model rotations.
|
||||
gl_RenderState.mModelMatrix.rotate(-ANGLE2FLOAT(smf->angleoffset), 0, 1, 0);
|
||||
gl_RenderState.mModelMatrix.rotate(-smf->angleoffset, 0, 1, 0);
|
||||
gl_RenderState.mModelMatrix.rotate(smf->pitchoffset, 0, 0, 1);
|
||||
gl_RenderState.mModelMatrix.rotate(-smf->rolloffset, 1, 0, 0);
|
||||
|
||||
|
@ -982,7 +982,7 @@ void gl_RenderHUDModel(pspdef_t *psp, fixed_t ofsx, fixed_t ofsy)
|
|||
gl_RenderState.mViewMatrix.rotate(90.f, 0, 1, 0);
|
||||
|
||||
// Applying angleoffset, pitchoffset, rolloffset.
|
||||
gl_RenderState.mViewMatrix.rotate(-ANGLE2FLOAT(smf->angleoffset), 0, 1, 0);
|
||||
gl_RenderState.mViewMatrix.rotate(-smf->angleoffset, 0, 1, 0);
|
||||
gl_RenderState.mViewMatrix.rotate(smf->pitchoffset, 0, 0, 1);
|
||||
gl_RenderState.mViewMatrix.rotate(-smf->rolloffset, 1, 0, 0);
|
||||
gl_RenderState.ApplyMatrices();
|
||||
|
|
|
@ -354,7 +354,7 @@ struct FSpriteModelFrame
|
|||
short frame;
|
||||
FState * state; // for later!
|
||||
int hashnext;
|
||||
angle_t angleoffset;
|
||||
float angleoffset;
|
||||
// added pithoffset, rolloffset.
|
||||
float pitchoffset, rolloffset; // I don't want to bother with type transformations, so I made this variables float.
|
||||
};
|
||||
|
|
|
@ -253,9 +253,9 @@ unsigned int FVoxelModel::AddVertex(FModelVertex &vert, FVoxelMap &check)
|
|||
|
||||
void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, BYTE col, FVoxelMap &check)
|
||||
{
|
||||
float PivotX = mVoxel->Mips[0].PivotX / 256.f;
|
||||
float PivotY = mVoxel->Mips[0].PivotY / 256.f;
|
||||
float PivotZ = mVoxel->Mips[0].PivotZ / 256.f;
|
||||
float PivotX = mVoxel->Mips[0].Pivot.X;
|
||||
float PivotY = mVoxel->Mips[0].Pivot.Y;
|
||||
float PivotZ = mVoxel->Mips[0].Pivot.Z;
|
||||
int h = mVoxel->Mips[0].SizeZ;
|
||||
FModelVertex vert;
|
||||
unsigned int indx[4];
|
||||
|
|
Loading…
Reference in a new issue