Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Code cleanup.

  • Loading branch information...
commit 721d111647b1564d2088990d78e1980db8851e80 1 parent 4888531
nincode nincode authored
4 engine/core/tick.js
View
@@ -35,14 +35,14 @@ var Tick = (function() {
if (!GameFrame.settings.hidefps) {
if (typeof(Benchmark) !== 'undefined' && Benchmark !== undefined && Benchmark.name) {
var name = Benchmark.name;
- UI.addHTML(null, 'fps', {uiclass: 'testype ui_html', pos: [5, 55], resetlast: true, markup: 'fps: ' + lastfps + ' ' + lastfps2 + '<br />' +
+ UI.addHTML(null, 'fps', {uiclass: 'testype ui_html', pos: [5, 55], resetlast: true, markup: 'fps: ' + lastfps + '<br />' +
name.render_mode + ':' + name.sprites + ':' + name.render_path + '<br />' +
Browser.winsize[0] + 'x' + Browser.winsize[1] + '<br />' +
GameFrame.getViewport().dstyle.width + 'x' + GameFrame.getViewport().dstyle.height + '<br />' +
Benchmark.count()});
} else {
UI.addHTML(null, 'fps', {uiclass: 'testype ui_html', pos: [5, 55], resetlast: true, markup: 'fps: ' + lastfps + '<br />' +
- Browser.winsize[0] + 'x' + Browser.winsize[1] + "<br />" + Tick.frames + "<br/>" + lastfps2});
+ Browser.winsize[0] + 'x' + Browser.winsize[1] + "<br />" + Tick.frames});
}
}
}
42 webglbench/js/camera.js
View
@@ -43,43 +43,13 @@ var TrenchCamera = (function() {
var camera_dir = [0,1,0];
var camera_up = [0,0,1];
-// rotation_rate = 0;
-
- camera_up[2] = -Math.sin(rotation);
- camera_up[0] = Math.cos(rotation);
- rotation += dt * rotation_rate;
- while (rotation > 2 * Math.PI) {
- rotation -= 2 * Math.PI;
- }
-
- /*
- var player_pos = TrenchPlayer.getPosition();
- if (paused) {
- camera_dir[0] = Math.sin(rotation);
- camera_dir[1] = Math.cos(rotation);
- Math3D.addVec3Self(camera_pos,
- Math3D.scaleVec3(camera_dir,
- -rotation_distance)
- );
- rotation += dt * rotation_rate;
- while (rotation > 2 * Math.PI) {
- rotation -= 2 * Math.PI;
- }
- } else {
- camera_pos[1] = player_pos[1] - camera_distance;
- player_pos[1] = 0;
- var dist = Math3D.normalizeVec3(player_pos);
- var cam_dist = dist * dist * 0.25;
- if (cam_dist > dist * 0.75) {
- cam_dist = dist * 0.75;
- }
- Math3D.scaleVec3Self(player_pos, cam_dist);
- camera_pos[0] = player_pos[0];
- camera_pos[2] = player_pos[2] + 2.5;
-
- rotation = 0;
+ camera_up[2] = -Math.sin(rotation);
+ camera_up[0] = Math.cos(rotation);
+ rotation += dt * rotation_rate;
+ while (rotation > 2 * Math.PI) {
+ rotation -= 2 * Math.PI;
}
-*/
+
var camera_matrix = Math3D.mat4x4();
Math3D.orientMat4x4(camera_matrix, camera_dir, camera_up);
Math3D.translateMat4x4(camera_matrix, camera_pos);
8 webglbench/js/init.js
View
@@ -48,19 +48,15 @@
box_model = model_context.createModel(Box_Model);
ship_model = model_context.createModel(Ship_Junebug_01);
-// TrenchPlayer.init(ship_model);
TrenchCamera.init(viewport);
GeometryScaling.init(box_model);
TrenchTrack.init(box_model);
-// TrenchProjectile.init(box_model);
}
if (render_inited && needs_reset) {
-// TrenchPlayer.reset();
TrenchCamera.reset();
- GeometryScaling.reset(3, 3, 3);
+ GeometryScaling.reset(20, 13, 13);
TrenchTrack.reset();
-// TrenchProjectile.reset();
needs_reset = false;
}
@@ -71,8 +67,6 @@
}
if (play_game) {
-// TrenchProjectile.tick(delta_time);
-// TrenchPlayer.tick(delta_time);
TrenchTrack.tick(delta_time);
GeometryScaling.tick(delta_time);
}
0  webglbench/trench.js → webglbench/webglbench.js
View
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.