diff --git a/src/common/models/voxels.h b/src/common/models/voxels.h index b4a1cdfcd13..7d02bba136c 100644 --- a/src/common/models/voxels.h +++ b/src/common/models/voxels.h @@ -70,6 +70,9 @@ struct FVoxelDef int VoxeldefIndex; // Needed by GZDoom double Scale; DAngle AngleOffset;// added to actor's angle to compensate for wrong-facing voxels + bool PitchFromMomentum; + bool UseActorPitch; + bool UseActorRoll; }; extern TDeletingArray Voxels; // used only to auto-delete voxels on exit. diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 81fd60d0c08..444bb46a86d 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -390,6 +390,9 @@ void InitModels() smf.skinIDs[0] = md->GetPaletteTexture(); smf.xscale = smf.yscale = smf.zscale = VoxelDefs[i]->Scale; smf.angleoffset = VoxelDefs[i]->AngleOffset.Degrees; + if (VoxelDefs[i]->PitchFromMomentum) smf.flags |= MDL_PITCHFROMMOMENTUM; + if (VoxelDefs[i]->UseActorPitch) smf.flags |= MDL_USEACTORPITCH; + if (VoxelDefs[i]->UseActorRoll) smf.flags |= MDL_USEACTORROLL; if (VoxelDefs[i]->PlacedSpin != 0) { smf.yrotate = 1.f; diff --git a/src/r_data/voxeldef.cpp b/src/r_data/voxeldef.cpp index 300872ffc0e..237a77c580f 100644 --- a/src/r_data/voxeldef.cpp +++ b/src/r_data/voxeldef.cpp @@ -53,7 +53,8 @@ struct VoxelOptions { VoxelOptions() - : DroppedSpin(0), PlacedSpin(0), Scale(1.), AngleOffset(90.), OverridePalette(false) + : DroppedSpin(0), PlacedSpin(0), Scale(1.), AngleOffset(90.), OverridePalette(false), + PitchFromMomentum(false), UseActorPitch(false), UseActorRoll(false) {} int DroppedSpin; @@ -61,6 +62,9 @@ struct VoxelOptions double Scale; DAngle AngleOffset; bool OverridePalette; + bool PitchFromMomentum; + bool UseActorPitch; + bool UseActorRoll; }; void VOX_AddVoxel(int sprnum, int frame, FVoxelDef* def); @@ -180,6 +184,18 @@ static void VOX_ReadOptions(FScanner &sc, VoxelOptions &opts) { opts.OverridePalette = true; } + else if (sc.Compare("pitchfrommomentum")) + { + opts.PitchFromMomentum = true; + } + else if (sc.Compare("useactorpitch")) + { + opts.UseActorPitch = true; + } + else if (sc.Compare("useactorroll")) + { + opts.UseActorRoll = true; + } else { sc.ScriptMessage("Unknown voxel option '%s'\n", sc.String); @@ -249,6 +265,9 @@ void R_InitVoxels() def->DroppedSpin = opts.DroppedSpin; def->PlacedSpin = opts.PlacedSpin; def->AngleOffset = opts.AngleOffset; + def->PitchFromMomentum = opts.PitchFromMomentum; + def->UseActorPitch = opts.UseActorPitch; + def->UseActorRoll = opts.UseActorRoll; VoxelDefs.Push(def); for (unsigned i = 0; i < vsprites.Size(); ++i)