OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 * Hander for the scroll wheel. | 413 * Hander for the scroll wheel. |
414 * @param {Event} e Mouse event. | 414 * @param {Event} e Mouse event. |
415 */ | 415 */ |
416 function onWheel(e) { | 416 function onWheel(e) { |
417 if (e.deltaY) { | 417 if (e.deltaY) { |
418 var target = g_camera.minFieldOfView; | 418 var target = g_camera.minFieldOfView; |
419 if (e.deltaY < 0) { | 419 if (e.deltaY < 0) { |
420 target = g_camera.maxFieldOfView; | 420 target = g_camera.maxFieldOfView; |
421 } | 421 } |
422 | 422 |
423 g_camera.fieldOfView = g_math.lerpVector(target, g_camera.fieldOfView, 0.9); | 423 g_camera.fieldOfView = g_math.lerpScalar(target, g_camera.fieldOfView, 0.9); |
424 | 424 |
425 updateProjection(); | 425 updateProjection(); |
426 stopAnimatedCamera(); | 426 stopAnimatedCamera(); |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 // *************************** Keyboard functions ****************************** | 430 // *************************** Keyboard functions ****************************** |
431 | 431 |
432 /** | 432 /** |
433 * Tracks key down events. | 433 * Tracks key down events. |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 | 2654 |
2655 /** | 2655 /** |
2656 * Removes any callbacks so they don't get called after the page has unloaded. | 2656 * Removes any callbacks so they don't get called after the page has unloaded. |
2657 */ | 2657 */ |
2658 function uninit() { | 2658 function uninit() { |
2659 if (g_client) { | 2659 if (g_client) { |
2660 g_client.cleanup(); | 2660 g_client.cleanup(); |
2661 } | 2661 } |
2662 } | 2662 } |
2663 | 2663 |
OLD | NEW |