|
@@ -71,6 +71,17 @@
|
|
|
|
|
|
Returns a value that alternates between 0 and [param:Float length].</p>
|
|
|
|
|
|
+ <h3>[method:Float damp]( [param:Float x], [param:Float y], [param:Float lambda], [param:Float dt] )</h3>
|
|
|
+ <p>
|
|
|
+ [page:Float x] - Current point. <br />
|
|
|
+ [page:Float y] - Target point. <br />
|
|
|
+ [page:Float lambda] - A higher lambda value will make the movement more sudden, and a lower value will make the movement more gradual. <br />
|
|
|
+ [page:Float dt] - Delta time in seconds.<br><br />
|
|
|
+
|
|
|
+ Smoothly interpolate a number from [page:Float x] toward [page:Float y] in a spring-like manner using the [page:Float dt] to maintain frame rate independent movement.
|
|
|
+ For details, see [link:http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/ Frame Rate Independent Damping Using Lerp].
|
|
|
+ </p>
|
|
|
+
|
|
|
<h3>[method:Integer ceilPowerOfTwo]( [param:Number n] )</h3>
|
|
|
<p>Returns the smallest power of 2 that is greater than or equal to [page:Number n].</p>
|
|
|
|