* Go forward in time. * * @param timestep Custom timestep different from the config one * @returns
(timestep?: number)
| 193 | * @returns |
| 194 | */ |
| 195 | forward(timestep?: number) { |
| 196 | this.pause(); |
| 197 | |
| 198 | if (!this.rules.length) { |
| 199 | console.warn("Animation: Can't go forward without a definition"); |
| 200 | return; |
| 201 | } |
| 202 | timestep = timestep ?? this.config.timestep; |
| 203 | |
| 204 | const time = this.currentTime + timestep; |
| 205 | |
| 206 | if (time <= this._duration) { |
| 207 | this.updateFrame(time); |
| 208 | } else { |
| 209 | this.completed = true; |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * Go back in time. |
no test coverage detected