Merge pull request #83691 from theraot/slidedocs

Expanded documentation for vector slide and project
This commit is contained in:
Rémi Verschelde 2024-02-26 10:48:37 +01:00
commit 9509a9e8dd
No known key found for this signature in database
GPG Key ID: C3336907360768E1
4 changed files with 26 additions and 10 deletions

View File

@ -315,7 +315,8 @@
<return type="Vector2" />
<param index="0" name="b" type="Vector2" />
<description>
Returns the result of projecting the vector onto the given vector [param b].
Returns a new vector resulting from projecting this vector onto the given vector [param b]. The resulting new vector is parallel to [param b]. See also [method slide].
[b]Note:[/b] If the vector [param b] is a zero vector, the components of the resulting new vector will be [constant @GDScript.NAN].
</description>
</method>
<method name="reflect" qualifiers="const">
@ -357,7 +358,8 @@
<return type="Vector2" />
<param index="0" name="n" type="Vector2" />
<description>
Returns the result of sliding the vector along a plane defined by the given normal.
Returns a new vector resulting from sliding this vector along a line with normal [param n]. The resulting new vector is perpendicular to [param n], and is equivalent to this vector minus its projection on [param n]. See also [method project].
[b]Note:[/b] The vector [param n] must be normalized. See also [method normalized].
</description>
</method>
<method name="snapped" qualifiers="const">

View File

@ -299,7 +299,8 @@
<return type="Vector3" />
<param index="0" name="b" type="Vector3" />
<description>
Returns the result of projecting the vector onto the given vector [param b].
Returns a new vector resulting from projecting this vector onto the given vector [param b]. The resulting new vector is parallel to [param b]. See also [method slide].
[b]Note:[/b] If the vector [param b] is a zero vector, the components of the resulting new vector will be [constant @GDScript.NAN].
</description>
</method>
<method name="reflect" qualifiers="const">
@ -350,7 +351,8 @@
<return type="Vector3" />
<param index="0" name="n" type="Vector3" />
<description>
Returns a new vector slid along a plane defined by the given normal.
Returns a new vector resulting from sliding this vector along a plane with normal [param n]. The resulting new vector is perpendicular to [param n], and is equivalent to this vector minus its projection on [param n]. See also [method project].
[b]Note:[/b] The vector [param n] must be normalized. See also [method normalized].
</description>
</method>
<method name="snapped" qualifiers="const">

View File

@ -492,7 +492,10 @@ namespace Godot
}
/// <summary>
/// Returns this vector projected onto another vector <paramref name="onNormal"/>.
/// Returns a new vector resulting from projecting this vector onto the given vector <paramref name="onNormal"/>.
/// The resulting new vector is parallel to <paramref name="onNormal"/>.
/// See also <see cref="Slide(Vector2)"/>.
/// Note: If the vector <paramref name="onNormal"/> is a zero vector, the components of the resulting new vector will be <see cref="real_t.NaN"/>.
/// </summary>
/// <param name="onNormal">The vector to project onto.</param>
/// <returns>The projected vector.</returns>
@ -583,9 +586,12 @@ namespace Godot
}
/// <summary>
/// Returns this vector slid along a plane defined by the given <paramref name="normal"/>.
/// Returns a new vector resulting from sliding this vector along a line with normal <paramref name="normal"/>.
/// The resulting new vector is perpendicular to <paramref name="normal"/>, and is equivalent to this vector minus its projection on <paramref name="normal"/>.
/// See also <see cref="Project(Vector2)"/>.
/// Note: The vector <paramref name="normal"/> must be normalized. See also <see cref="Normalized()"/>.
/// </summary>
/// <param name="normal">The normal vector defining the plane to slide on.</param>
/// <param name="normal">The normal vector of the plane to slide on.</param>
/// <returns>The slid vector.</returns>
public readonly Vector2 Slide(Vector2 normal)
{

View File

@ -514,7 +514,10 @@ namespace Godot
}
/// <summary>
/// Returns this vector projected onto another vector <paramref name="onNormal"/>.
/// Returns a new vector resulting from projecting this vector onto the given vector <paramref name="onNormal"/>.
/// The resulting new vector is parallel to <paramref name="onNormal"/>.
/// See also <see cref="Slide(Vector3)"/>.
/// Note: If the vector <paramref name="onNormal"/> is a zero vector, the components of the resulting new vector will be <see cref="real_t.NaN"/>.
/// </summary>
/// <param name="onNormal">The vector to project onto.</param>
/// <returns>The projected vector.</returns>
@ -626,9 +629,12 @@ namespace Godot
}
/// <summary>
/// Returns this vector slid along a plane defined by the given <paramref name="normal"/>.
/// Returns a new vector resulting from sliding this vector along a plane with normal <paramref name="normal"/>.
/// The resulting new vector is perpendicular to <paramref name="normal"/>, and is equivalent to this vector minus its projection on <paramref name="normal"/>.
/// See also <see cref="Project(Vector3)"/>.
/// Note: The vector <paramref name="normal"/> must be normalized. See also <see cref="Normalized()"/>.
/// </summary>
/// <param name="normal">The normal vector defining the plane to slide on.</param>
/// <param name="normal">The normal vector of the plane to slide on.</param>
/// <returns>The slid vector.</returns>
public readonly Vector3 Slide(Vector3 normal)
{