mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 03:59:55 +08:00
Use fast invert helper in hot path
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Extensions.MatrixExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Layout;
|
||||
@@ -54,7 +55,8 @@ namespace osu.Game.Graphics.Containers
|
||||
parentMatrix.M31 = 0.0f;
|
||||
parentMatrix.M32 = 0.0f;
|
||||
|
||||
Matrix3 reversedParent = parentMatrix.Inverted();
|
||||
Matrix3 reversedParent = parentMatrix;
|
||||
MatrixExtensions.FastInvert(ref reversedParent);
|
||||
|
||||
// Extract the rotation.
|
||||
float angle = MathF.Atan2(reversedParent.M12, reversedParent.M11);
|
||||
|
||||
Reference in New Issue
Block a user