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

◆ CreatePerspective() [2/2]

static void Microsoft.Xna.Framework.Matrix.CreatePerspective ( float width,
float height,
float nearPlaneDistance,
float farPlaneDistance,
out Matrix result )
inlinestatic

Definition at line 947 of file Matrix.cs.

948 {
949 if (nearPlaneDistance <= 0f)
950 {
951 throw new ArgumentOutOfRangeException("nearPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "nearPlaneDistance" }));
952 }
953 if (farPlaneDistance <= 0f)
954 {
955 throw new ArgumentOutOfRangeException("farPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "farPlaneDistance" }));
956 }
957 if (nearPlaneDistance >= farPlaneDistance)
958 {
959 throw new ArgumentOutOfRangeException("nearPlaneDistance", FrameworkResources.OppositePlanes);
960 }
961 result.M11 = 2f * nearPlaneDistance / width;
962 result.M12 = (result.M13 = (result.M14 = 0f));
963 result.M22 = 2f * nearPlaneDistance / height;
964 result.M21 = (result.M23 = (result.M24 = 0f));
965 result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
966 result.M31 = (result.M32 = 0f);
967 result.M34 = -1f;
968 result.M41 = (result.M42 = (result.M44 = 0f));
969 result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
970 }
static CultureInfo CurrentCulture

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