Collision realisation with SAT (canvas, javascript)
问题 So, I have this simple 2d train sim, and I already made a pretty nice SAT realisation, that works without errors (at least I have not stumbled upon any): function calcCollision(self){ var dist = self.distanceCheck(); var possible = [], collision = []; var myBox, otherBox, myMin, myMax, otherMin, otherMax, myBoxRecalc = [], otherBoxRecalc = []; for (var i=0;i<trainCount;i++){ if (dist[i]!="SELF"&&dist[i]<=(dTrain+10)){ possible.push(i); } } if (possible.length!==0){ myBox = self.box(); self