daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest May 17th, 2018 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(var i = 0, data, sens; i < series.length; i++){
  2.         if(!series[i].mouse.track) continue;
  3.         data = series[i].data;        
  4.         sens = (series[i].mouse.sensibility*series[i].mouse.sensibility);
  5.         for(var j = 0, xpow, ypow; j < data.length; j++){
  6.           xpow = Math.pow(hozScale*(data[j][0] - mouse.x), 2);
  7.           ypow = Math.pow(vertScale*(data[j][1] - mouse.y), 2);
  8.           if(xpow < sens && ypow < sens && Math.sqrt(xpow+ypow) < n.dist){
  9.             n.dist = Math.sqrt(xpow+ypow);
  10.             n.x = data[j][0];
  11.             n.y = data[j][1];
  12.             n.mouse = series[i].mouse;
  13.           }
  14.         }
  15.       }
RAW Paste Data
Top