Commit 66b8b2c4 authored by ogomez92's avatar ogomez92

lol

parent d04cf2d7
......@@ -66,7 +66,7 @@ class Car {
}
if (this.currentGear==0) this.currentGear=1;
if (this.getGear()<this.currentGear) this.currentGear=this.getGear();
this.sndEngine.playbackRate=utils.progressPitch(this.speed/this.currentGear,this.speedPerGear);
this.sndEngine.playbackRate=utils.progressPitch(this.speed/this.currentGear,0,this.speedPerGear,1,1.8);
this.player.speed=this.speed*0.0004;
this.player.move();
......
......@@ -4,6 +4,9 @@ progressPan(current, max) {
return ((current*200/max)-100)/100;
}
progressPitch(current,min,max,minPitch,maxPitch) {
if (current==0) console.log("current: "+current);
if (min==0) console.log("min:"+min);
if (max==0) console.log("max"+max);
return (current/(min+max))*(maxPitch-minPitch)+minPitch;
}
distance3D(x1, y1, z1, x2, y2, z2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment