diff --git a/Source/Editor/Content/Import/ImportFilesDialog.cs b/Source/Editor/Content/Import/ImportFilesDialog.cs index 6ccb28846..c1d24f68c 100644 --- a/Source/Editor/Content/Import/ImportFilesDialog.cs +++ b/Source/Editor/Content/Import/ImportFilesDialog.cs @@ -215,8 +215,7 @@ namespace FlaxEditor.Content.Import var entries = new List(_rootNode.ChildrenCount); for (int i = 0; i < _rootNode.ChildrenCount; i++) { - var fileEntry = _rootNode.Children[i].Tag as ImportFileEntry; - if (fileEntry != null) + if (_rootNode.Children[i].Tag is ImportFileEntry fileEntry) entries.Add(fileEntry); } Editor.Instance.ContentImporting.LetThemBeImportedxD(entries); diff --git a/Source/Editor/Content/Items/ContentItem.cs b/Source/Editor/Content/Items/ContentItem.cs index 86741a432..2e75de940 100644 --- a/Source/Editor/Content/Items/ContentItem.cs +++ b/Source/Editor/Content/Items/ContentItem.cs @@ -599,7 +599,7 @@ namespace FlaxEditor.Content public override bool OnShowTooltip(out string text, out Vector2 location, out Rectangle area) { UpdateTooltipText(); - var result = base.OnShowTooltip(out text, out location, out area); + var result = base.OnShowTooltip(out text, out _, out area); location = Size * new Vector2(0.9f, 0.5f); return result; } diff --git a/Source/Editor/Content/Proxy/PrefabProxy.cs b/Source/Editor/Content/Proxy/PrefabProxy.cs index ff3a5bd17..0c4c2de6b 100644 --- a/Source/Editor/Content/Proxy/PrefabProxy.cs +++ b/Source/Editor/Content/Proxy/PrefabProxy.cs @@ -74,8 +74,7 @@ namespace FlaxEditor.Content /// public override void Create(string outputPath, object arg) { - var actor = arg as Actor; - if (actor == null) + if (!(arg is Actor actor)) { // Create default prefab root object actor = new EmptyActor diff --git a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs index d234eb91e..1b1329318 100644 --- a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs +++ b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs @@ -59,13 +59,11 @@ namespace FlaxEditor.Content.Thumbnails } // We cache previews only for items with 'ID', for now we support only AssetItems - var assetItem = item as AssetItem; - if (assetItem == null) + if (!(item is AssetItem assetItem)) return; // Ensure that there is valid proxy for that item - var proxy = Editor.ContentDatabase.GetProxy(item) as AssetProxy; - if (proxy == null) + if (!(Editor.ContentDatabase.GetProxy(item) is AssetProxy proxy)) { Editor.LogWarning($"Cannot generate preview for item {item.Path}. Cannot find proxy for it."); return; @@ -105,8 +103,7 @@ namespace FlaxEditor.Content.Thumbnails throw new ArgumentNullException(); // We cache previews only for items with 'ID', for now we support only AssetItems - var assetItem = item as AssetItem; - if (assetItem == null) + if (!(item is AssetItem assetItem)) return; lock (_requests) diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs index f81f81ddd..0c91a4f66 100644 --- a/Source/Editor/Editor.cs +++ b/Source/Editor/Editor.cs @@ -1236,8 +1236,7 @@ namespace FlaxEditor result = IntPtr.Zero; if (Windows.GameWin != null && (forceGet || Windows.GameWin.ContainsFocus)) { - var win = Windows.GameWin.Root as WindowRootControl; - if (win != null) + if (Windows.GameWin.Root is WindowRootControl win) result = FlaxEngine.Object.GetUnmanagedPtr(win.Window); } } diff --git a/Source/Editor/GUI/MainMenu.cs b/Source/Editor/GUI/MainMenu.cs index 7c49d85ac..620542ce4 100644 --- a/Source/Editor/GUI/MainMenu.cs +++ b/Source/Editor/GUI/MainMenu.cs @@ -242,10 +242,11 @@ namespace FlaxEditor.GUI MainMenuButton b = null; foreach (var control in Children) { - if (b == null && control is MainMenuButton) - b = (MainMenuButton)control; - if (control is MainMenuButton && control.Right > b.Right) - b = (MainMenuButton)control; + if (b == null && control is MainMenuButton button) + b = button; + + if (control is MainMenuButton button1 && control.Right > b.Right) + b = button1; } return b; } diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs b/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs index 2b7bf338d..fb526cd10 100644 --- a/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs +++ b/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs @@ -56,104 +56,107 @@ namespace FlaxEditor.Gizmo _activeAxis = Axis.None; switch (_activeMode) { - case Mode.Translate: - { - // Axis boxes collision - if (XAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) + case Mode.Translate: { - _activeAxis = Axis.X; - closestintersection = intersection; - } - if (YAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Y; - closestintersection = intersection; - } - if (ZAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Z; - closestintersection = intersection; + // Axis boxes collision + if (XAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.X; + closestintersection = intersection; + } + + if (YAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Y; + closestintersection = intersection; + } + + if (ZAxisBox.Intersects(ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Z; + closestintersection = intersection; + } + + // Quad planes collision + if (closestintersection >= float.MaxValue) + closestintersection = float.MinValue; + if (XYBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) + { + _activeAxis = Axis.XY; + closestintersection = intersection; + } + + if (XZBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) + { + _activeAxis = Axis.ZX; + closestintersection = intersection; + } + if (YZBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) + { + _activeAxis = Axis.YZ; + closestintersection = intersection; + } + + break; } - // Quad planes collision - if (closestintersection >= float.MaxValue) - closestintersection = float.MinValue; - if (XYBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) + case Mode.Rotate: { - _activeAxis = Axis.XY; - closestintersection = intersection; - } - if (XZBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) - { - _activeAxis = Axis.ZX; - closestintersection = intersection; - } - if (YZBox.Intersects(ref localRay, out intersection) && intersection > closestintersection) - { - _activeAxis = Axis.YZ; - closestintersection = intersection; + // Circles + if (IntersectsRotateCircle(Vector3.UnitX, ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.X; + closestintersection = intersection; + } + if (IntersectsRotateCircle(Vector3.UnitY, ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Y; + closestintersection = intersection; + } + if (IntersectsRotateCircle(Vector3.UnitZ, ref localRay, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Z; + closestintersection = intersection; + } + + // Center + /*if (CenterSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Center; + closestintersection = intersection; + }*/ + + break; } - break; - } + case Mode.Scale: + { + // Spheres collision + if (ScaleXSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.X; + closestintersection = intersection; + } + if (ScaleYSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Y; + closestintersection = intersection; + } + if (ScaleZSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Z; + closestintersection = intersection; + } - case Mode.Rotate: - { - // Circles - if (IntersectsRotateCircle(Vector3.UnitX, ref localRay, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.X; - closestintersection = intersection; - } - if (IntersectsRotateCircle(Vector3.UnitY, ref localRay, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Y; - closestintersection = intersection; - } - if (IntersectsRotateCircle(Vector3.UnitZ, ref localRay, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Z; - closestintersection = intersection; - } + // Center + if (CenterBox.Intersects(ref ray, out intersection) && intersection < closestintersection) + { + _activeAxis = Axis.Center; + closestintersection = intersection; + } - // Center - /*if (CenterSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Center; - closestintersection = intersection; - }*/ - - break; - } - - case Mode.Scale: - { - // Spheres collision - if (ScaleXSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.X; - closestintersection = intersection; + break; } - if (ScaleYSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Y; - closestintersection = intersection; - } - if (ScaleZSphere.Intersects(ref ray, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Z; - closestintersection = intersection; - } - - // Center - if (CenterBox.Intersects(ref ray, out intersection) && intersection < closestintersection) - { - _activeAxis = Axis.Center; - closestintersection = intersection; - } - - break; - } } } } diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs index 7b4b35ed1..048244701 100644 --- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs +++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs @@ -690,8 +690,7 @@ namespace FlaxEditor.SceneGraph.GUI var item = _dragActorType.Objects[i]; // Create actor - var actor = item.CreateInstance() as Actor; - if (actor == null) + if (!(item.CreateInstance() is Actor actor)) { Editor.LogWarning("Failed to spawn actor of type " + item.TypeName); continue; diff --git a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs index d5da2283b..dfeea5774 100644 --- a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs +++ b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs @@ -255,8 +255,7 @@ namespace FlaxEditor.Surface.Archetypes private void OnSurfaceLoaded(VisjectSurfaceContext context) { // Ensure that loaded surface has entry node for state machine - var entryNode = context.FindNode(9, 19); - if (entryNode == null) + if (context.FindNode(9, 19) == null) { var wasEnabled = true; if (Surface.Undo != null) @@ -265,7 +264,7 @@ namespace FlaxEditor.Surface.Archetypes Surface.Undo.Enabled = false; } - entryNode = context.SpawnNode(9, 19, new Vector2(100.0f)); + context.SpawnNode(9, 19, new Vector2(100.0f)); if (Surface.Undo != null) { @@ -547,11 +546,11 @@ namespace FlaxEditor.Surface.Archetypes private void Add() { var context = _context.Get(_surface); - var src = context.FindNode(_srcStateId) as StateMachineState; - if (src == null) + + if (!(context.FindNode(_srcStateId) is StateMachineState src)) throw new Exception("Missing source state."); - var dst = context.FindNode(_dstStateId) as StateMachineState; - if (dst == null) + + if (!(context.FindNode(_dstStateId) is StateMachineState dst)) throw new Exception("Missing destination state."); var transition = new StateMachineTransition(src, dst, ref _data); @@ -567,12 +566,13 @@ namespace FlaxEditor.Surface.Archetypes private void Remove() { var context = _context.Get(_surface); - var src = context.FindNode(_srcStateId) as StateMachineState; - if (src == null) + + if (!(context.FindNode(_srcStateId) is StateMachineState src)) throw new Exception("Missing source state."); - var dst = context.FindNode(_dstStateId) as StateMachineState; - if (dst == null) + + if (!(context.FindNode(_dstStateId) is StateMachineState dst)) throw new Exception("Missing destination state."); + var transition = src.Transitions.Find(x => x.DestinationState == dst); if (transition == null) throw new Exception("Missing transition."); @@ -870,8 +870,7 @@ namespace FlaxEditor.Surface.Archetypes if (ruleSize != 0) rule = reader.ReadBytes(ruleSize); - var destination = Context.FindNode(data.Destination) as StateMachineState; - if (destination == null) + if (!(Context.FindNode(data.Destination) is StateMachineState destination)) { Editor.LogWarning("Missing state machine state destination node."); continue; @@ -1310,8 +1309,7 @@ namespace FlaxEditor.Surface.Archetypes private void OnSurfaceLoaded(VisjectSurfaceContext context) { // Ensure that loaded surface has output node for state - var entryNode = context.FindNode(9, 21); - if (entryNode == null) + if (context.FindNode(9, 21) == null) { var wasEnabled = true; if (Surface.Undo != null) @@ -1320,7 +1318,7 @@ namespace FlaxEditor.Surface.Archetypes Surface.Undo.Enabled = false; } - entryNode = context.SpawnNode(9, 21, new Vector2(100.0f)); + context.SpawnNode(9, 21, new Vector2(100.0f)); if (Surface.Undo != null) { @@ -1678,8 +1676,7 @@ namespace FlaxEditor.Surface.Archetypes private void OnSurfaceLoaded(VisjectSurfaceContext context) { // Ensure that loaded surface has rule output node - var ruleOutputNode = context.FindNode(9, 22); - if (ruleOutputNode == null) + if (context.FindNode(9, 22) == null) { var wasEnabled = true; var undo = SourceState.Surface.Undo; @@ -1689,7 +1686,7 @@ namespace FlaxEditor.Surface.Archetypes undo.Enabled = false; } - ruleOutputNode = context.SpawnNode(9, 22, new Vector2(100.0f)); + context.SpawnNode(9, 22, new Vector2(100.0f)); // TODO: add default rule nodes for easier usage diff --git a/Source/Editor/Surface/Archetypes/Function.cs b/Source/Editor/Surface/Archetypes/Function.cs index 231182a0e..e568d3867 100644 --- a/Source/Editor/Surface/Archetypes/Function.cs +++ b/Source/Editor/Surface/Archetypes/Function.cs @@ -765,9 +765,10 @@ namespace FlaxEditor.Surface.Archetypes private SignatureInfo LoadSignature() { var signature = new SignatureInfo(); - var data = Values[4] as byte[]; - if (data == null || data.Length == 0) + + if (!(Values[4] is byte[] data) || data.Length == 0) return signature; + if (data[0] == 4) { using (var stream = new MemoryStream(data)) diff --git a/Source/Editor/Surface/Elements/Box.cs b/Source/Editor/Surface/Elements/Box.cs index 2a460013c..ee0687ef4 100644 --- a/Source/Editor/Surface/Elements/Box.cs +++ b/Source/Editor/Surface/Elements/Box.cs @@ -686,10 +686,9 @@ namespace FlaxEditor.Surface.Elements public bool CanConnectWith(IConnectionInstigator other) { var start = this; - var end = other as Box; // Allow only box with box connection - if (end == null) + if (!(other is Box end)) { // Cannot return false; diff --git a/Source/Editor/Surface/SurfaceNode.cs b/Source/Editor/Surface/SurfaceNode.cs index abbd6a6a0..7825de942 100644 --- a/Source/Editor/Surface/SurfaceNode.cs +++ b/Source/Editor/Surface/SurfaceNode.cs @@ -156,7 +156,6 @@ namespace FlaxEditor.Surface /// The height. protected void Resize(float width, float height) { - var prevSize = Size; Size = CalculateNodeSize(width, height); // Update boxes on width change @@ -791,7 +790,7 @@ namespace FlaxEditor.Surface /// public override bool OnShowTooltip(out string text, out Vector2 location, out Rectangle area) { - var result = base.OnShowTooltip(out text, out location, out area); + var result = base.OnShowTooltip(out text, out _, out area); // Change the position location = new Vector2(_headerRect.Width * 0.5f, _headerRect.Bottom); diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs index d98e2c421..1db1f06d1 100644 --- a/Source/Editor/Surface/VisjectSurface.cs +++ b/Source/Editor/Surface/VisjectSurface.cs @@ -743,13 +743,14 @@ namespace FlaxEditor.Surface { if (!CanEdit) return; - var node = control as SurfaceNode; - if (node == null) + + if (!(control is SurfaceNode node)) { Context.OnControlDeleted(control); MarkAsEdited(); return; } + if ((node.Archetype.Flags & NodeFlags.NoRemove) != 0) return; diff --git a/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs b/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs index e68a44b58..ad524287b 100644 --- a/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs +++ b/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs @@ -577,7 +577,7 @@ namespace FlaxEditor.Surface // Store node typename in values container node.Values[0] = typeName; } - if (node is MissingNode missingNode) + if (node is MissingNode) { // Read all values Array.Resize(ref node.Values, valuesCnt); @@ -749,7 +749,7 @@ namespace FlaxEditor.Surface // Store node typename in values container node.Values[0] = typeName; } - if (node is MissingNode missingNode) + if (node is MissingNode) { // Read all values Array.Resize(ref node.Values, valuesCnt); @@ -769,7 +769,7 @@ namespace FlaxEditor.Surface { Editor.LogWarning(string.Format("Invalid node values. Loaded: {0}, expected: {1}. Type: {2}, {3}", valuesCnt, nodeValuesCnt, node.Archetype.Title, node.Archetype.TypeID)); - object dummy = null; + object dummy; for (int j = firstValueReadIdx; j < valuesCnt; j++) { dummy = stream.ReadVariant(); @@ -789,7 +789,7 @@ namespace FlaxEditor.Surface for (int j = 0; j < boxesCount; j++) { var id = stream.ReadByte(); - var type = stream.ReadVariantType(); + stream.ReadVariantType(); // Skip type var connectionsCnt = stream.ReadUInt16(); ConnectionHint hint; diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs index d3fc34bd5..aaf75a21c 100644 --- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs +++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs @@ -833,7 +833,7 @@ namespace FlaxEditor.Viewport private Vector3 PostProcessSpawnedActorLocation(Actor actor, ref Vector3 hitLocation) { - Editor.GetActorEditorBox(actor, out BoundingBox box); + Editor.GetActorEditorBox(actor, out _); // Place the object //var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection; @@ -968,8 +968,7 @@ namespace FlaxEditor.Viewport private void Spawn(ScriptType item, SceneGraphNode hit, ref Vector2 location, ref Vector3 hitLocation) { - var actor = item.CreateInstance() as Actor; - if (actor == null) + if (!(item.CreateInstance() is Actor actor)) { Editor.LogWarning("Failed to spawn actor of type " + item.TypeName); return; diff --git a/Source/Editor/Viewport/PrefabWindowViewport.cs b/Source/Editor/Viewport/PrefabWindowViewport.cs index 08b40c912..08202427b 100644 --- a/Source/Editor/Viewport/PrefabWindowViewport.cs +++ b/Source/Editor/Viewport/PrefabWindowViewport.cs @@ -749,8 +749,7 @@ namespace FlaxEditor.Viewport private void Spawn(ScriptType item, SceneGraphNode hit, ref Vector3 hitLocation) { - var actor = item.CreateInstance() as Actor; - if (actor == null) + if (!(item.CreateInstance() is Actor actor)) { Editor.LogWarning("Failed to spawn actor of type " + item.TypeName); return; diff --git a/Source/Editor/Windows/Profiler/GPU.cs b/Source/Editor/Windows/Profiler/GPU.cs index b7cee5517..cd1c4cfed 100644 --- a/Source/Editor/Windows/Profiler/GPU.cs +++ b/Source/Editor/Windows/Profiler/GPU.cs @@ -157,7 +157,7 @@ namespace FlaxEditor.Windows.Profiler float width = (float)(e.Time * scale); string name = new string(e.Name); - var control = new Timeline.Event(x, e.Depth, width) + new Timeline.Event(x, e.Depth, width) { Name = name, TooltipText = string.Format("{0}, {1} ms", name, ((int)(e.Time * 10000.0) / 10000.0f)), diff --git a/Source/Engine/Core/Math/BoundingBox.cs b/Source/Engine/Core/Math/BoundingBox.cs index 8bf6a6695..784f39930 100644 --- a/Source/Engine/Core/Math/BoundingBox.cs +++ b/Source/Engine/Core/Math/BoundingBox.cs @@ -149,7 +149,7 @@ namespace FlaxEngine /// Whether the two objects intersected. public bool Intersects(ref Ray ray) { - return CollisionsHelper.RayIntersectsBox(ref ray, ref this, out float distance); + return CollisionsHelper.RayIntersectsBox(ref ray, ref this, out float _); } /// diff --git a/Source/Engine/Core/Math/BoundingSphere.cs b/Source/Engine/Core/Math/BoundingSphere.cs index 8b583d51b..ff0dd7725 100644 --- a/Source/Engine/Core/Math/BoundingSphere.cs +++ b/Source/Engine/Core/Math/BoundingSphere.cs @@ -81,7 +81,7 @@ namespace FlaxEngine /// Whether the two objects intersected. public bool Intersects(ref Ray ray) { - return CollisionsHelper.RayIntersectsSphere(ref ray, ref this, out float distance); + return CollisionsHelper.RayIntersectsSphere(ref ray, ref this, out float _); } /// diff --git a/Source/Engine/Core/Math/OrientedBoundingBox.cs b/Source/Engine/Core/Math/OrientedBoundingBox.cs index 341f8fda2..d37255c1b 100644 --- a/Source/Engine/Core/Math/OrientedBoundingBox.cs +++ b/Source/Engine/Core/Math/OrientedBoundingBox.cs @@ -756,7 +756,7 @@ namespace FlaxEngine /// Whether the two objects intersected. public bool Intersects(ref Ray ray) { - return Intersects(ref ray, out Vector3 point); + return Intersects(ref ray, out Vector3 _); } private Vector3[] GetLocalCorners() diff --git a/Source/Engine/Core/Math/Plane.cs b/Source/Engine/Core/Math/Plane.cs index 375ba10c6..79bf86bd8 100644 --- a/Source/Engine/Core/Math/Plane.cs +++ b/Source/Engine/Core/Math/Plane.cs @@ -254,7 +254,7 @@ namespace FlaxEngine /// Whether the two objects intersected. public bool Intersects(ref Ray ray) { - return CollisionsHelper.RayIntersectsPlane(ref ray, ref this, out float distance); + return CollisionsHelper.RayIntersectsPlane(ref ray, ref this, out float _); } /// @@ -488,7 +488,6 @@ namespace FlaxEngine float x = -plane.Normal.X; float y = -plane.Normal.Y; float z = -plane.Normal.Z; - float d = -plane.D; result.M11 = x * light.X + dot; result.M21 = y * light.X; @@ -802,7 +801,7 @@ namespace FlaxEngine if (planes == null) throw new ArgumentNullException(nameof(planes)); - Matrix.Invert(ref transformation, out Matrix inverse); + Matrix.Invert(ref transformation, out _); for (var i = 0; i < planes.Length; ++i) Transform(ref planes[i], ref transformation, out planes[i]);