Skip to content

Commit

Permalink
Tweak MM2MS
Browse files Browse the repository at this point in the history
Tweaks fixed mode at floor level, I found that it didn't project correctly anymore.

Tweaks resizable mode a tiny bit as well, just to improve slightly for very far away things.

Known issues: Fixed mode when tweaking z (height) of an object it scales very poorly. In resizable the issue also exists, but it's not bad.
  • Loading branch information
slackydev authored Sep 9, 2023
1 parent 81cf117 commit d25db1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions osr/mm2ms_projector.simba
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type

const
MM2MS_PROJECTOR_FIXED: TMM2MSProjector = [
-25.5, // Y_LOOK
0.80, 6.32, // SCALE_MIN, SCALE_MAX
-28, // Y_LOOK
0.83, 6.32, // SCALE_MIN, SCALE_MAX
50, // ZOOM_LEVEL
[569, 8, 714, 159], // MINIMAP BOUNDS
[4, 4, 515, 337] // MAINSCREEN BOUNDS
Expand All @@ -39,7 +39,7 @@ const
50, // ZOOM_LEVEL
[], // MINIMAP (dynamic)
[] // MAINSCREEN (dynamic)
];
];

function TMM2MSProjector.Transform(coord: Vector3; matrix: TMatrix4): Vector3;
var
Expand All @@ -64,7 +64,7 @@ begin
ScaleMin := Self.SCALE_MIN * MainScreen.Height / 503; // fixed client height
ScaleMax := Self.SCALE_MAX * MainScreen.Height / 503; // fixed client height

ViewMatrix := TMatrix4.LookAtRH([0, Self.Y_LOOK, 61], [0, 0, 1.3], Vector3_UnitY);
ViewMatrix := TMatrix4.LookAtRH([0, Self.Y_LOOK, 61], [0, 0, 1.0], Vector3_UnitY);
ProjMatrix := TMatrix4.PerspectiveFovRH(Sqrt(2), 765 / 503, 0.01, 1.0); // fixed client width & height

WorldMatrix := TMatrix4.RotationYawPitchRoll(Rotation.Y, Rotation.X, Rotation.Z) * Matrix_Identity;
Expand Down

0 comments on commit d25db1e

Please sign in to comment.