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

◆ CreatePerspectiveOffCenter() [2/2]

static void Microsoft.Xna.Framework.Matrix.CreatePerspectiveOffCenter ( float left,
float right,
float bottom,
float top,
float nearPlaneDistance,
float farPlaneDistance,
out Matrix result )
inlinestatic

Definition at line 1000 of file Matrix.cs.

1001 {
1002 if (nearPlaneDistance <= 0f)
1003 {
1004 throw new ArgumentOutOfRangeException("nearPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "nearPlaneDistance" }));
1005 }
1006 if (farPlaneDistance <= 0f)
1007 {
1008 throw new ArgumentOutOfRangeException("farPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "farPlaneDistance" }));
1009 }
1010 if (nearPlaneDistance >= farPlaneDistance)
1011 {
1012 throw new ArgumentOutOfRangeException("nearPlaneDistance", FrameworkResources.OppositePlanes);
1013 }
1014 result.M11 = 2f * nearPlaneDistance / (right - left);
1015 result.M12 = (result.M13 = (result.M14 = 0f));
1016 result.M22 = 2f * nearPlaneDistance / (top - bottom);
1017 result.M21 = (result.M23 = (result.M24 = 0f));
1018 result.M31 = (left + right) / (right - left);
1019 result.M32 = (top + bottom) / (top - bottom);
1020 result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
1021 result.M34 = -1f;
1022 result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
1023 result.M41 = (result.M42 = (result.M44 = 0f));
1024 }
static CultureInfo CurrentCulture

References System.Globalization.CultureInfo.CurrentCulture, System.Globalization.Format, Microsoft.Xna.Framework.FrameworkResources.NegativePlaneDistance, and Microsoft.Xna.Framework.FrameworkResources.OppositePlanes.