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

◆ Transform() [6/8]

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

Definition at line 531 of file Vector2.cs.

532 {
533 if (sourceArray == null)
534 {
535 throw new ArgumentNullException("sourceArray");
536 }
537 if (destinationArray == null)
538 {
539 throw new ArgumentNullException("destinationArray");
540 }
541 if (sourceArray.Length < (long)sourceIndex + (long)length)
542 {
543 throw new ArgumentException(FrameworkResources.NotEnoughSourceSize);
544 }
545 if (destinationArray.Length < (long)destinationIndex + (long)length)
546 {
547 throw new ArgumentException(FrameworkResources.NotEnoughTargetSize);
548 }
549 float num = rotation.X + rotation.X;
550 float num2 = rotation.Y + rotation.Y;
551 float num3 = rotation.Z + rotation.Z;
552 float num4 = rotation.W * num3;
553 float num5 = rotation.X * num;
554 float num6 = rotation.X * num2;
555 float num7 = rotation.Y * num2;
556 float num8 = rotation.Z * num3;
557 float num9 = 1f - num7 - num8;
558 float num10 = num6 - num4;
559 float num11 = num6 + num4;
560 float num12 = 1f - num5 - num8;
561 while (length > 0)
562 {
563 float x = sourceArray[sourceIndex].X;
564 float y = sourceArray[sourceIndex].Y;
565 destinationArray[destinationIndex].X = x * num9 + y * num10;
566 destinationArray[destinationIndex].Y = x * num11 + y * num12;
567 sourceIndex++;
569 length--;
570 }
571 }

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