@@ -57,8 +57,9 @@ Main record responsible for {ref}`MM2MS` projection.
5757 View, Projection, InvertedView, InvertedProjection: TMatrix4;
5858 Transformer: TVector3;
5959
60- ViewEye, ViewTarget, ViewUp: TVector3;
60+ ViewEye, CustomEye, ViewTarget, ViewUp: TVector3;
6161 ProjectionHeight, ProjectionWidth: Integer;
62+ MinScaleMultiplier, MaxScaleMultiplier, FOV, ZNear, ZFar: Double;
6263 end;
6364
6465(*
@@ -220,18 +221,25 @@ begin
220221 case mode of
221222 ERSMode.FIXED:
222223 begin
223- Self.ScaleMin : = 0.83 * MainScreen.Bounds.Height / Self.ProjectionHeight ;
224- Self.ScaleMax := 6.32 * MainScreen.Bounds.Height / Self.ProjectionHeight ;
224+ if Self.MinScaleMultiplier = 0 then Self.MinScaleMultiplier := 0.8 ;
225+ if Self.MaxScaleMultiplier = 0 then Self.MaxScaleMultiplier := 6.32 ;
225226 end;
226227
227228 ERSMode.RESIZABLE, ERSMode.MODERN_COMPACT, ERSMode.MODERN_WIDE:
228229 begin
229- Self.ScaleMin : = 0.635 * MainScreen.Bounds.Height / Self.ProjectionHeight ;
230- Self.ScaleMax := 4.90 * MainScreen.Bounds.Height / Self.ProjectionHeight ;
230+ if Self.MinScaleMultiplier = 0 then Self.MinScaleMultiplier := 0.635 ;
231+ if Self.MaxScaleMultiplier = 0 then Self.MaxScaleMultiplier := 4.90 ;
231232 end;
232233 end;
233234
234- Self.Projection := TMatrix4.PerspectiveFovRH(Sqrt(2), Self.ProjectionWidth / Self.ProjectionHeight, 0.01, 1.0);
235+ Self.ScaleMin := Self.MinScaleMultiplier * MainScreen.Bounds.Height / Self.ProjectionHeight;
236+ Self.ScaleMax := Self.MaxScaleMultiplier * MainScreen.Bounds.Height / Self.ProjectionHeight;
237+
238+ if Self.FOV = 0 then Self.FOV := Sqrt(2);
239+ if Self.ZNear = 0 then Self.ZNear := 0.0;
240+ if Self.ZFar = 0 then Self.ZFar := 1.0;
241+
242+ Self.Projection := TMatrix4.PerspectiveFovRH(Self.FOV, Self.ProjectionWidth / Self.ProjectionHeight, 0.01, 1.0);
235243 Self.InvertedProjection := Self._InvertProjection(Self.Projection);
236244
237245 Self.ViewTarget := [0.0, 0.0, 1.0];
0 commit comments