Skip to content

Commit

Permalink
Merge pull request #34 from KoltesDigital/feature-paste-time
Browse files Browse the repository at this point in the history
Add time getter
  • Loading branch information
fand authored May 24, 2019
2 parents 5c48f72 + 1de41f9 commit c62e524
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/veda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ export default class Veda {
this.soundRenderer.setLength(length);
}

getTime(): number {
return (Date.now() - this.start) / 1000;
}

resetTime(): void {
this.start = Date.now();
this.uniforms.time.value = 0;
Expand Down Expand Up @@ -653,7 +657,7 @@ export default class Veda {
// update start so that time dosn't change after stopRecording
this.start = Date.now() - relTime * 1000;
} else {
this.uniforms.time.value = (Date.now() - this.start) / 1000;
this.uniforms.time.value = this.getTime();
}

this.targets = [this.targets[1], this.targets[0]];
Expand Down

0 comments on commit c62e524

Please sign in to comment.