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

◆ CreateShadow() [2/2]

static Matrix Microsoft.Xna.Framework.Matrix.CreateShadow ( Vector3 lightDirection,
Plane plane )
inlinestatic

Definition at line 1253 of file Matrix.cs.

1254 {
1255 Plane.Normalize(ref plane, out var result);
1256 float num = result.Normal.X * lightDirection.X + result.Normal.Y * lightDirection.Y + result.Normal.Z * lightDirection.Z;
1257 float num2 = 0f - result.Normal.X;
1258 float num3 = 0f - result.Normal.Y;
1259 float num4 = 0f - result.Normal.Z;
1260 float num5 = 0f - result.D;
1261 Matrix result2 = default(Matrix);
1262 result2.M11 = num2 * lightDirection.X + num;
1263 result2.M21 = num3 * lightDirection.X;
1264 result2.M31 = num4 * lightDirection.X;
1265 result2.M41 = num5 * lightDirection.X;
1266 result2.M12 = num2 * lightDirection.Y;
1267 result2.M22 = num3 * lightDirection.Y + num;
1268 result2.M32 = num4 * lightDirection.Y;
1269 result2.M42 = num5 * lightDirection.Y;
1270 result2.M13 = num2 * lightDirection.Z;
1271 result2.M23 = num3 * lightDirection.Z;
1272 result2.M33 = num4 * lightDirection.Z + num;
1273 result2.M43 = num5 * lightDirection.Z;
1274 result2.M14 = 0f;
1275 result2.M24 = 0f;
1276 result2.M34 = 0f;
1277 result2.M44 = num;
1278 return result2;
1279 }
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 Microsoft.Xna.Framework.Plane.Normalize(), Microsoft.Xna.Framework.Vector3.X, Microsoft.Xna.Framework.Vector3.Y, and Microsoft.Xna.Framework.Vector3.Z.