Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreatePerspectiveOffCenter()

static Matrix4x4 System.Numerics.Matrix4x4.CreatePerspectiveOffCenter ( float left,
float right,
float bottom,
float top,
float nearPlaneDistance,
float farPlaneDistance )
inlinestatic

Definition at line 581 of file Matrix4x4.cs.

582 {
583 if (nearPlaneDistance <= 0f)
584 {
585 throw new ArgumentOutOfRangeException("nearPlaneDistance");
586 }
587 if (farPlaneDistance <= 0f)
588 {
589 throw new ArgumentOutOfRangeException("farPlaneDistance");
590 }
591 if (nearPlaneDistance >= farPlaneDistance)
592 {
593 throw new ArgumentOutOfRangeException("nearPlaneDistance");
594 }
595 System.Runtime.CompilerServices.Unsafe.SkipInit(out Matrix4x4 result);
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))));
603 result.M34 = -1f;
604 result.M43 = nearPlaneDistance * num;
605 result.M41 = (result.M42 = (result.M44 = 0f));
606 return result;
607 }
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)
Definition Matrix4x4.cs:93