Skip to content

Commit 00199d2

Browse files
committed
Use Vector4.Transform
1 parent 1f35b22 commit 00199d2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.Impl.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,10 @@ public Vector3 Translation
166166
public static Impl operator *(in Impl left, in Impl right)
167167
{
168168
Impl result;
169-
result.X = Transform(left.X, in right);
170-
result.Y = Transform(left.Y, in right);
171-
result.Z = Transform(left.Z, in right);
172-
result.W = Transform(left.W, in right);
173-
return result;
174-
}
175-
176-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
177-
private static Vector4 Transform(Vector4 vector, in Impl matrix)
178-
{
179-
var result = matrix.X * vector.X;
180-
result += matrix.Y * vector.Y;
181-
result += matrix.Z * vector.Z;
182-
result += matrix.W * vector.W;
169+
result.X = Vector4.Transform(left.X, in right);
170+
result.Y = Vector4.Transform(left.Y, in right);
171+
result.Z = Vector4.Transform(left.Z, in right);
172+
result.W = Vector4.Transform(left.W, in right);
183173
return result;
184174
}
185175

0 commit comments

Comments
 (0)