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

◆ Transform() [14/16]

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

Definition at line 719 of file Vector4.cs.

720 {
721 if (sourceArray == null)
722 {
723 throw new ArgumentNullException("sourceArray");
724 }
725 if (destinationArray == null)
726 {
727 throw new ArgumentNullException("destinationArray");
728 }
729 if (sourceArray.Length < (long)sourceIndex + (long)length)
730 {
731 throw new ArgumentException(FrameworkResources.NotEnoughSourceSize);
732 }
733 if (destinationArray.Length < (long)destinationIndex + (long)length)
734 {
735 throw new ArgumentException(FrameworkResources.NotEnoughTargetSize);
736 }
737 float num = rotation.X + rotation.X;
738 float num2 = rotation.Y + rotation.Y;
739 float num3 = rotation.Z + rotation.Z;
740 float num4 = rotation.W * num;
741 float num5 = rotation.W * num2;
742 float num6 = rotation.W * num3;
743 float num7 = rotation.X * num;
744 float num8 = rotation.X * num2;
745 float num9 = rotation.X * num3;
746 float num10 = rotation.Y * num2;
747 float num11 = rotation.Y * num3;
748 float num12 = rotation.Z * num3;
749 float num13 = 1f - num10 - num12;
750 float num14 = num8 - num6;
751 float num15 = num9 + num5;
752 float num16 = num8 + num6;
753 float num17 = 1f - num7 - num12;
754 float num18 = num11 - num4;
755 float num19 = num9 - num5;
756 float num20 = num11 + num4;
757 float num21 = 1f - num7 - num10;
758 while (length > 0)
759 {
760 float x = sourceArray[sourceIndex].X;
761 float y = sourceArray[sourceIndex].Y;
762 float z = sourceArray[sourceIndex].Z;
763 float w = sourceArray[sourceIndex].W;
764 destinationArray[destinationIndex].X = x * num13 + y * num14 + z * num15;
765 destinationArray[destinationIndex].Y = x * num16 + y * num17 + z * num18;
766 destinationArray[destinationIndex].Z = x * num19 + y * num20 + z * num21;
768 sourceIndex++;
770 length--;
771 }
772 }

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