Visual Mode: looking through selection now applies the thing's pitch to the camera

This commit is contained in:
biwa 2023-09-17 13:05:50 +02:00
parent 1d6c2a1c13
commit ed93c4d69b

View file

@ -4339,7 +4339,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
General.Map.VisualCamera.Position = visualThings[0].CenterV3D; //position at thing
General.Map.VisualCamera.AngleXY = t.Angle - Angle2D.PI;
General.Map.VisualCamera.AngleZ = Angle2D.PI;
if (General.Map.UDMF)
General.Map.VisualCamera.AngleZ = Angle2D.DegToRad(t.Pitch) + Angle2D.PI;
else
General.Map.VisualCamera.AngleZ = Angle2D.PI;
}
}
@ -4787,7 +4791,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach (Thing t in things)
{
t.Rotate(General.Map.VisualCamera.AngleXY - Angle2D.PI);
t.SetPitch((int)Angle2D.RadToDeg(General.Map.VisualCamera.AngleZ - Angle2D.PI));
if (General.Map.UDMF)
t.SetPitch((int)Angle2D.RadToDeg(General.Map.VisualCamera.AngleZ - Angle2D.PI));
((BaseVisualThing)allthings[t]).Rebuild();
General.Interface.DisplayStatus(StatusType.Action, $"Applied camera rotation and pitch to {things.Count} thing{(things.Count == 1 ? "" : "s")}.");