Visual Sloping: fixed a problem where slopes were not computed correctly in certain cases

This commit is contained in:
biwa 2020-10-19 17:32:34 +02:00
parent 7b76002f2b
commit 2217e6f633

View file

@ -315,14 +315,10 @@ namespace CodeImp.DoomBuilder.VisualModes
Plane originalplane = level.plane;
Plane pivotplane = ((VisualSidedefSlope)pivothandle).Level.plane;
// Build a new plane. p1 and p2 are the points of the slope handle that is modified, p3 is on the line of the pivot handle
Vector3D p1 = new Vector3D(sidedef.Line.Start.Position, Math.Round(originalplane.GetZ(sidedef.Line.Start.Position)));
Vector3D p2 = new Vector3D(sidedef.Line.End.Position, Math.Round(originalplane.GetZ(sidedef.Line.End.Position)));
Vector3D p3 = new Vector3D(((VisualSidedefSlope)pivothandle).Sidedef.Line.Line.GetCoordinatesAt(0.5f), Math.Round(pivotplane.GetZ(((VisualSidedefSlope)pivothandle).Sidedef.Line.Line.GetCoordinatesAt(0.5f))));
// Move the points of the handle up/down
p1 += new Vector3D(0f, 0f, amount);
p2 += new Vector3D(0f, 0f, amount);
// Build a new plane. p1 and p2 are the points of the slope handle that is modified, with the changed amound added; p3 is on the line of the pivot handle
Vector3D p1 = new Vector3D(sidedef.Line.Start.Position, originalplane.GetZ(sidedef.Line.Start.Position) + amount);
Vector3D p2 = new Vector3D(sidedef.Line.End.Position, originalplane.GetZ(sidedef.Line.End.Position) + amount);
Vector3D p3 = new Vector3D(((VisualSidedefSlope)pivothandle).Sidedef.Line.Line.GetCoordinatesAt(0.5), pivotplane.GetZ(((VisualSidedefSlope)pivothandle).Sidedef.Line.Line.GetCoordinatesAt(0.5)));
Plane plane = new Plane(p1, p2, p3, true);