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

◆ Transform() [13/16]

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

Definition at line 637 of file Vector4.cs.

638 {
639 if (sourceArray == null)
640 {
641 throw new ArgumentNullException("sourceArray");
642 }
643 if (destinationArray == null)
644 {
645 throw new ArgumentNullException("destinationArray");
646 }
647 if (sourceArray.Length < (long)sourceIndex + (long)length)
648 {
649 throw new ArgumentException(FrameworkResources.NotEnoughSourceSize);
650 }
651 if (destinationArray.Length < (long)destinationIndex + (long)length)
652 {
653 throw new ArgumentException(FrameworkResources.NotEnoughTargetSize);
654 }
655 while (length > 0)
656 {
657 float x = sourceArray[sourceIndex].X;
658 float y = sourceArray[sourceIndex].Y;
659 float z = sourceArray[sourceIndex].Z;
660 float w = sourceArray[sourceIndex].W;
661 destinationArray[destinationIndex].X = x * matrix.M11 + y * matrix.M21 + z * matrix.M31 + w * matrix.M41;
662 destinationArray[destinationIndex].Y = x * matrix.M12 + y * matrix.M22 + z * matrix.M32 + w * matrix.M42;
663 destinationArray[destinationIndex].Z = x * matrix.M13 + y * matrix.M23 + z * matrix.M33 + w * matrix.M43;
664 destinationArray[destinationIndex].W = x * matrix.M14 + y * matrix.M24 + z * matrix.M34 + w * matrix.M44;
665 sourceIndex++;
667 length--;
668 }
669 }

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