Skip to content

Commit a7ce2e3

Browse files
committed
Automatic merge of T1.5.1-689-g9d41208f0 and 19 pull requests
- Pull request #570 at c59c788: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #865 at 67014b7: Dispatcher window improvements - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #878 at 8a6acee: Implement Polach Adhesion - Pull request #882 at 753b622: Blueprint/train car operations UI window - Pull request #883 at edcc2dd: SwitchPanel disconnect/connect handling - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at 52c3c82: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #889 at 43341cf: No speed update - Pull request #890 at 39a9fa4: Allow depart early - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 794fddf: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 64a29c8: feat: Improved system information collection
21 parents 1339d8b + 9d41208 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + 8a6acee + 753b622 + edcc2dd + c81447b + 52c3c82 + d7daf62 + 43341cf + 39a9fa4 + 1f5ba4c + bf8876b + 794fddf + 5866028 + 64a29c8 commit a7ce2e3

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,7 @@ public enum UserCommand
255255

256256
// Editor
257257
[GetString("Editor Unselect All")] EditorUnselectAll,
258+
[GetString("Editor Undo")] EditorUndo,
259+
[GetString("Editor Redo")] EditorRedo,
258260
}
259261
}

Source/ORTS.Settings/InputSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ static void InitializeCommands(UserCommandInput[] Commands)
542542
Commands[(int)UserCommand.GameUncoupleWithMouse] = new UserCommandKeyInput(0x16);
543543

544544
Commands[(int)UserCommand.EditorUnselectAll] = new UserCommandKeyInput(0x01);
545+
Commands[(int)UserCommand.EditorUndo] = new UserCommandKeyInput(Keys.Z, KeyModifiers.Control); // Not assigning by scan code, because on German influenced keyboard layounts
546+
Commands[(int)UserCommand.EditorRedo] = new UserCommandKeyInput(Keys.Y, KeyModifiers.Control); // the Y and Z keys are exchanged, and we want these to match the o/s
545547
}
546548
#endregion
547549

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,11 @@ public override void HandleUserInput(ElapsedTime elapsedTime)
844844

845845
public override void ZoomByMouseWheel(float speed)
846846
{
847-
ZoomIn(speed * UserInput.MouseWheelChange * ZoomFactor);
847+
// Zoom/move towards the mouse cursor instead of the camera forward
848+
var movement = speed * -UserInput.MouseWheelChange * ZoomFactor * Vector3.Normalize(Viewer.NearPoint - Viewer.FarPoint);
849+
movement.Z *= -1;
850+
cameraLocation.Location += movement;
851+
cameraLocation.Normalize();
848852
}
849853

850854
public override void RotateByMouse()
@@ -855,8 +859,9 @@ public override void RotateByMouse()
855859
var deltaAngleX = MathHelper.WrapAngle(RotationXRadians - StoredAngleX);
856860
var deltaAngleY = MathHelper.WrapAngle(RotationYRadians - StoredAngleY);
857861

858-
var dax = StoredForward.Z * deltaAngleX;
859-
var daz = StoredForward.X * deltaAngleX;
862+
var dax = Vector3.Dot(StoredForward, Vector3.UnitZ) * deltaAngleX;
863+
var daz = Vector3.Dot(StoredForward, Vector3.UnitX) * deltaAngleX;
864+
860865
var transform = Matrix.CreateRotationX(dax);
861866
transform *= Matrix.CreateRotationZ(daz);
862867
transform *= Matrix.CreateRotationY(-deltaAngleY);
@@ -870,7 +875,7 @@ public override void RotateByMouse()
870875
cameraLocation = newWorldLocation;
871876
}
872877

873-
public void StoreRotationOrigin(Vector3 rotationOrigin)
878+
void StoreRotationOrigin(Vector3 rotationOrigin)
874879
{
875880
StoredOrigin = Viewer.TerrainPoint;
876881
StoredLocation = CameraWorldLocation;
@@ -882,7 +887,9 @@ public void StoreRotationOrigin(Vector3 rotationOrigin)
882887
StoredForward = xnaView.Forward;
883888
}
884889

885-
public void SetOrientation(float rotationXRadians, float rotationYRadians)
890+
public float GetRotationX() { return RotationXRadians; }
891+
public float GetRotationY() { return RotationYRadians; }
892+
public void SetRotation(float rotationXRadians, float rotationYRadians)
886893
{
887894
RotationXRadians = rotationXRadians;
888895
RotationYRadians = rotationYRadians;

Source/RunActivity/Viewer3D/EditorPrimitives.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ public MouseCrosshair(Viewer viewer, Color color)
176176
{
177177
new VertexPositionColor(new Vector3(-5, 0, 0), color),
178178
new VertexPositionColor(new Vector3(5, 0, 0), color),
179-
new VertexPositionColor(new Vector3(0, 0, -5), color),
180-
new VertexPositionColor(new Vector3(0, 0, 5), color),
179+
new VertexPositionColor(new Vector3(0, 0, -5), Color.Red),
180+
new VertexPositionColor(new Vector3(0, 0, 5), Color.Cyan),
181181
new VertexPositionColor(new Vector3(0, 0, 0), color),
182182
new VertexPositionColor(new Vector3(0, 20, 0), color)
183183
};

0 commit comments

Comments
 (0)