From 44f5974bb7b72432ac12d023806b78ca80a320ca Mon Sep 17 00:00:00 2001 From: LuoZhihao Date: Mon, 9 Jun 2025 12:31:50 +0800 Subject: [PATCH] C#: Add `Basis.ScaledLocal` --- .../mono/glue/GodotSharp/GodotSharp/Core/Basis.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index 8679f32e1a0..10ca28a025d 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -717,6 +717,20 @@ namespace Godot return b; } + /// + /// Returns this basis with each axis scaled by the corresponding component in the given . The basis matrix's columns are multiplied by 's components. This operation is a local scale (relative to self). + /// + /// The scale to introduce. + /// The scaled basis matrix. + public readonly Basis ScaledLocal(Vector3 scale) + { + Basis b = this; + b.Row0 *= scale; + b.Row1 *= scale; + b.Row2 *= scale; + return b; + } + /// /// Assuming that the matrix is a proper rotation matrix, slerp performs /// a spherical-linear interpolation with another rotation matrix.