File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ export class Curve {
182182 deltaTime : 1.0 / this . __automaton . resolution ,
183183 value : 0.0 ,
184184 progress : 0.0 ,
185+ elapsed : 0.0 ,
185186 resolution : this . __automaton . resolution ,
186187 length : fx . length ,
187188 params : fx . params ,
@@ -195,7 +196,8 @@ export class Curve {
195196 context . index = i + i0 ;
196197 context . time = context . index / this . __automaton . resolution ;
197198 context . value = this . __values [ i + i0 ] ;
198- context . progress = ( context . time - fx . time ) / fx . length ;
199+ context . elapsed = context . time - fx . time ;
200+ context . progress = context . elapsed / fx . length ;
199201 tempValues [ i ] = fxDef . func ( context ) ;
200202
201203 context . init = false ;
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ export interface FxContext {
4343 */
4444 deltaTime : number ;
4545
46+ /**
47+ * Current elapsed time since the fx started.
48+ */
49+ elapsed : number ;
50+
4651 /**
4752 * Progress of current position of the fx section, in [0-1].
4853 */
You can’t perform that action at this time.
0 commit comments