31 private static readonly
Matrix4x4 _identity =
new Matrix4x4(1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1f);
93 public Matrix4x4(
float m11,
float m12,
float m13,
float m14,
float m21,
float m22,
float m23,
float m24,
float m31,
float m32,
float m33,
float m34,
float m41,
float m42,
float m43,
float m44)
147 result.M11 = value1.M11 + value2.
M11;
148 result.M12 = value1.M12 + value2.
M12;
149 result.M13 = value1.M13 + value2.
M13;
150 result.M14 = value1.M14 + value2.
M14;
151 result.M21 = value1.M21 + value2.
M21;
152 result.M22 = value1.M22 + value2.
M22;
153 result.M23 = value1.M23 + value2.
M23;
154 result.M24 = value1.M24 + value2.
M24;
155 result.M31 = value1.M31 + value2.
M31;
156 result.M32 = value1.M32 + value2.
M32;
157 result.M33 = value1.M33 + value2.
M33;
158 result.M34 = value1.M34 + value2.
M34;
159 result.M41 = value1.M41 + value2.
M41;
160 result.M42 = value1.M42 + value2.
M42;
161 result.M43 = value1.M43 + value2.
M43;
162 result.M44 = value1.M44 + value2.
M44;
181 return value1.M43 == value2.
M43;
201 return value1.M44 != value2.
M44;
214 Sse.
Store(&value1.
M11,
Sse.
Add(
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 0),
Sse.
LoadVector128(&value2.
M11)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 85),
Sse.
LoadVector128(&value2.
M21))),
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 170),
Sse.
LoadVector128(&value2.
M31)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector,
byte.MaxValue),
Sse.
LoadVector128(&value2.
M41)))));
216 Sse.
Store(&value1.
M21,
Sse.
Add(
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 0),
Sse.
LoadVector128(&value2.
M11)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 85),
Sse.
LoadVector128(&value2.
M21))),
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 170),
Sse.
LoadVector128(&value2.
M31)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector,
byte.MaxValue),
Sse.
LoadVector128(&value2.
M41)))));
218 Sse.
Store(&value1.
M31,
Sse.
Add(
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 0),
Sse.
LoadVector128(&value2.
M11)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 85),
Sse.
LoadVector128(&value2.
M21))),
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 170),
Sse.
LoadVector128(&value2.
M31)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector,
byte.MaxValue),
Sse.
LoadVector128(&value2.
M41)))));
220 Sse.
Store(&value1.
M41,
Sse.
Add(
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 0),
Sse.
LoadVector128(&value2.
M11)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 85),
Sse.
LoadVector128(&value2.
M21))),
Sse.
Add(
Sse.
Multiply(
Sse.
Shuffle(vector, vector, 170),
Sse.
LoadVector128(&value2.
M31)),
Sse.
Multiply(
Sse.
Shuffle(vector, vector,
byte.MaxValue),
Sse.
LoadVector128(&value2.
M41)))));
224 result.M11 = value1.M11 * value2.M11 + value1.M12 * value2.M21 + value1.M13 * value2.M31 + value1.M14 * value2.
M41;
225 result.M12 = value1.M11 * value2.M12 + value1.M12 * value2.M22 + value1.M13 * value2.M32 + value1.M14 * value2.
M42;
226 result.M13 = value1.M11 * value2.M13 + value1.M12 * value2.M23 + value1.M13 * value2.M33 + value1.M14 * value2.
M43;
227 result.M14 = value1.M11 * value2.M14 + value1.M12 * value2.M24 + value1.M13 * value2.M34 + value1.M14 * value2.
M44;
228 result.M21 = value1.M21 * value2.M11 + value1.M22 * value2.M21 + value1.M23 * value2.M31 + value1.M24 * value2.
M41;
229 result.M22 = value1.M21 * value2.M12 + value1.M22 * value2.M22 + value1.M23 * value2.M32 + value1.M24 * value2.
M42;
230 result.M23 = value1.M21 * value2.M13 + value1.M22 * value2.M23 + value1.M23 * value2.M33 + value1.M24 * value2.
M43;
231 result.M24 = value1.M21 * value2.M14 + value1.M22 * value2.M24 + value1.M23 * value2.M34 + value1.M24 * value2.
M44;
232 result.M31 = value1.M31 * value2.M11 + value1.M32 * value2.M21 + value1.M33 * value2.M31 + value1.M34 * value2.
M41;
233 result.M32 = value1.M31 * value2.M12 + value1.M32 * value2.M22 + value1.M33 * value2.M32 + value1.M34 * value2.
M42;
234 result.M33 = value1.M31 * value2.M13 + value1.M32 * value2.M23 + value1.M33 * value2.M33 + value1.M34 * value2.
M43;
235 result.M34 = value1.M31 * value2.M14 + value1.M32 * value2.M24 + value1.M33 * value2.M34 + value1.M34 * value2.
M44;
236 result.M41 = value1.M41 * value2.M11 + value1.M42 * value2.M21 + value1.M43 * value2.M31 + value1.M44 * value2.
M41;
237 result.M42 = value1.M41 * value2.M12 + value1.M42 * value2.M22 + value1.M43 * value2.M32 + value1.M44 * value2.
M42;
238 result.M43 = value1.M41 * value2.M13 + value1.M42 * value2.M23 + value1.M43 * value2.M33 + value1.M44 * value2.
M43;
239 result.M44 = value1.M41 * value2.M14 + value1.M42 * value2.M24 + value1.M43 * value2.M34 + value1.M44 * value2.
M44;
258 result.M11 = value1.M11 * value2;
259 result.M12 = value1.M12 * value2;
260 result.M13 = value1.M13 * value2;
261 result.M14 = value1.M14 * value2;
262 result.M21 = value1.M21 * value2;
263 result.M22 = value1.M22 * value2;
264 result.M23 = value1.M23 * value2;
265 result.M24 = value1.M24 * value2;
266 result.M31 = value1.M31 * value2;
267 result.M32 = value1.M32 * value2;
268 result.M33 = value1.M33 * value2;
269 result.M34 = value1.M34 * value2;
270 result.M41 = value1.M41 * value2;
271 result.M42 = value1.M42 * value2;
272 result.M43 = value1.M43 * value2;
273 result.M44 = value1.M44 * value2;
291 result.M11 = value1.M11 - value2.
M11;
292 result.M12 = value1.M12 - value2.
M12;
293 result.M13 = value1.M13 - value2.
M13;
294 result.M14 = value1.M14 - value2.
M14;
295 result.M21 = value1.M21 - value2.
M21;
296 result.M22 = value1.M22 - value2.
M22;
297 result.M23 = value1.M23 - value2.
M23;
298 result.M24 = value1.M24 - value2.
M24;
299 result.M31 = value1.M31 - value2.
M31;
300 result.M32 = value1.M32 - value2.
M32;
301 result.M33 = value1.M33 - value2.
M33;
302 result.M34 = value1.M34 - value2.
M34;
303 result.M41 = value1.M41 - value2.
M41;
304 result.M42 = value1.M42 - value2.
M42;
305 result.M43 = value1.M43 - value2.
M43;
306 result.M44 = value1.M44 - value2.
M44;
325 result.M11 = 0f -
value.M11;
326 result.M12 = 0f -
value.M12;
327 result.M13 = 0f -
value.M13;
328 result.M14 = 0f -
value.M14;
329 result.M21 = 0f -
value.M21;
330 result.M22 = 0f -
value.M22;
331 result.M23 = 0f -
value.M23;
332 result.M24 = 0f -
value.M24;
333 result.M31 = 0f -
value.M31;
334 result.M32 = 0f -
value.M32;
335 result.M33 = 0f -
value.M33;
336 result.M34 = 0f -
value.M34;
337 result.M41 = 0f -
value.M41;
338 result.M42 = 0f -
value.M42;
339 result.M43 = 0f -
value.M43;
340 result.M44 = 0f -
value.M44;
347 return value1 + value2;
352 Vector3 left = objectPosition - cameraPosition;
358 result.M11 = vector.
X;
359 result.M12 = vector.
Y;
360 result.M13 = vector.
Z;
362 result.M21 = vector2.
X;
363 result.M22 = vector2.
Y;
364 result.M23 = vector2.
Z;
370 result.M41 = objectPosition.
X;
371 result.M42 = objectPosition.
Y;
372 result.M43 = objectPosition.
Z;
379 Vector3 left = objectPosition - cameraPosition;
388 vector2 = objectForwardVector;
403 result.M11 = vector3.
X;
404 result.M12 = vector3.
Y;
405 result.M13 = vector3.
Z;
407 result.M21 = vector.
X;
408 result.M22 = vector.
Y;
409 result.M23 = vector.
Z;
411 result.M31 = vector2.
X;
412 result.M32 = vector2.
Y;
413 result.M33 = vector2.
Z;
415 result.M41 = objectPosition.
X;
416 result.M42 = objectPosition.
Y;
417 result.M43 = objectPosition.
Z;
436 identity.M11 = num3 + num2 * (1f - num3);
437 identity.M12 = num6 - num2 * num6 + num * z;
438 identity.M13 = num7 - num2 * num7 - num * y;
439 identity.M21 = num6 - num2 * num6 - num * z;
440 identity.M22 = num4 + num2 * (1f - num4);
441 identity.M23 = num8 - num2 * num8 + num * x;
442 identity.M31 = num7 - num2 * num7 + num * y;
443 identity.M32 = num8 - num2 * num8 - num * x;
444 identity.M33 = num5 + num2 * (1f - num5);
451 float num = quaternion.X * quaternion.
X;
452 float num2 = quaternion.Y * quaternion.
Y;
453 float num3 = quaternion.Z * quaternion.
Z;
454 float num4 = quaternion.X * quaternion.
Y;
455 float num5 = quaternion.Z * quaternion.
W;
456 float num6 = quaternion.Z * quaternion.
X;
457 float num7 = quaternion.Y * quaternion.
W;
458 float num8 = quaternion.Y * quaternion.
Z;
459 float num9 = quaternion.X * quaternion.
W;
460 identity.M11 = 1f - 2f * (num2 + num3);
461 identity.M12 = 2f * (num4 + num5);
462 identity.M13 = 2f * (num6 - num7);
463 identity.M21 = 2f * (num4 - num5);
464 identity.M22 = 1f - 2f * (num3 + num);
465 identity.M23 = 2f * (num8 + num9);
466 identity.M31 = 2f * (num6 + num7);
467 identity.M32 = 2f * (num8 - num9);
468 identity.M33 = 1f - 2f * (num2 + num);
484 identity.M11 = vector2.
X;
485 identity.M12 = vector3.
X;
486 identity.M13 = vector.
X;
487 identity.M21 = vector2.
Y;
488 identity.M22 = vector3.
Y;
489 identity.M23 = vector.
Y;
490 identity.M31 = vector2.
Z;
491 identity.M32 = vector3.
Z;
492 identity.M33 = vector.
Z;
493 identity.M41 = 0f -
Vector3.
Dot(vector2, cameraPosition);
494 identity.M42 = 0f -
Vector3.
Dot(vector3, cameraPosition);
495 identity.M43 = 0f -
Vector3.
Dot(vector, cameraPosition);
502 identity.M11 = 2f / width;
503 identity.M22 = 2f / height;
504 identity.M33 = 1f / (zNearPlane - zFarPlane);
505 identity.M43 = zNearPlane / (zNearPlane - zFarPlane);
512 identity.M11 = 2f / (right - left);
513 identity.M22 = 2f / (top - bottom);
514 identity.M33 = 1f / (zNearPlane - zFarPlane);
515 identity.M41 = (left + right) / (left - right);
516 identity.M42 = (top + bottom) / (bottom - top);
517 identity.M43 = zNearPlane / (zNearPlane - zFarPlane);
523 if (nearPlaneDistance <= 0f)
527 if (farPlaneDistance <= 0f)
531 if (nearPlaneDistance >= farPlaneDistance)
536 result.M11 = 2f * nearPlaneDistance / width;
537 result.M12 = (result.M13 = (result.M14 = 0f));
538 result.M22 = 2f * nearPlaneDistance / height;
539 result.M21 = (result.M23 = (result.M24 = 0f));
540 float num = (result.M33 = (
float.IsPositiveInfinity(farPlaneDistance) ? (-1f) : (farPlaneDistance / (nearPlaneDistance - farPlaneDistance))));
541 result.M31 = (result.M32 = 0f);
543 result.M41 = (result.M42 = (result.M44 = 0f));
544 result.M43 = nearPlaneDistance * num;
550 if (fieldOfView <= 0f || fieldOfView >= (
float)
Math.
PI)
554 if (nearPlaneDistance <= 0f)
558 if (farPlaneDistance <= 0f)
562 if (nearPlaneDistance >= farPlaneDistance)
566 float num = 1f /
MathF.
Tan(fieldOfView * 0.5f);
567 float m = num / aspectRatio;
570 result.M12 = (result.M13 = (result.M14 = 0f));
572 result.M21 = (result.M23 = (result.M24 = 0f));
573 result.M31 = (result.M32 = 0f);
574 float num2 = (result.M33 = (
float.IsPositiveInfinity(farPlaneDistance) ? (-1f) : (farPlaneDistance / (nearPlaneDistance - farPlaneDistance))));
576 result.M41 = (result.M42 = (result.M44 = 0f));
577 result.M43 = nearPlaneDistance * num2;
583 if (nearPlaneDistance <= 0f)
587 if (farPlaneDistance <= 0f)
591 if (nearPlaneDistance >= farPlaneDistance)
596 result.M11 = 2f * nearPlaneDistance / (right - left);
597 result.M12 = (result.M13 = (result.M14 = 0f));
598 result.M22 = 2f * nearPlaneDistance / (top - bottom);
599 result.M21 = (result.M23 = (result.M24 = 0f));
600 result.M31 = (left + right) / (right - left);
601 result.M32 = (top + bottom) / (top - bottom);
602 float num = (result.M33 = (
float.IsPositiveInfinity(farPlaneDistance) ? (-1f) : (farPlaneDistance / (nearPlaneDistance - farPlaneDistance))));
604 result.M43 = nearPlaneDistance * num;
605 result.M41 = (result.M42 = (result.M44 = 0f));
612 float x =
value.Normal.X;
613 float y =
value.Normal.Y;
614 float z =
value.Normal.Z;
616 float num2 = -2f * y;
617 float num3 = -2f * z;
619 identity.M11 = num * x + 1f;
620 identity.M12 = num2 * x;
621 identity.M13 = num3 * x;
622 identity.M21 = num * y;
623 identity.M22 = num2 * y + 1f;
624 identity.M23 = num3 * y;
625 identity.M31 = num * z;
626 identity.M32 = num2 * z;
627 identity.M33 = num3 * z + 1f;
628 identity.M41 = num *
value.D;
629 identity.M42 = num2 *
value.D;
630 identity.M43 = num3 *
value.D;
641 identity.M32 = 0f - num2;
651 float m = centerPoint.Y * (1f - num) + centerPoint.
Z * num2;
652 float m2 = centerPoint.Z * (1f - num) - centerPoint.
Y * num2;
655 identity.M32 = 0f - num2;
668 identity.M13 = 0f - num2;
679 float m = centerPoint.X * (1f - num) - centerPoint.
Z * num2;
680 float m2 = centerPoint.Z * (1f - num) + centerPoint.
X * num2;
682 identity.M13 = 0f - num2;
697 identity.M21 = 0f - num2;
707 float m = centerPoint.X * (1f - num) + centerPoint.
Y * num2;
708 float m2 = centerPoint.Y * (1f - num) - centerPoint.
X * num2;
711 identity.M21 = 0f - num2;
721 identity.M11 = xScale;
722 identity.M22 = yScale;
723 identity.M33 = zScale;
730 float m = centerPoint.X * (1f - xScale);
731 float m2 = centerPoint.Y * (1f - yScale);
732 float m3 = centerPoint.Z * (1f - zScale);
733 identity.M11 = xScale;
734 identity.M22 = yScale;
735 identity.M33 = zScale;
745 identity.M11 = scales.
X;
746 identity.M22 = scales.
Y;
747 identity.M33 = scales.
Z;
754 float m = centerPoint.X * (1f - scales.
X);
755 float m2 = centerPoint.Y * (1f - scales.
Y);
756 float m3 = centerPoint.Z * (1f - scales.
Z);
757 identity.M11 = scales.
X;
758 identity.M22 = scales.
Y;
759 identity.M33 = scales.
Z;
769 identity.M11 = scale;
770 identity.M22 = scale;
771 identity.M33 = scale;
778 float m = centerPoint.X * (1f - scale);
779 float m2 = centerPoint.Y * (1f - scale);
780 float m3 = centerPoint.Z * (1f - scale);
781 identity.M11 = scale;
782 identity.M22 = scale;
783 identity.M33 = scale;
793 float num = plane2.Normal.X * lightDirection.X + plane2.Normal.Y * lightDirection.Y + plane2.Normal.Z * lightDirection.
Z;
794 float num2 = 0f - plane2.
Normal.
X;
795 float num3 = 0f - plane2.
Normal.
Y;
796 float num4 = 0f - plane2.
Normal.
Z;
797 float num5 = 0f - plane2.
D;
799 identity.M11 = num2 * lightDirection.X + num;
800 identity.M21 = num3 * lightDirection.
X;
801 identity.M31 = num4 * lightDirection.
X;
802 identity.M41 = num5 * lightDirection.
X;
803 identity.M12 = num2 * lightDirection.
Y;
804 identity.M22 = num3 * lightDirection.Y + num;
805 identity.M32 = num4 * lightDirection.
Y;
806 identity.M42 = num5 * lightDirection.
Y;
807 identity.M13 = num2 * lightDirection.
Z;
808 identity.M23 = num3 * lightDirection.
Z;
809 identity.M33 = num4 * lightDirection.Z + num;
810 identity.M43 = num5 * lightDirection.
Z;
818 identity.M41 = position.
X;
819 identity.M42 = position.
Y;
820 identity.M43 = position.
Z;
827 identity.M41 = xPosition;
828 identity.M42 = yPosition;
829 identity.M43 = zPosition;
839 identity.M11 = vector2.
X;
840 identity.M12 = vector2.
Y;
841 identity.M13 = vector2.
Z;
842 identity.M21 = vector3.
X;
843 identity.M22 = vector3.
Y;
844 identity.M23 = vector3.
Z;
845 identity.M31 = vector.
X;
846 identity.M32 = vector.
Y;
847 identity.M33 = vector.
Z;
848 identity.M41 = position.
X;
849 identity.M42 = position.
Y;
850 identity.M43 = position.
Z;
859 return SseImpl(matrix, out result);
861 return SoftwareFallback(matrix, out result);
864 float m = matrix.
M11;
865 float m2 = matrix.
M12;
866 float m3 = matrix.
M13;
867 float m4 = matrix.
M14;
868 float m5 = matrix.
M21;
869 float m6 = matrix.
M22;
870 float m7 = matrix.
M23;
871 float m8 = matrix.
M24;
872 float m9 = matrix.
M31;
873 float m10 = matrix.
M32;
874 float m11 = matrix.
M33;
875 float m12 = matrix.
M34;
876 float m13 = matrix.
M41;
877 float m14 = matrix.
M42;
878 float m15 = matrix.
M43;
879 float m16 = matrix.
M44;
880 float num = m11 * m16 - m12 * m15;
881 float num2 = m10 * m16 - m12 * m14;
882 float num3 = m10 * m15 - m11 * m14;
883 float num4 = m9 * m16 - m12 * m13;
884 float num5 = m9 * m15 - m11 * m13;
885 float num6 = m9 * m14 - m10 * m13;
886 float num7 = m6 * num - m7 * num2 + m8 * num3;
887 float num8 = 0f - (m5 * num - m7 * num4 + m8 * num5);
888 float num9 = m5 * num2 - m6 * num4 + m8 * num6;
889 float num10 = 0f - (m5 * num3 - m6 * num5 + m7 * num6);
890 float num11 = m * num7 + m2 * num8 + m3 * num9 + m4 * num10;
891 if (
MathF.
Abs(num11) <
float.Epsilon)
893 result =
new Matrix4x4(
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN);
896 float num12 = 1f / num11;
897 result.M11 = num7 * num12;
898 result.M21 = num8 * num12;
899 result.M31 = num9 * num12;
900 result.M41 = num10 * num12;
901 result.M12 = (0f - (m2 * num - m3 * num2 + m4 * num3)) * num12;
902 result.M22 = (m * num - m3 * num4 + m4 * num5) * num12;
903 result.M32 = (0f - (m * num2 - m2 * num4 + m4 * num6)) * num12;
904 result.M42 = (m * num3 - m2 * num5 + m3 * num6) * num12;
905 float num13 = m7 * m16 - m8 * m15;
906 float num14 = m6 * m16 - m8 * m14;
907 float num15 = m6 * m15 - m7 * m14;
908 float num16 = m5 * m16 - m8 * m13;
909 float num17 = m5 * m15 - m7 * m13;
910 float num18 = m5 * m14 - m6 * m13;
911 result.M13 = (m2 * num13 - m3 * num14 + m4 * num15) * num12;
912 result.M23 = (0f - (m * num13 - m3 * num16 + m4 * num17)) * num12;
913 result.M33 = (m * num14 - m2 * num16 + m4 * num18) * num12;
914 result.M43 = (0f - (m * num15 - m2 * num17 + m3 * num18)) * num12;
915 float num19 = m7 * m12 - m8 * m11;
916 float num20 = m6 * m12 - m8 * m10;
917 float num21 = m6 * m11 - m7 * m10;
918 float num22 = m5 * m12 - m8 * m9;
919 float num23 = m5 * m11 - m7 * m9;
920 float num24 = m5 * m10 - m6 * m9;
921 result.M14 = (0f - (m2 * num19 - m3 * num20 + m4 * num21)) * num12;
922 result.M24 = (m * num19 - m3 * num22 + m4 * num23) * num12;
923 result.M34 = (0f - (m * num20 - m2 * num22 + m4 * num24)) * num12;
924 result.M44 = (m * num21 - m2 * num23 + m3 * num24) * num12;
1002 left11 =
Permute(left11, 147);
1008 left13 =
Sse.
Add(left13, left5);
1012 left15 =
Sse.
Add(left15, left7);
1019 left13 =
Permute(left13, 216);
1020 left14 =
Permute(left14, 216);
1021 left15 =
Permute(left15, 216);
1022 left16 =
Permute(left16, 216);
1025 if (
MathF.
Abs(num25) <
float.Epsilon)
1027 result =
new Matrix4x4(
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN,
float.NaN);
1040 Unsafe.Add(ref reference, 1) = right;
1041 Unsafe.Add(ref reference, 2) = left2;
1042 Unsafe.Add(ref reference, 3) = right2;
1050 return value1 * value2;
1056 return value1 * value2;
1068 return value1 - value2;
1090 float* ptr2 = (
float*)ptr;
1096 canonicalBasis.Row0 =
new Vector3(1f, 0f, 0f);
1097 canonicalBasis.Row1 =
new Vector3(0f, 1f, 0f);
1098 canonicalBasis.Row2 =
new Vector3(0f, 0f, 1f);
1106 scale.X = (*ptr3)->Length();
1107 scale.Y = ptr3[1]->
Length();
1108 scale.Z = ptr3[2]->
Length();
1110 float num2 = ptr2[1];
1111 float num3 = ptr2[2];
1138 else if (num < num3)
1158 if (ptr2[num4] < 0.0001f)
1160 *ptr3[num4] = ptr4[num4];
1163 if (ptr2[num5] < 0.0001f)
1168 uint num10 = ((num7 < num8) ? ((!(num8 < num9)) ? ((!(num7 < num9)) ? 2u : 0u) : 0u) : ((num7 < num9) ? 1u : ((num8 < num9) ? 1u : 2u)));
1172 if (ptr2[num6] < 0.0001f)
1180 ptr2[num4] = 0f - ptr2[num4];
1181 *ptr3[num4] = -(*ptr3[num4]);
1186 if (0.0001f < num11)
1214 result.M11 = matrix1.M11 + (matrix2.M11 - matrix1.
M11) * amount;
1215 result.M12 = matrix1.M12 + (matrix2.M12 - matrix1.
M12) * amount;
1216 result.M13 = matrix1.M13 + (matrix2.M13 - matrix1.
M13) * amount;
1217 result.M14 = matrix1.M14 + (matrix2.M14 - matrix1.
M14) * amount;
1218 result.M21 = matrix1.M21 + (matrix2.M21 - matrix1.
M21) * amount;
1219 result.M22 = matrix1.M22 + (matrix2.M22 - matrix1.
M22) * amount;
1220 result.M23 = matrix1.M23 + (matrix2.M23 - matrix1.
M23) * amount;
1221 result.M24 = matrix1.M24 + (matrix2.M24 - matrix1.
M24) * amount;
1222 result.M31 = matrix1.M31 + (matrix2.M31 - matrix1.
M31) * amount;
1223 result.M32 = matrix1.M32 + (matrix2.M32 - matrix1.
M32) * amount;
1224 result.M33 = matrix1.M33 + (matrix2.M33 - matrix1.
M33) * amount;
1225 result.M34 = matrix1.M34 + (matrix2.M34 - matrix1.
M34) * amount;
1226 result.M41 = matrix1.M41 + (matrix2.M41 - matrix1.
M41) * amount;
1227 result.M42 = matrix1.M42 + (matrix2.M42 - matrix1.
M42) * amount;
1228 result.M43 = matrix1.M43 + (matrix2.M43 - matrix1.
M43) * amount;
1229 result.M44 = matrix1.M44 + (matrix2.M44 - matrix1.
M44) * amount;
1235 float num = rotation.X + rotation.
X;
1236 float num2 = rotation.Y + rotation.
Y;
1237 float num3 = rotation.Z + rotation.
Z;
1238 float num4 = rotation.W * num;
1239 float num5 = rotation.W * num2;
1240 float num6 = rotation.W * num3;
1241 float num7 = rotation.X * num;
1242 float num8 = rotation.X * num2;
1243 float num9 = rotation.X * num3;
1244 float num10 = rotation.Y * num2;
1245 float num11 = rotation.Y * num3;
1246 float num12 = rotation.Z * num3;
1247 float num13 = 1f - num10 - num12;
1248 float num14 = num8 - num6;
1249 float num15 = num9 + num5;
1250 float num16 = num8 + num6;
1251 float num17 = 1f - num7 - num12;
1252 float num18 = num11 - num4;
1253 float num19 = num9 - num5;
1254 float num20 = num11 + num4;
1255 float num21 = 1f - num7 - num10;
1257 result.M11 = value.M11 * num13 + value.M12 * num14 + value.M13 * num15;
1258 result.M12 = value.M11 * num16 + value.M12 * num17 + value.M13 * num18;
1259 result.M13 = value.M11 * num19 + value.M12 * num20 + value.M13 * num21;
1260 result.M14 =
value.M14;
1261 result.M21 = value.M21 * num13 + value.M22 * num14 + value.M23 * num15;
1262 result.M22 = value.M21 * num16 + value.M22 * num17 + value.M23 * num18;
1263 result.M23 = value.M21 * num19 + value.M22 * num20 + value.M23 * num21;
1264 result.M24 =
value.M24;
1265 result.M31 = value.M31 * num13 + value.M32 * num14 + value.M33 * num15;
1266 result.M32 = value.M31 * num16 + value.M32 * num17 + value.M33 * num18;
1267 result.M33 = value.M31 * num19 + value.M32 * num20 + value.M33 * num21;
1268 result.M34 =
value.M34;
1269 result.M41 = value.M41 * num13 + value.M42 * num14 + value.M43 * num15;
1270 result.M42 = value.M41 * num16 + value.M42 * num17 + value.M43 * num18;
1271 result.M43 = value.M41 * num19 + value.M42 * num20 + value.M43 * num21;
1272 result.M44 =
value.M44;
1298 result.M11 = matrix.
M11;
1299 result.M12 = matrix.
M21;
1300 result.M13 = matrix.
M31;
1301 result.M14 = matrix.
M41;
1302 result.M21 = matrix.
M12;
1303 result.M22 = matrix.
M22;
1304 result.M23 = matrix.
M32;
1305 result.M24 = matrix.
M42;
1306 result.M31 = matrix.
M13;
1307 result.M32 = matrix.
M23;
1308 result.M33 = matrix.
M33;
1309 result.M34 = matrix.
M43;
1310 result.M41 = matrix.
M14;
1311 result.M42 = matrix.
M24;
1312 result.M43 = matrix.
M34;
1313 result.M44 = matrix.
M44;
1318 public override readonly
bool Equals([NotNullWhen(
true)]
object?
obj)
1329 return this ==
other;
1350 float num = m11 * m16 - m12 * m15;
1351 float num2 = m10 * m16 - m12 * m14;
1352 float num3 = m10 * m15 - m11 * m14;
1353 float num4 = m9 * m16 - m12 * m13;
1354 float num5 = m9 * m15 - m11 * m13;
1355 float num6 = m9 * m14 - m10 * m13;
1356 return m * (m6 * num - m7 * num2 + m8 * num3) - m2 * (m5 * num - m7 * num4 + m8 * num5) + m3 * (m5 * num2 - m6 * num4 + m8 * num6) - m4 * (m5 * num3 - m6 * num5 + m7 * num6);
1383 return $
"{{ {{M11:{M11} M12:{M12} M13:{M13} M14:{M14}}} {{M21:{M21} M22:{M22} M23:{M23} M24:{M24}}} {{M31:{M31} M32:{M32} M33:{M33} M34:{M34}}} {{M41:{M41} M42:{M42} M43:{M43} M44:{M44}}} }}";
static float Abs(float x)
static float Sqrt(float x)
static float Cos(float x)
static float Sin(float x)
static float Tan(float x)
static Vector128< float > Lerp(Vector128< float > a, Vector128< float > b, Vector128< float > t)
static bool Equal(Vector128< float > vector1, Vector128< float > vector2)
static bool NotEqual(Vector128< float > vector1, Vector128< float > vector2)
static new bool IsSupported
static new bool IsSupported
static Vector128< byte > Create(byte value)
static Vector4 AsVector4(this Vector128< float > value)
static Vector128< T > Zero
static new bool IsSupported
static Vector128< float > Permute(Vector128< float > value, byte control)
static Vector128< float > MoveHighToLow(Vector128< float > left, Vector128< float > right)
static unsafe void Store(float *address, Vector128< float > source)
static Vector128< float > UnpackHigh(Vector128< float > left, Vector128< float > right)
static new bool IsSupported
static unsafe Vector128< float > LoadVector128(float *address)
static Vector128< float > Shuffle(Vector128< float > left, Vector128< float > right, byte control)
static Vector128< float > Multiply(Vector128< float > left, Vector128< float > right)
static Vector128< float > UnpackLow(Vector128< float > left, Vector128< float > right)
static Vector128< float > Add(Vector128< float > left, Vector128< float > right)
static Vector128< float > Subtract(Vector128< float > left, Vector128< float > right)
static Vector128< float > Divide(Vector128< float > left, Vector128< float > right)
static Vector128< float > MoveLowToHigh(Vector128< float > left, Vector128< float > right)
unsafe Vector3 * Element2
unsafe Vector3 * Element1
unsafe Vector3 * Element0
static Matrix4x4 Transform(Matrix4x4 value, Quaternion rotation)
static unsafe bool Decompose(Matrix4x4 matrix, out Vector3 scale, out Quaternion rotation, out Vector3 translation)
static Matrix4x4 Subtract(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance)
static Matrix4x4 CreateFromQuaternion(Quaternion quaternion)
static unsafe Matrix4x4 Lerp(Matrix4x4 matrix1, Matrix4x4 matrix2, float amount)
static Matrix4x4 CreateBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Vector3 cameraForwardVector)
static Matrix4x4 Negate(Matrix4x4 value)
static Matrix4x4 CreateTranslation(float xPosition, float yPosition, float zPosition)
static bool Invert(Matrix4x4 matrix, out Matrix4x4 result)
static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint)
static Matrix4x4 CreateFromAxisAngle(Vector3 axis, float angle)
static Matrix4x4 CreateScale(float scale)
static Matrix4x4 CreateScale(float xScale, float yScale, float zScale)
static unsafe Matrix4x4 operator-(Matrix4x4 value1, Matrix4x4 value2)
override readonly bool Equals([NotNullWhen(true)] object? obj)
static Matrix4x4 Multiply(Matrix4x4 value1, float value2)
static unsafe bool operator==(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 CreateScale(float xScale, float yScale, float zScale, Vector3 centerPoint)
static Matrix4x4 CreateReflection(Plane value)
static Matrix4x4 CreateRotationY(float radians)
static Matrix4x4 CreateScale(Vector3 scales)
static unsafe bool operator!=(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 CreateRotationZ(float radians, Vector3 centerPoint)
static Matrix4x4 CreateScale(float scale, Vector3 centerPoint)
static Matrix4x4 CreateShadow(Vector3 lightDirection, Plane plane)
static readonly Matrix4x4 _identity
static Matrix4x4 CreateRotationX(float radians)
Matrix4x4(Matrix3x2 value)
Matrix4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
override readonly string ToString()
static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint)
static unsafe Matrix4x4 operator*(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 Identity
override readonly int GetHashCode()
static Matrix4x4 CreateConstrainedBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Vector3 cameraForwardVector, Vector3 objectForwardVector)
static Matrix4x4 CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector)
static Matrix4x4 CreateWorld(Vector3 position, Vector3 forward, Vector3 up)
static Matrix4x4 CreateScale(Vector3 scales, Vector3 centerPoint)
static Matrix4x4 CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance)
static Matrix4x4 Add(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 Multiply(Matrix4x4 value1, Matrix4x4 value2)
static Matrix4x4 CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance)
static Matrix4x4 CreateFromYawPitchRoll(float yaw, float pitch, float roll)
static Matrix4x4 CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane)
static unsafe Matrix4x4 Transpose(Matrix4x4 matrix)
static Matrix4x4 CreateRotationZ(float radians)
readonly float GetDeterminant()
static Vector128< float > Permute(Vector128< float > value, byte control)
static Matrix4x4 CreateTranslation(Vector3 position)
readonly bool Equals(Matrix4x4 other)
static Matrix4x4 CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane)
static unsafe Matrix4x4 operator+(Matrix4x4 value1, Matrix4x4 value2)
static Plane Normalize(Plane value)
static Quaternion Identity
static Quaternion CreateFromRotationMatrix(Matrix4x4 matrix)
static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)
static Vector3 Cross(Vector3 vector1, Vector3 vector2)
readonly float LengthSquared()
static float Dot(Vector3 vector1, Vector3 vector2)
static Vector3 Multiply(Vector3 left, Vector3 right)
static Vector3 Normalize(Vector3 value)
static float Dot(Vector4 vector1, Vector4 vector2)