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

◆ CreatePerspectiveOffCenter() [1/2]

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

Definition at line 972 of file Matrix.cs.

973 {
974 if (nearPlaneDistance <= 0f)
975 {
976 throw new ArgumentOutOfRangeException("nearPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "nearPlaneDistance" }));
977 }
978 if (farPlaneDistance <= 0f)
979 {
980 throw new ArgumentOutOfRangeException("farPlaneDistance", string.Format(CultureInfo.CurrentCulture, FrameworkResources.NegativePlaneDistance, new object[1] { "farPlaneDistance" }));
981 }
982 if (nearPlaneDistance >= farPlaneDistance)
983 {
984 throw new ArgumentOutOfRangeException("nearPlaneDistance", FrameworkResources.OppositePlanes);
985 }
986 Matrix result = default(Matrix);
987 result.M11 = 2f * nearPlaneDistance / (right - left);
988 result.M12 = (result.M13 = (result.M14 = 0f));
989 result.M22 = 2f * nearPlaneDistance / (top - bottom);
990 result.M21 = (result.M23 = (result.M24 = 0f));
991 result.M31 = (left + right) / (right - left);
992 result.M32 = (top + bottom) / (top - bottom);
993 result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
994 result.M34 = -1f;
995 result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance);
996 result.M41 = (result.M42 = (result.M44 = 0f));
997 return result;
998 }
static CultureInfo CurrentCulture
Matrix(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 Matrix.cs:210

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