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

◆ Transform() [2/8]

static void Microsoft.Xna.Framework.Vector3.Transform ( ref Vector3 value,
ref Quaternion rotation,
out Vector3 result )
inlinestatic

Definition at line 475 of file Vector3.cs.

476 {
477 float num = rotation.X + rotation.X;
478 float num2 = rotation.Y + rotation.Y;
479 float num3 = rotation.Z + rotation.Z;
480 float num4 = rotation.W * num;
481 float num5 = rotation.W * num2;
482 float num6 = rotation.W * num3;
483 float num7 = rotation.X * num;
484 float num8 = rotation.X * num2;
485 float num9 = rotation.X * num3;
486 float num10 = rotation.Y * num2;
487 float num11 = rotation.Y * num3;
488 float num12 = rotation.Z * num3;
489 float x = value.X * (1f - num10 - num12) + value.Y * (num8 - num6) + value.Z * (num9 + num5);
490 float y = value.X * (num8 + num6) + value.Y * (1f - num7 - num12) + value.Z * (num11 - num4);
491 float z = value.X * (num9 - num5) + value.Y * (num11 + num4) + value.Z * (1f - num7 - num10);
492 result.X = x;
493 result.Y = y;
494 result.Z = z;
495 }

References System.value.