Skip to content

Commit 44f5974

Browse files
committed
C#: Add Basis.ScaledLocal
1 parent 42c7f14 commit 44f5974

File tree

1 file changed

+14
-0
lines changed
  • modules/mono/glue/GodotSharp/GodotSharp/Core

1 file changed

+14
-0
lines changed

modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,20 @@ public readonly Basis Scaled(Vector3 scale)
717717
return b;
718718
}
719719

720+
/// <summary>
721+
/// Returns this basis with each axis scaled by the corresponding component in the given <paramref name="scale"/>. The basis matrix's columns are multiplied by <paramref name="scale"/>'s components. This operation is a local scale (relative to self).
722+
/// </summary>
723+
/// <param name="scale">The scale to introduce.</param>
724+
/// <returns>The scaled basis matrix.</returns>
725+
public readonly Basis ScaledLocal(Vector3 scale)
726+
{
727+
Basis b = this;
728+
b.Row0 *= scale;
729+
b.Row1 *= scale;
730+
b.Row2 *= scale;
731+
return b;
732+
}
733+
720734
/// <summary>
721735
/// Assuming that the matrix is a proper rotation matrix, slerp performs
722736
/// a spherical-linear interpolation with another rotation matrix.

0 commit comments

Comments
 (0)