mirror of
https://github.com/seigler/webgl-threejs-hello
synced 2025-07-27 09:46:13 +00:00
⚡ Fast moving clouds with transparency and shadows
This commit is contained in:
parent
9dc521e39a
commit
8721b90d84
11 changed files with 88 additions and 111 deletions
|
@ -3,6 +3,7 @@ class Loop {
|
|||
constructor() {
|
||||
this._idRAF = -1;
|
||||
this._count = 0;
|
||||
this._time = (new Date()).getTime();
|
||||
|
||||
this._listeners = [];
|
||||
|
||||
|
@ -13,10 +14,11 @@ class Loop {
|
|||
_update() {
|
||||
let listener = null;
|
||||
let i = this._count;
|
||||
this._time = (new Date()).getTime()
|
||||
while (--i >= 0) {
|
||||
listener = this._listeners[i];
|
||||
if (listener) {
|
||||
listener.apply(this, null);
|
||||
listener.apply(this, [this._time]);
|
||||
}
|
||||
}
|
||||
this._idRAF = requestAnimationFrame(this._binds.update);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue