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

◆ Transform() [5/8]

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

Definition at line 523 of file Vector3.cs.

524 {
525 if (sourceArray == null)
526 {
527 throw new ArgumentNullException("sourceArray");
528 }
529 if (destinationArray == null)
530 {
531 throw new ArgumentNullException("destinationArray");
532 }
533 if (sourceArray.Length < (long)sourceIndex + (long)length)
534 {
535 throw new ArgumentException(FrameworkResources.NotEnoughSourceSize);
536 }
537 if (destinationArray.Length < (long)destinationIndex + (long)length)
538 {
539 throw new ArgumentException(FrameworkResources.NotEnoughTargetSize);
540 }
541 while (length > 0)
542 {
543 float x = sourceArray[sourceIndex].X;
544 float y = sourceArray[sourceIndex].Y;
545 float z = sourceArray[sourceIndex].Z;
546 destinationArray[destinationIndex].X = x * matrix.M11 + y * matrix.M21 + z * matrix.M31 + matrix.M41;
547 destinationArray[destinationIndex].Y = x * matrix.M12 + y * matrix.M22 + z * matrix.M32 + matrix.M42;
548 destinationArray[destinationIndex].Z = x * matrix.M13 + y * matrix.M23 + z * matrix.M33 + matrix.M43;
549 sourceIndex++;
551 length--;
552 }
553 }

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