1
0
Fork 0

Clarify type-specific `lerp()` documentation

Clarifies that `lerp()` can be used for interpolation or extrapolation.
Links to the GlobalScope `lerp()` docs.
This commit is contained in:
tetrapod00 2024-12-03 15:14:44 -08:00
parent 56a7dba10b
commit 0332b3bf10
6 changed files with 16 additions and 6 deletions

View File

@ -306,7 +306,9 @@
<param index="0" name="to" type="Color" />
<param index="1" name="weight" type="float" />
<description>
Returns the linear interpolation between this color's components and [param to]'s components. The interpolation factor [param weight] should be between 0.0 and 1.0 (inclusive). See also [method @GlobalScope.lerp].
Returns the linear interpolation between this color's components and [param to]'s components.
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
[codeblocks]
[gdscript]
var red = Color(1.0, 0.0, 0.0)

View File

@ -145,7 +145,8 @@
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this transform and [param xform] by the given [param weight].
The [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range are allowed and can be used to perform [i]extrapolation[/i] instead.
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
</description>
</method>
<method name="inverse" qualifiers="const">

View File

@ -72,7 +72,8 @@
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this transform and [param xform] by the given [param weight].
The [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Values outside this range are allowed and can be used to perform [i]extrapolation[/i] instead.
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
</description>
</method>
<method name="inverse" qualifiers="const">

View File

@ -263,7 +263,9 @@
<param index="0" name="to" type="Vector2" />
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight].
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
</description>
</method>
<method name="limit_length" qualifiers="const" keywords="truncate">

View File

@ -232,7 +232,9 @@
<param index="0" name="to" type="Vector3" />
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight].
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
</description>
</method>
<method name="limit_length" qualifiers="const" keywords="truncate">

View File

@ -181,7 +181,9 @@
<param index="0" name="to" type="Vector4" />
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight].
To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method @GlobalScope.clampf] to limit [param weight].
See also [method @GlobalScope.lerp].
</description>
</method>
<method name="max" qualifiers="const">