Skip to content

Commit

Permalink
refactor thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
diclophis committed Sep 21, 2012
1 parent 433b145 commit 6b46898
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions public/javascripts/ctr.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ var onWindowResize = function(cmra, rndr) {
rndr.setSize(wsa.x, wsa.y);
};

var animate = function(rndr, scne, cmra, sts) {
requestAnimationFrame(animate.bind(this, rndr, scne, cmra, sts));
rndr.render(scne, cmra);
sts.update();
var animate = function() {
//rndr, scne, cmra, sts) {
//, rndr, scne, cmra, sts));
requestAnimationFrame(animate.bind(this));
this.renderer.render(this.scene, this.camera);
this.stats.update();

/*
for(var i=0; i<pointers.length; i++) {
Expand Down Expand Up @@ -712,7 +714,10 @@ var run = function(body) {
scene: scene,
speedUp: false,
paused: false,
forward_angle: 0
forward_angle: 0,
renderer: renderer,
scene: scene,
stats: stats
};

//document.getElementById("fullscreen-form").addEventListener('submit', onContClick, false);
Expand All @@ -722,9 +727,10 @@ var run = function(body) {
renderer.domElement.addEventListener('pointermove', onPointerMove.bind(thingy), false);
renderer.domElement.addEventListener('pointerup', onPointerUp.bind(thingy), false);

window.addEventListener('resize', onWindowResize.bind(thingy, camera, renderer), false);
window.addEventListener('resize', onWindowResize.bind(thingy), false);

animate(renderer, scene, camera, stats);
//(renderer, scene, camera, stats);
animate.apply(thingy)
// (Date.now(), 0, 0, new THREE.Vector3(0, 0, 0), car_one, 1, camera, thingy);
tick.apply(thingy);
});
Expand Down

0 comments on commit 6b46898

Please sign in to comment.