mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Edit Selection Mode: flipping now works on plane equation slopes
This commit is contained in:
parent
a5a658cc57
commit
66be0af555
1 changed files with 24 additions and 10 deletions
|
@ -1623,10 +1623,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Update floor slope?
|
||||
if (s.FloorSlope.GetLengthSq() > 0 && !float.IsNaN(s.FloorSlopeOffset / s.FloorSlope.z))
|
||||
{
|
||||
float angle = s.FloorSlope.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
// Not sure what the logic should be for flipping horizintally and/or vertically
|
||||
//if (size.x < 0.0f) angle += Angle2D.PI;
|
||||
//if (size.y < 0.0f) angle += Angle2D.PI;
|
||||
// Flip the plane normal if necessary
|
||||
Vector3D normal = s.FloorSlope;
|
||||
if (size.x < 0.0f) normal.x *= -1;
|
||||
if (size.y < 0.0f) normal.y *= -1;
|
||||
|
||||
float angle = normal.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
|
||||
// Get the center of the *new* sector position. Use the z value of the center *old* sector position
|
||||
Vector2D originalcenter = new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2);
|
||||
|
@ -1646,7 +1648,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if (cs.FloorSlope.GetLengthSq() <= 0 || float.IsNaN(cs.FloorSlopeOffset / cs.FloorSlope.z))
|
||||
continue;
|
||||
|
||||
float angle = cs.FloorSlope.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
// Flip the plane normal if necessary
|
||||
Vector3D normal = cs.FloorSlope;
|
||||
if (size.x < 0.0f) normal.x *= -1;
|
||||
if (size.y < 0.0f) normal.y *= -1;
|
||||
|
||||
float angle = normal.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
|
||||
// Get the center of the *new* tagged sector position. Use the z value of the center *old* tagged sector position
|
||||
Vector2D originalcenter = new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2);
|
||||
|
@ -1662,10 +1669,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Update ceiling slope?
|
||||
if (s.CeilSlope.GetLengthSq() > 0 && !float.IsNaN(s.CeilSlopeOffset / s.CeilSlope.z))
|
||||
{
|
||||
float angle = s.CeilSlope.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
// Not sure what the logic should be for flipping horizintally and/or vertically
|
||||
//if (size.x < 0.0f) angle += Angle2D.PI;
|
||||
//if (size.y < 0.0f) angle += Angle2D.PI;
|
||||
// Flip the plane normal if necessary
|
||||
Vector3D normal = s.CeilSlope;
|
||||
if (size.x < 0.0f) normal.x *= -1;
|
||||
if (size.y < 0.0f) normal.y *= -1;
|
||||
|
||||
float angle = normal.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
|
||||
// Get the center of the *new* sector position. Use the z value of the center *old* sector position
|
||||
Vector2D originalcenter = new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2);
|
||||
|
@ -1685,7 +1694,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if (cs.CeilSlope.GetLengthSq() <= 0 || float.IsNaN(cs.CeilSlopeOffset / cs.CeilSlope.z))
|
||||
continue;
|
||||
|
||||
float angle = cs.CeilSlope.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
// Flip the plane normal if necessary
|
||||
Vector3D normal = cs.CeilSlope;
|
||||
if (size.x < 0.0f) normal.x *= -1;
|
||||
if (size.y < 0.0f) normal.y *= -1;
|
||||
|
||||
float angle = normal.GetAngleXY() + rotation + Angle2D.PIHALF;
|
||||
|
||||
// Get the center of the *new* tagged sector position. Use the z value of the center *old* tagged sector position
|
||||
Vector2D originalcenter = new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2);
|
||||
|
|
Loading…
Reference in a new issue