Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: samples/beachdemo/beachdemo.js

Issue 149139: Fix scrollwheel in beachdemo (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698