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

◆ Transform() [6/8]

static void Microsoft.Xna.Framework.Vector3.Transform ( Vector3[] sourceArray,
int sourceIndex,
ref Quaternion rotation,
Vector3[] destinationArray,
int destinationIndex,
int length )
inlinestatic

Definition at line 660 of file Vector3.cs.

661 {
662 if (sourceArray == null)
663 {
664 throw new ArgumentNullException("sourceArray");
665 }
666 if (destinationArray == null)
667 {
668 throw new ArgumentNullException("destinationArray");
669 }
670 if (sourceArray.Length < (long)sourceIndex + (long)length)
671 {
672 throw new ArgumentException(FrameworkResources.NotEnoughSourceSize);
673 }
674 if (destinationArray.Length < (long)destinationIndex + (long)length)
675 {
676 throw new ArgumentException(FrameworkResources.NotEnoughTargetSize);
677 }
678 float num = rotation.X + rotation.X;
679 float num2 = rotation.Y + rotation.Y;
680 float num3 = rotation.Z + rotation.Z;
681 float num4 = rotation.W * num;
682 float num5 = rotation.W * num2;
683 float num6 = rotation.W * num3;
684 float num7 = rotation.X * num;
685 float num8 = rotation.X * num2;
686 float num9 = rotation.X * num3;
687 float num10 = rotation.Y * num2;
688 float num11 = rotation.Y * num3;
689 float num12 = rotation.Z * num3;
690 float num13 = 1f - num10 - num12;
691 float num14 = num8 - num6;
692 float num15 = num9 + num5;
693 float num16 = num8 + num6;
694 float num17 = 1f - num7 - num12;
695 float num18 = num11 - num4;
696 float num19 = num9 - num5;
697 float num20 = num11 + num4;
698 float num21 = 1f - num7 - num10;
699 while (length > 0)
700 {
701 float x = sourceArray[sourceIndex].X;
702 float y = sourceArray[sourceIndex].Y;
703 float z = sourceArray[sourceIndex].Z;
704 destinationArray[destinationIndex].X = x * num13 + y * num14 + z * num15;
705 destinationArray[destinationIndex].Y = x * num16 + y * num17 + z * num18;
706 destinationArray[destinationIndex].Z = x * num19 + y * num20 + z * num21;
707 sourceIndex++;
709 length--;
710 }
711 }

References System.destinationArray, System.destinationIndex, System.length, Microsoft.Xna.Framework.FrameworkResources.NotEnoughSourceSize, Microsoft.Xna.Framework.FrameworkResources.NotEnoughTargetSize, System.sourceArray, and System.sourceIndex.