Add X, Y and Z offsets for VOXELDEF. Needed for voxelized weapons which would typically be very large and take up the majority of the 256x256x256 canvas, therefore making precise positioning of the models relative to the screen pretty much impossible without tweakable offsets.

This commit is contained in:
nashmuhandes 2024-06-17 01:19:58 +08:00 committed by Ricardo Luís Vaz Silva
commit 2e4bf697b8
4 changed files with 63 additions and 0 deletions

View file

@ -616,6 +616,9 @@ void InitModels()
smf.animationIDs[0] = -1;
smf.xscale = smf.yscale = smf.zscale = VoxelDefs[i]->Scale;
smf.angleoffset = VoxelDefs[i]->AngleOffset.Degrees();
smf.xoffset = VoxelDefs[i]->xoffset;
smf.yoffset = VoxelDefs[i]->yoffset;
smf.zoffset = VoxelDefs[i]->zoffset;
// this helps catching uninitialized data.
assert(VoxelDefs[i]->PitchFromMomentum == true || VoxelDefs[i]->PitchFromMomentum == false);
if (VoxelDefs[i]->PitchFromMomentum) smf.flags |= MDL_PITCHFROMMOMENTUM;