| OLD | NEW |
| (Empty) | |
| 1 (function(scope) { |
| 2 'use strict'; |
| 3 |
| 4 var token = null; |
| 5 |
| 6 // An extremely cheesy animation. |
| 7 function tick(context) { |
| 8 var seconds = context.timestamp / 1000.0; |
| 9 var matrix = context.getMatrix(token); |
| 10 matrix.m14 = 200.0 + 100 * Math.sin(seconds); |
| 11 context.setMatrix(token, matrix); |
| 12 scope.teleportMessage(context, tick); |
| 13 } |
| 14 |
| 15 scope.onmessage = function(e) { |
| 16 token = e.data; |
| 17 var context = new TeleportContext([token]); |
| 18 scope.teleportMessage(context, tick); |
| 19 }; |
| 20 |
| 21 })(self); |
| OLD | NEW |