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

◆ CreateWorld() [1/2]

static void Microsoft.Xna.Framework.Matrix.CreateWorld ( ref Vector3 position,
ref Vector3 forward,
ref Vector3 up,
out Matrix result )
inlinestatic

Definition at line 1157 of file Matrix.cs.

1158 {
1159 Vector3 vector = Vector3.Normalize(-forward);
1160 Vector3 vector2 = Vector3.Normalize(Vector3.Cross(up, vector));
1161 Vector3 vector3 = Vector3.Cross(vector, vector2);
1162 result.M11 = vector2.X;
1163 result.M12 = vector2.Y;
1164 result.M13 = vector2.Z;
1165 result.M14 = 0f;
1166 result.M21 = vector3.X;
1167 result.M22 = vector3.Y;
1168 result.M23 = vector3.Z;
1169 result.M24 = 0f;
1170 result.M31 = vector.X;
1171 result.M32 = vector.Y;
1172 result.M33 = vector.Z;
1173 result.M34 = 0f;
1174 result.M41 = position.X;
1175 result.M42 = position.Y;
1176 result.M43 = position.Z;
1177 result.M44 = 1f;
1178 }

References Microsoft.Xna.Framework.Vector3.Cross(), Microsoft.Xna.Framework.Vector3.Normalize(), Microsoft.Xna.Framework.Vector3.X, Microsoft.Xna.Framework.Vector3.Y, and Microsoft.Xna.Framework.Vector3.Z.