You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Added smoothstep built-in function
(cherry picked from commit 514a3fb96a)
This commit is contained in:
committed by
Hein-Pieter van Braam-Stewart
parent
340bf6e80c
commit
6ab01490f5
@@ -973,6 +973,24 @@
|
||||
[/codeblock]
|
||||
</description>
|
||||
</method>
|
||||
<method name="smoothstep">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="from" type="float">
|
||||
</argument>
|
||||
<argument index="1" name="to" type="float">
|
||||
</argument>
|
||||
<argument index="2" name="weight" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a number smoothly interpolated between the [code]from[/code] and [code]to[/code], based on the [code]weight[/code]. Similar to [method lerp], but interpolates faster at the beginning and slower at the end.
|
||||
[codeblock]
|
||||
smooth_step(0, 2, 0.5) # returns 0.15
|
||||
smooth_step(0, 2, 1.0) # returns 0.5
|
||||
smooth_step(0, 2, 2.0) # returns 1.0
|
||||
[/codeblock]
|
||||
</description>
|
||||
</method>
|
||||
<method name="sqrt">
|
||||
<return type="float">
|
||||
</return>
|
||||
|
||||
Reference in New Issue
Block a user