3 ms·
if ((v1.x()-v2.x())*(v1.x()-v2.x())+(v1.y()-v2.y())*(v1.y())-v2.y())+(v1.z()-v2.z())*(v1.z()-v2.z()) > distance*distance) { // collision } Would yo
by ajuc 4y ago
if ((v1.x()-v2.x())*(v1.x()-v2.x())+(v1.y()-v2.y())*(v1.y())-v2.y())+(v1.z()-v2.z())*(v1.z()-v2.z()) > distance*distance) {
// collision
}
Would you like this to fail to compile? Or would you prefer it to silently return the wrong value?
- wstuartcl 4y agoif collisioncheck(v1,v2, distance) { // collision } where you have defined an actually readable equivalent inside of collisioncheck would be my prerogative... I also agree paren matching failures should error, but your example is NOT why.
- matthewmacleod 4y agoI'd prefer the compiler file an HR complaint against the author.