Resetting a slope in Sector Edit Form UDMF or with the Reset Slope action will not set the height to the z position at the center of the sector anymore, but to its original height

This commit is contained in:
biwa 2021-04-18 21:16:28 +02:00
parent 83adef923d
commit 7d67ec2be9
2 changed files with 25 additions and 2 deletions

View file

@ -1855,6 +1855,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
Sector fs = General.GetByIndex(sectors, 0);
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
/*
if (fs.CeilSlope.IsNormalized())
{
fs.UpdateBBox();
@ -1863,15 +1866,21 @@ namespace CodeImp.DoomBuilder.Windows
}
else
ceilingslopecontrol.SetOffset(fs.CeilHeight, true);
*/
ceilingslopecontrol.SetOffset(fs.CeilHeight, true);
foreach (Sector s in sectors)
{
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
/*
if (s.CeilSlope.IsNormalized())
{
s.UpdateBBox();
Plane p = new Plane(s.CeilSlope, s.CeilSlopeOffset);
s.CeilHeight = (int)Math.Round(p.GetZ(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2));
}
*/
s.CeilSlope = new Vector3D();
s.CeilSlopeOffset = double.NaN;
@ -1890,6 +1899,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
Sector fs = General.GetByIndex(sectors, 0);
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
/*
if (fs.FloorSlope.IsNormalized())
{
fs.UpdateBBox();
@ -1898,15 +1910,22 @@ namespace CodeImp.DoomBuilder.Windows
}
else
floorslopecontrol.SetOffset(fs.FloorHeight, true);
*/
floorslopecontrol.SetOffset(fs.FloorHeight, true);
foreach (Sector s in sectors)
{
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
/*
if (s.FloorSlope.IsNormalized())
{
s.UpdateBBox();
Plane p = new Plane(s.FloorSlope, s.FloorSlopeOffset);
s.FloorHeight = (int)Math.Round(p.GetZ(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2));
}
*/
s.FloorSlope = new Vector3D();
s.FloorSlopeOffset = double.NaN;

View file

@ -4423,7 +4423,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (applytoceiling)
{
// Set the ceiling height to something hopefully sensible
level.sector.CeilHeight = (int)Math.Round(level.plane.GetZ(level.sector.BBox.X + level.sector.BBox.Width / 2, level.sector.BBox.Y + level.sector.BBox.Height / 2));
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
//level.sector.CeilHeight = (int)Math.Round(level.plane.GetZ(level.sector.BBox.X + level.sector.BBox.Width / 2, level.sector.BBox.Y + level.sector.BBox.Height / 2));
level.sector.CeilSlopeOffset = double.NaN;
level.sector.CeilSlope = new Vector3D();
@ -4432,7 +4434,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
else
{
// Set the floor height to something hopefully sensible
level.sector.FloorHeight = (int)Math.Round(level.plane.GetZ(level.sector.BBox.X + level.sector.BBox.Width / 2, level.sector.BBox.Y + level.sector.BBox.Height / 2));
// biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
// that will result in pretty crazy values of 3D floor control sectors
//level.sector.FloorHeight = (int)Math.Round(level.plane.GetZ(level.sector.BBox.X + level.sector.BBox.Width / 2, level.sector.BBox.Y + level.sector.BBox.Height / 2));
level.sector.FloorSlopeOffset = double.NaN;
level.sector.FloorSlope = new Vector3D();